CMS Fields
@return FieldList
978151
public function getCMSFields()
    {
        $fields = parent::getCMSFields();
        $fields->addFieldsToTab(
            'Root.Main',
            array(
                UploadField::create(
                    'ActionImage',
                    _t('Actions.IMAGE', 'Image')
                )
                ->setAllowedExtensions(array('jpg','png','gif')),
                TextareaField::create(
                    'ActionSummary',
                    _t('Actions.SUMMARY', 'Summary')
                )->setRows(3),
                TextField::create(
                    'ActionLabel',
                    _t('Actions.LABEL', 'Label')
                )
            ),
            'Type'
        );

        $this->extend('updateCMSFields', $fields);
        return $fields;
    }
1263833
public function getCMSFields()
    {
        $fields = new FieldList(new TabSet('Root'));
        $fields->addFieldToTab('Root.Main', new TextField('Title', $this->fieldLabel('Title')));

        $filter = '';

        $reqParent = isset($_REQUEST['ParentID']) ? (int) $_REQUEST['ParentID'] : 0;
        $attachTo = $this->ActionID ? $this->ActionID : $reqParent;

        if ($attachTo) {
            $action = DataObject::get_by_id(WorkflowAction::class, $attachTo);
            if ($action && $action->ID) {
                $filter = '"WorkflowDefID" = '.((int) $action->WorkflowDefID);
            }
        }

        $actions = DataObject::get(WorkflowAction::class, $filter);
        $options = array();
        if ($actions) {
            $options = $actions->map();
        }

        $defaultAction = $action ? $action->ID : "";

        $typeOptions = array(
            'Active' => _t('WorkflowTransition.Active', 'Active'),
            'Passive' => _t('WorkflowTransition.Passive', 'Passive'),
        );

        $fields->addFieldToTab('Root.Main', new DropdownField(
            'ActionID',
            $this->fieldLabel('ActionID'),
            $options,
            $defaultAction
        ));
        $fields->addFieldToTab('Root.Main', $nextActionDropdownField = new DropdownField(
            'NextActionID',
            $this->fieldLabel('NextActionID'),
            $options
        ));
        $nextActionDropdownField->setEmptyString(_t('WorkflowTransition.SELECTONE', '(Select one)'));
        $fields->addFieldToTab('Root.Main', new DropdownField(
            'Type',
            _t('WorkflowTransition.TYPE', 'Type'),
            $typeOptions
        ));

        $members = Member::get();
        $fields->findOrMakeTab(
            'Root.RestrictToUsers',
            _t('WorkflowTransition.TabTitle', 'Restrict to users')
        );
        $fields->addFieldToTab(
            'Root.RestrictToUsers',
            new CheckboxSetField('Users', _t('WorkflowDefinition.USERS', 'Restrict to Users'), $members)
        );
        $fields->addFieldToTab(
            'Root.RestrictToUsers',
            new TreeMultiselectField('Groups', _t('WorkflowDefinition.GROUPS', 'Restrict to Groups'), Group::class)
        );

        $this->extend('updateCMSFields', $fields);

        return $fields;
    }
866651
public function getCMSFields()
    {
        // Obtain Field Objects (from parent):
        
        $fields = parent::getCMSFields();
        
        // Remove Field Objects:
        
        $fields->fieldByName('Root')->removeByName('Style');
        
        // Create Main Fields:
        
        $fields->addFieldsToTab(
            'Root.Main',
            [
                CheckboxSetField::create(
                    'Areas',
                    $this->fieldLabel('Areas'),
                    AreaComponent::get()->map()
                )
            ]
        );
        
        // Insert Show On Field (within folder only):
        
        if ($this->getParent() instanceof PanelFolder) {
            
            $fields->insertAfter(
                SelectionGroup::create(
                    'ShowOn',
                    [
                        SelectionGroup_Item::create(
                            'AllPages',
                            null,
                            $this->fieldLabel('AllPages')
                        ),
                        SelectionGroup_Item::create(
                            'OnlyThesePages',
                            PageMultiselectField::create('Pages', ''),
                            $this->fieldLabel('OnlyThesePages')
                        )
                    ]
                )->setTitle($this->fieldLabel('ShowOn')),
                'Areas'
            );
            
        }
        
        // Create Options Fields:
        
        $fields->addFieldToTab(
            'Root.Options',
            FieldSection::create(
                'PanelOptions',
                $this->fieldLabel('PanelOptions'),
                [
                    CheckboxField::create(
                        'DoNotInherit',
                        $this->fieldLabel('DoNotInherit')
                    )
                ]
            )
        );
        
        // Answer Field Objects:
        
        return $fields;
    }
184504
public function getCMSFields()
    {
        $fields = parent::getCMSFields();
        $fields->addFieldsToTab(
            'Root.Main',
            array(
                CurrencySelectField::create(
                    'CurrenciesAccepted',
                    _t('SchemaLocalBusiness.CURRENCIESACCEPTED', 'Currencies accepted')
                ),
                TextField::create(
                    'PaymentAccepted',
                    _t('SchemaLocalBusiness.PAYMENTACCEPTED', 'Payment accepted')
                ),
                TextField::create(
                    'PriceRange',
                    _t('SchemaLocalBusiness.PRICERANGE', 'Price range')
                ),
                TextField::create(
                    'OpenHours',
                    _t('SchemaLocalBusiness.OPENHOURS', 'Open hours')
                )
            )
        );
        return $fields;
    }
1330486
public function getCMSFields()
    {
        // Obtain Field Objects (from parent):
        
        $fields = parent::getCMSFields();
        
        // Remove Field Objects:
        
        $fields->removeFieldsFromTab('Root.Main', ['Content', 'Metadata']);
        
        // Modify Field Objects:
        
        $fields->dataFieldByName('MenuTitle')->addExtraClass('hidden');
        
        // Answer Field Objects:
        
        return $fields;
    }
126623
public function getCMSFields() {
        $fields=new FieldList(
                            new TabSet('Root',
                                new Tab('Main', _t('Snippet.MAIN', '_Main'),
                                    DropdownField::create('LanguageID', _t('Snippet.LANGUAGE', '_Language'), SnippetLanguage::get()->where('"SnippetLanguage"."Hidden"=0 OR "SnippetLanguage"."ID"='.($this->LanguageID ? $this->LanguageID:0))->map('ID', 'Title'))->setEmptyString('---'),
                                    new TextField('Title', _t('Snippet.TITLE', '_Title'), null, 300),
                                    TextareaField::create('Description', _t('Snippet.DESCRIPTION', '_Description'))->setRows(5),
                                    PackageSelectionField::create('PackageID', _t('Snippet.PACKAGE', '_Package'), SnippetPackage::get()->map('ID', 'Title'))->setEmptyString(_t('Snippet.NOT_IN_PACKAGE', '_Not Part of a Package')),
                                    TextareaField::create('Text', _t('Snippet.CODE', '_Code'), $this->getSnippetText())->setRows(30)->addExtraClass('codeBankFullWidth')->addExtraClass('stacked'),
                                    TextareaField::create('Tags', _t('Snippet.TAGS', '_Tags (comma separate)'))->setRows(2)
                                )
                            )
                        );
        
        
        return $fields;
    }
677097
public function getCMSFields()
    {
        // Obtain Field Objects (from parent):
        
        $fields = parent::getCMSFields();
        
        // Modify Field Objects:
        
        $fields->fieldByName('Root.Style.TitleStyle')->setTitle('Heading');
        
        // Remove Field Objects:
        
        $fields->removeFieldFromTab('Root.Options', 'TitleOptions');
        
        // Answer Field Objects:
        
        return $fields;
    }
657174
public function getCMSPageFields()
    {
        $fields = FieldList::create(
            TextField::create(
                'Title',
                _t('PlaceableObject.TITLE', 'Title')
            ),
            SegmentField::create(
                'UrlSegment',
                _t('PlaceableObject.URLSEGMENT', 'Anchor')
            )
            ->setPreview($this->UrlSegment)
            ->setModifiers(
                array(
                    SlugSegmentFieldModifier::create()->setDefault('Title')
                )
            )
        );
        $this->extend('updateCMSPageFields', $fields);
        return $fields;
    }
870765
public function getCMSFields()
    {
        $fields = $this->scaffoldFormFields(
            array(
                // Don't allow has_many/many_many relationship editing before the record is first saved
                'includeRelations' => ($this->ID > 0),
                'tabbed' => true,
                'ajaxSafe' => true
            )
        );
        $fields->removeByName('PresetID');
        $fields->addFieldToTab(
            'Root.Main',
            ReadonlyField::create(
                'PresetName',
                _t('PlaceableObject.PRESET', 'Preset')
            )->setValue($this->Preset()->Title)
        );
        $this->extend('updateCMSFields', $fields);
        return $fields;
    }
1059061
public function getCMSFields()
    {
        // Obtain Field Objects (from parent):
        
        $fields = parent::getCMSFields();
        
        // Create Options Fields:
        
        $fields->addFieldToTab(
            'Root.Options',
            FieldSection::create(
                'NavigationOptions',
                $this->fieldLabel('NavigationOptions'),
                [
                    CheckboxField::create(
                        'HideTopLevel',
                        $this->fieldLabel('HideTopLevel')
                    )
                ]
            )
        );
        
        // Answer Field Objects:
        
        return $fields;
    }
231878
public function getCMSFields()
    {
        // Obtain Field Objects (from parent):
        
        $fields = parent::getCMSFields();
        
        // Create Main Fields:
        
        $fields->addFieldsToTab(
            'Root.Main',
            [
                TextField::create(
                    'EntityName',
                    $this->fieldLabel('EntityName')
                ),
                FieldGroup::create(
                    $this->fieldLabel('Years'),
                    [
                        TextField::create(
                            'YearStart',
                            ''
                        )->setAttribute('placeholder', $this->fieldLabel('YearStart')),
                        TextField::create(
                            'YearFinish',
                            ''
                        )->setAttribute('placeholder', $this->fieldLabel('YearFinish'))
                    ]
                ),
                PageDropdownField::create(
                    'CopyrightPageID',
                    $this->fieldLabel('CopyrightPageID')
                ),
                TextField::create(
                    'CopyrightURL',
                    $this->fieldLabel('CopyrightURL')
                ),
                PageDropdownField::create(
                    'EntityPageID',
                    $this->fieldLabel('EntityPageID')
                ),
                TextField::create(
                    'EntityURL',
                    $this->fieldLabel('EntityURL')
                )
            ]
        );
        
        // Create Options Fields:
        
        $fields->addFieldsToTab(
            'Root.Options',
            [
                FieldSection::create(
                    'CopyrightOptions',
                    $this->fieldLabel('CopyrightOptions'),
                    [
                        TextField::create(
                            'CopyrightNoun',
                            $this->fieldLabel('CopyrightNoun')
                        ),
                        TextField::create(
                            'CopyrightText',
                            $this->fieldLabel('CopyrightText')
                        ),
                        CheckboxField::create(
                            'OpenCopyrightLinkInNewTab',
                            $this->fieldLabel('OpenCopyrightLinkInNewTab')
                        ),
                        CheckboxField::create(
                            'OpenEntityLinkInNewTab',
                            $this->fieldLabel('OpenEntityLinkInNewTab')
                        ),
                        CheckboxField::create(
                            'CopyrightLinkDisabled',
                            $this->fieldLabel('CopyrightLinkDisabled')
                        ),
                        CheckboxField::create(
                            'EntityLinkDisabled',
                            $this->fieldLabel('EntityLinkDisabled')
                        )
                    ]
                )
            ]
        );
        
        // Answer Field Objects:
        
        return $fields;
    }
805821
public function getCMSFields()
    {
        $fields = new FieldList();
        $fields->push(new TabSet('Root', new Tab('Main')));

        if (Permission::check('REASSIGN_ACTIVE_WORKFLOWS')) {
            if ($this->WorkflowStatus == 'Paused' || $this->WorkflowStatus == 'Active') {
                $cmsUsers = Member::mapInCMSGroups();

                $fields->addFieldsToTab('Root.Main', array(
                    new HiddenField('DirectUpdate', '', 1),
                    new HeaderField(
                        'InstanceReassignHeader',
                        _t('WorkflowInstance.REASSIGN_HEADER', 'Reassign workflow')
                    ),
                    new CheckboxSetField('Users', _t('WorkflowDefinition.USERS', 'Users'), $cmsUsers),
                    new TreeMultiselectField('Groups', _t('WorkflowDefinition.GROUPS', 'Groups'), Group::class)
                ));
            }
        }

        if ($this->canEdit()) {
            $action = $this->CurrentAction();
            if ($action->exists()) {
                $actionFields = $this->getWorkflowFields();
                $fields->addFieldsToTab('Root.Main', $actionFields);

                $transitions = $action->getValidTransitions();
                if ($transitions) {
                    $fields->replaceField(
                        'TransitionID',
                        DropdownField::create("TransitionID", "Next action", $transitions->map())
                    );
                }
            }
        }

        $items = WorkflowActionInstance::get()->filter(array(
            'Finished'   => 1,
            'WorkflowID' => $this->ID
        ));

        $grid = new GridField(
            'Actions',
            _t('WorkflowInstance.ActionLogTitle', 'Log'),
            $items
        );

        $fields->addFieldsToTab('Root.Main', $grid);

        return $fields;
    }
509674
public function getCMSFields()
    {
        $fields = $this->scaffoldFormFields(
            array(
                // Don't allow has_many/many_many relationship editing before the record is first saved
                'includeRelations' => ($this->ID > 0),
                'tabbed' => true,
                'ajaxSafe' => true
            )
        );
        $fields->removeByName(
            array(
                'Title',
                'Instance',
                'Style',
                'Objects'
            )
        );
        if (!$this->IsMain) {
            $fields->addFieldsToTab(
                'Root.Main',
                array(
                    TextField::create(
                        'Title',
                        _t('PlaceableObject_Preset.TITLE', 'Title')
                    ),
                    DropdownField::create(
                        'Instance',
                        _t('PlaceableObject_Preset.INSTANCE', 'Instance'),
                        singleton('PlaceableObject_Preset')->dbObject('Instance')->enumValues()
                    )
                )
            );
        }
        if ($this->Styles) {
            $fields->addFieldToTab(
                'Root.Main',
                DropdownField::create(
                    'Style',
                    _t('PlaceableObject_Preset.STYLE', 'Style'),
                    $this->Styles
                )->setEmptyString(_t('PlaceableObject_Preset.DEFAULTSTYLE', 'Default'))
            );
        }
        $fields->addFieldsToTab(
            'Root.Objects',
            array(
                LabelField::create(
                    'ObjectsDescription',
                    _t('PlaceableObject_Preset.OBJECTSDESCRIPTION', 'List of all objects that use this use this preset.')
                ),
                GridField::create(
                    'Objects',
                    _t('PlaceableObject_Preset.OBJECTS', 'Objects'),
                    $this->Objects(),
                    GridFieldConfig_Base::create()
                )
            )
        );
        $this->extend('updateCMSFields', $fields);
        return $fields;
    }
667253
public function getCMSFields()
    {
        $this->beforeUpdateCMSFields(function ($fields) {
            /** @var FieldList $fields */
            $fields->removeByName([
                'Sort',
                'AccordionID',
            ]);

            $fields->dataFieldByName('Image')
                ->setFolderName('Uploads/Elements/Accordions');
        });

        return parent::getCMSFields();
    }
746603
public function getCMSFields()
    {
        // Create Field Tab Set:
        
        $fields = FieldList::create(TabSet::create('Root'));
        
        // Define Placeholder:
        
        $placeholder = _t(__CLASS__ . '.DROPDOWNSELECT', 'Select');
        
        // Create Main Fields:
        
        $fields->addFieldsToTab(
            'Root.Main',
            [
                DropdownField::create(
                    'ColumnID',
                    $this->fieldLabel('ColumnID')
                )->setEmptyString(' ')->setAttribute('data-placeholder', $placeholder),
                PageMultiselectField::create(
                    'Pages',
                    $this->fieldLabel('Pages')
                ),
                ViewportsField::create(
                    'Span',
                    $this->fieldLabel('Span'),
                    $this->getColumnSpanOptions()
                ),
                CheckboxField::create(
                    'DoNotInherit',
                    $this->fieldLabel('DoNotInherit')
                )
            ]
        );
        
        // Extend Field Objects:
        
        $this->extend('updateCMSFields', $fields);
        
        // Answer Field Objects:
        
        return $fields;
    }
102762
public function getCMSFields()
    {
        // Obtain Field Objects (from parent):
        
        $fields = parent::getCMSFields();
        
        // Modify Field Objects:
        
        $fields->fieldByName('Root.Main.Title')->setRightTitle(
            _t(
                __CLASS__ . '.TITLERIGHTTITLE',
                'Shown as text in the navigation bar.'
            )
        );
        
        // Answer Field Objects:
        
        return $fields;
    }
1005375
public function getFields()
	{
		$list	= array();
		foreach( $this->fields as $name => $fields )
				if( count( $fields ) )
					foreach( $fields as $field )
						$list[]	= $field;
		return $list;
	}