Source of file SectionTabBlock.php
Size: 0,948 Bytes - Last Modified: 2021-12-23T10:11:59+00:00
/var/www/docs.ssmods.com/process/src/code/Blocks/SectionTabBlock.php
123456789101112131415161718192021222324252627282930313233343536373839404142 | <?php class SectionTabBlock extends Section { private static $db = array( ); private static $has_many = array( 'Blocks' => 'SectionTextBlock' ); public function getCMSFields() { $fields = parent::getCMSFields(); $saveWarning = LiteralField::create("Warning", "<p class='cms-warning-label'>Please Save changes before adding content</p>"); $sectionconfig = GridFieldConfig_RelationEditor::create() ->removeComponentsByType('GridFieldAddNewButton') ->addComponents( new GridFieldDeleteAction() ); if ($this->ID) { $sectionconfig->addComponents( new GridFieldOrderableRows('SortOrder'), new GridFieldAddNewButton() ); } else { $fields->addFieldToTab('Root.Main', $saveWarning); } $sectiongridField = GridField::create('Blocks', "Content", $this->Blocks(), $sectionconfig); $fields->addFieldToTab("Root.Main", $sectiongridField); $this->removeEmptyTabs($fields); return $fields; } } |