コード例 #1
0
 public function updateCMSFields(FieldList $fields)
 {
     $gridConfig = singleton('Block')->has_extension('Sortable') ? GridFieldConfig_BlockEditor::create('SortOrder') : GridFieldConfig_BlockEditor::create();
     $gridField = GridField::create('Blocks', _t('PageBlocks.BLOCK', 'Block', 'GridField Title'), $this->owner->Blocks(), $gridConfig);
     $gridField->setModelClass('Block');
     $fields->addFieldsToTab('Root.Main', array($gridField), 'Metadata');
 }
コード例 #2
0
ファイル: PageBlocks.php プロジェクト: bummzack/page-blocks
 public function updateCMSFields(FieldList $fields)
 {
     $gridConfig = GridFieldConfig_BlockEditor::create('SortOrder', $this->owner->config()->get('allowed_blocks'));
     $gridField = GridField::create('Blocks', _t('PageBlocks.BLOCK', 'Block', 'GridField Title'), $this->owner->Blocks(), $gridConfig);
     $gridField->setModelClass('Block');
     $fields->addFieldsToTab('Root.Main', array($gridField), 'Metadata');
 }