public function getEditForm($id = null, $fields = null) { $record = GlobalContent::inst(); $fields = $record->getCMSFields(); $actions = $this->getCMSActions($record); if ($record && !$record->canView()) { return Security::permissionFailure($this); } // Tab nav in CMS is rendered through separate template /** @var TabSet $root */ $root = $fields->fieldByName('Root'); $root->setTemplate('CMSTabSet'); $form = $this->buildForm($fields, $actions); $this->extend('updateEditForm', $form); $form->loadDataFrom($record); $this->extend('updateEditFormWithData', $form); return $form; }
public static function GlobalContent($key = null) { $inst = GlobalContent::inst(); return is_null($key) ? $inst : $inst->{$key}; }