From 26b8dcd39f82dfeebce74f83e83f42b2b3ff06f9 Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Wed, 3 Aug 2016 14:12:53 +1200 Subject: [PATCH] Make employe fields untabbed to test flat forms --- code/Employee.php | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/code/Employee.php b/code/Employee.php index cc95c99..0fb6d9b 100644 --- a/code/Employee.php +++ b/code/Employee.php @@ -36,23 +36,10 @@ class Employee extends DataObject public function getCMSFields() { - $fields = parent::getCMSFields(); - - if (method_exists('SilverStripe\\ORM\\ManyManyList', 'getExtraFields')) { - $fields->addFieldToTab('Root.Main', - new NumericField('ManyMany[YearStart]', 'Year started (3.1, many-many only)') - ); - $fields->addFieldToTab('Root.Main', - new TextField('ManyMany[Role]', 'Role (3.1, many-many only)') - ); - } - - // 3.1 only - if (method_exists('UploadField', 'setAllowedFileCategories')) { - $fields->dataFieldByName('ProfileImageID')->setAllowedFileCategories('image'); - } - - + // Use basic scaffolder (no tabs) + $fields = $this->scaffoldFormFields(); + $fields->push(new NumericField('ManyMany[YearStart]', 'Year started (3.1, many-many only)')); + $fields->push(new TextField('ManyMany[Role]', 'Role (3.1, many-many only)')); return $fields; }