本文整理汇总了PHP中SiteTree::getCMSFields方法的典型用法代码示例。如果您正苦于以下问题:PHP SiteTree::getCMSFields方法的具体用法?PHP SiteTree::getCMSFields怎么用?PHP SiteTree::getCMSFields使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SiteTree
的用法示例。
在下文中一共展示了SiteTree::getCMSFields方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCMSFields
function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->replaceField("Content", new TextareaField("Content", _t("SiteTree.Content", "%Content%")));
$fields->addFieldsToTab('Root.Content.Shop', array(new Textfield("PriceValue", _t("Shop.ItemOption.PriceValue", "%PriceValue%")), new DropdownField("Modus", _t("Shop.ItemOption.Modus", "%Modus%"), singleton($this->ClassName)->dbObject('Modus')->enumValues()), new Textfield("OptionKey", _t("Shop.ItemOption.OptionKey", "%Option Key%")), new FileIFrameField('Download', _t("Shop.ItemOption.Download", "%Download%"))));
return $fields;
}
示例2: getCMSFields
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Widgets",
new WidgetAreaEditor("SideBar")
);
return $fields;
}
示例3: getCMSFields
function getCMSFields()
{
$fields = parent::getCMSFields();
//get all the fields...
$fields->addFieldToTab('Root.Main', new TextField('MetaTitle', 'Meta Title'), 'MetaDescription');
return $fields;
}
示例4: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Main', new CheckboxField('InMainNavigation', 'In Main Navigation anzeigen'));
$fields->addFieldToTab('Root.Main', new CheckboxField('InFooterNavigation', 'In Footer Navigation anzeigen'));
return $fields;
}
示例5: getCMSFields
function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->addFieldsToTab("Root.Content.Shop", array(new TextField('ProductKey', _t("Shop.Item.ProductKey", "%ProductKey%")), new NumericField('Price', _t("Shop.Item.Price", "%Price%")), new CheckboxField('Featured', _t("Shop.Item.Featured", "%Featured%")), new TextareaField('Summary', _t("Shop.Item.Summary", "%Summary%"), 5), new TextField('StockQuantity', _t("Shop.Item.StockQuantity", "%StockQuantity%")), new DateField('StockDate', _t("Shop.Item.StockDate", "%StockDate%")), new DropdownField('Currency', _t("Shop.Item.Currency", "%Currency%"), singleton($this->ClassName)->dbObject('Currency')->enumValues()), new ReadonlyField('OrderCount', _t("Shop.Item.OrderCount", "%Orders count%", $this->OrderCount))));
$fields->addFieldsToTab('Root.Content.' . _t("Shop.Item.Pictures", "%Pictures%"), array(new FileIFrameField('Picture', _t("Shop.Item.Picture", "%Picture%")), new TreeDropdownField('PictureFolderID', _t("Shop.Item.PictureFolder", "%PictureFolder%"), "Folder")));
return $fields;
}
示例6: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.SideBarRight', new HTMLEditorField('ContentRight', 'Content Right'));
$fields->addFieldToTab('Root.Main', new TextField('TitleBarTitle', 'Browser Title'), 'URLSegment');
return $fields;
}
示例7: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->insertBefore(TextareaField::create('Intro', 'Intro'), 'Content');
$fields->insertAfter(ColorPaletteField::create("Colour", "Colour", array('night' => '#333333', 'air' => '#009EE2', 'earth' => ' #79c608', 'passion' => '#b02635', 'people' => '#de347f', 'inspiration' => '#783980')), "Intro");
$fields->insertBefore($image = UploadField::create('SplashImage', 'Splash Image'), 'Content');
$image->setFolderName('Uploads/Splash-Images');
if ($this->ClassName === "Page" || $this->ClassName === "HomePage") {
$fields->insertAfter(HTMLEditorField::create('ExtraContent'), 'Content');
$gridField = new GridField('FeatureItems', 'FeatureItems', $this->FeatureItems()->sort(array('Sort' => 'ASC', 'Archived' => 'ASC')), $config = GridFieldConfig_RelationEditor::create());
$gridField->setModelClass('FeatureItem');
$fields->addFieldToTab('Root.Features', $gridField);
$config->addComponent(new GridFieldOrderableRows());
} else {
if ($this->ClassName === "CalendarPage") {
$content = $fields->dataFieldByName('Content');
$content->addExtraClass('no-pagebreak');
$events = Event::get()->sort(array('StartDateTime' => 'Desc'))->filterByCallback(function ($record) {
return !$record->getIsPastEvent();
});
$gridField = new GridField('Event', 'Upcoming Events', $events, $config = GridFieldConfig_RecordEditor::create());
$gridField->setModelClass('Event');
$dataColumns = $config->getComponentByType('GridFieldDataColumns');
$dataColumns->setDisplayFields(array('Title' => 'Title', 'StartDateTime' => 'Date and Time', 'DatesAndTimeframe' => 'Presentation String'));
$fields->addFieldToTab('Root.UpcomingEvents', $gridField);
}
}
return $fields;
}
示例8: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
$imageField = new UploadField('PrimaryImage', 'Image');
$imageField->getValidator()->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png'));
$fields->addFieldToTab('Root.Main', $imageField, 'Content');
return $fields;
}
示例9: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
$gridField = new GridField('CarouselItems', 'Carousel', $this->CarouselItems(), GridFieldConfig_RelationEditor::create());
$gridField->setModelClass('CarouselItem');
$fields->addFieldToTab('Root.Carousel', $gridField);
return $fields;
}
示例10: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
//we use ToggleCompositeFields instead of tabs. it looks cleaner and 'lite'
$fields->addFieldToTab("Root.Main", ToggleCompositeField::create('Options', _t('Page.OPTIONS', 'Options'), array(CheckboxField::create('ShowInMenus', _t('Page.SHOWREGULARMENU', 'Show in regular Menu')), $tabBehaviour = new Tab('Settings', new DropdownField("ClassName", $this->fieldLabel('ClassName'), $this->getClassDropdown()), $parentTypeSelector = new CompositeField(new OptionsetField("ParentType", _t("SiteTree.PAGELOCATION", "Page location"), array("root" => _t("SiteTree.PARENTTYPE_ROOT", "Top-level page"), "subpage" => _t("SiteTree.PARENTTYPE_SUBPAGE", "Sub-page underneath a parent page"))), $parentIDField = new TreeDropdownField("ParentID", $this->fieldLabel('ParentID'), 'SiteTree', 'ID', 'MenuTitle')))))->setHeadingLevel(4), 'Metadata');
$fields->removeByName("ExtraMeta");
return $fields;
}
示例11: getCMSFields
function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.ContactForm', new CheckboxField('ContactFormDisplay', 'Show'));
$fields->addFieldToTab('Root.ContactForm', new EmailField('ContactFormSendTo', 'Send To Email'));
$fields->addFieldToTab('Root.ContactForm', new TextField('ContactFormSubject', 'Subject'));
return $fields;
}
示例12: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
// Add the banner image
$fields->addFieldToTab('Root.Main', new HeaderField('BannerSection', 'Banner'), 'Content');
$fields->addFieldToTab('Root.Main', new UploadField('BannerImage', 'Banner image'), 'Content');
return $fields;
}
示例13: getCMSFields
/**
* @return FieldList
*/
public function getCMSFields()
{
/** =========================================
* @var FieldList $fields
* ========================================*/
$fields = parent::getCMSFields();
return $fields;
}
示例14: getCMSFields
public function getCMSFields()
{
$f = parent::getCMSFields();
$img = new UploadField('Banner', 'Banner Image');
$img->setFolderName('Banners');
$f->addFieldToTab('Root.Main', $img, 'Content');
$f->addFieldToTab('Root.Main', new HTMLEditorField('BannerText', 'Banner Text'), 'Content');
return $f;
}
示例15: getCMSFields
public function getCMSFields()
{
// Get the fields from the parent implementation
$fields = parent::getCMSFields();
//google map module
$subtitle = new TextField('Subtitle', 'Subtitle');
$fields->addFieldToTab('Root.Main', $subtitle, 'Content');
return $fields;
}