本文整理汇总了PHP中TreeDropdownField::setDescription方法的典型用法代码示例。如果您正苦于以下问题:PHP TreeDropdownField::setDescription方法的具体用法?PHP TreeDropdownField::setDescription怎么用?PHP TreeDropdownField::setDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TreeDropdownField
的用法示例。
在下文中一共展示了TreeDropdownField::setDescription方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCMSFieldsForProductSliderWidget
/**
* Returns the input fields for this widget.
*
* @param Widget $widget Widget to initialize
* @param array $fetchMethods Optional list of product fetch methods
*
* @return FieldList
*
* @author Sebastian Diel <sdiel@pixeltricks.de>
* @since 13.03.2014
*/
public static function getCMSFieldsForProductSliderWidget(Widget $widget, $fetchMethods = array())
{
if (empty($fetchMethods)) {
$fetchMethods = array('random' => $widget->fieldLabel('fetchMethodRandom'), 'sortOrderAsc' => $widget->fieldLabel('fetchMethodSortOrderAsc'), 'sortOrderDesc' => $widget->fieldLabel('fetchMethodSortOrderDesc'));
}
$fields = SilvercartDataObject::getCMSFields($widget, 'ExtraCssClasses', false);
$productGroupDropdown = new TreeDropdownField('SilvercartProductGroupPageID', $widget->fieldLabel('SilvercartProductGroupPage'), 'SiteTree');
$productGroupDropdown->setTreeBaseID(SilvercartTools::PageByIdentifierCode('SilvercartProductGroupHolder')->ID);
$toggleFields = array($fields->dataFieldByName('numberOfProductsToShow'), $fields->dataFieldByName('numberOfProductsToFetch'), $fields->dataFieldByName('fetchMethod'), SilvercartGroupViewHandler::getGroupViewDropdownField('GroupView', $widget->fieldLabel('GroupView'), $widget->GroupView));
$fields->dataFieldByName('fetchMethod')->setSource($fetchMethods);
$fields->dataFieldByName('numberOfProductsToShow')->setDescription($widget->fieldLabel('numberOfProductsToShowInfo'));
$fields->dataFieldByName('isContentView')->setDescription($widget->fieldLabel('isContentViewInfo'));
if (is_object($fields->dataFieldByName('useSelectionMethod'))) {
$fields->dataFieldByName('useSelectionMethod')->setSource(array('productGroup' => $widget->fieldLabel('SelectionMethodProductGroup'), 'products' => $widget->fieldLabel('SelectionMethodProducts')));
$toggleFields[] = $fields->dataFieldByName('useSelectionMethod');
$productGroupDropdown->setDescription($widget->fieldLabel('SilvercartProductGroupPageDescription'));
}
$toggleFields[] = $productGroupDropdown;
$productDataToggle = ToggleCompositeField::create('ProductDataToggle', $widget->fieldLabel('ProductDataToggle'), $toggleFields)->setHeadingLevel(4);
$productRelationToggle = ToggleCompositeField::create('ProductRelationToggle', $widget->fieldLabel('ProductRelationToggle'), array($fields->dataFieldByName('SilvercartProducts')))->setHeadingLevel(4);
$fields->removeByName('numberOfProductsToShow');
$fields->removeByName('numberOfProductsToFetch');
$fields->removeByName('fetchMethod');
$fields->removeByName('useSelectionMethod');
$fields->removeByName('SilvercartProducts');
$fields->addFieldToTab("Root.Main", $productDataToggle);
$fields->addFieldToTab("Root.Main", $productRelationToggle);
$widget->getCMSFieldsSliderTab($fields);
//$widget->getCMSFieldsRoundaboutTab($fields);
return $fields;
}
示例2: getCMSFields
/**
* Add fields to manage FAQs.
*
* @return $fields
*/
public function getCMSFields()
{
$fields = parent::getCMSFields();
$this->extend('beforeGetCMSFields', $fields);
// setup category dropdown field
$taxonomyRoot = self::getRootCategory();
$categoryField = new TreeDropdownField('CategoryID', 'Category', 'TaxonomyTerm', 'ID', 'Name');
//change this to 0 if you want the root category to show
$categoryField->setTreeBaseID($taxonomyRoot->ID);
$categoryField->setDescription(sprintf('Select one <a href="admin/taxonomy/TaxonomyTerm/EditForm/field/TaxonomyTerm/item/%d/#Root_Children">' . 'FAQ Category</a>', $taxonomyRoot->ID));
$fields->addFieldToTab('Root.Main', $categoryField);
$this->extend('updateGetCMSFields', $fields);
return $fields;
}