public function getCMSFields() { $self =& $this; $this->beforeUpdateCMSFields(function (FieldList $fields) use($self) { /** * @var GridFieldConfig_RecordEditor $conf */ $conf = GridFieldConfig_RecordEditor::create(); $fields->addFieldToTab("Root." . _t('CaseStudyHolder.CaseStudiesTabName', 'Case Studies'), Gridfield::create('CaseStudies', _t('CaseStudyHolder.CaseStudiesFieldTitle', 'CaseStudies'), $this->CaseStudies(), $conf)); }); $fields = parent::getCMSFields(); return $fields; }
public function getCMSFields() { $self =& $this; $this->beforeUpdateCMSFields(function (FieldList $fields) use($self) { /** * @var GridFieldConfig_RecordEditor $conf */ $conf = GridFieldConfig_RecordEditor::create(); $conf->addComponent(new GridFieldSortableRows('SortOrder')); $fields->addFieldToTab("Root." . _t('TeamHolder.TeamTabName', 'Team'), Gridfield::create('Team', _t('Team.TeamFieldTitle', 'Team'), $this->TeamMembers(), $conf)); }); $fields = parent::getCMSFields(); return $fields; }
public function getCMSFields() { $self =& $this; $this->beforeUpdateCMSFields(function (FieldList $fields) use($self) { /** * @var GridFieldConfig_RecordEditor $conf */ $conf = GridFieldConfig_RecordEditor::create(); $conf->addComponent(new GridFieldSortableRows('SortOrder')); $fields->addFieldToTab("Root." . _t('HomePage.BlockTabName', 'Blocks'), Gridfield::create('HomePageBlocks', _t('HomePage.Block', 'Blocks'), $this->HomePageBlocks(), $conf)); }); $fields = parent::getCMSFields(); return $fields; }
function updateCMSFields(FieldList $fields) { /** * @var GridFieldConfig $conf */ $conf = GridFieldConfig_RecordEditor::create(10); $conf->addComponent(new GridFieldSortableRows('SortOrder')); $conf->addComponent(new GridFieldGalleryTheme('Attachment')); $conf->addComponent(new GridFieldBulkUpload()); $conf->getComponentByType('GridFieldBulkUpload')->setUfSetup('setFolderName', 'header'); if (class_exists('GridFieldPaginatorWithShowAll')) { $conf->removeComponentsByType('GridFieldPaginator'); $conf->addComponent(new GridFieldPaginatorWithShowAll(10)); } $fields->addFieldToTab("Root." . _t('HeaderGalleryExtension.GalleryTabName', 'Header Gallery'), Gridfield::create('HeaderGallery', _t('HeaderGalleryExtension.GalleryFieldTitle', 'Gallery in header'), $this->owner->HeaderGallery(), $conf)); }