Answers a list of field objects for the CMS interface.

@return FieldList
324409
public function getCMSFields()
    {
        // Obtain Field Objects (from parent):
        
        $fields = parent::getCMSFields();
        
        // Create Field Objects:
        
        $fields->fieldByName('Root.Options.TitleOptions')->push(
            CheckboxField::create(
                'UseLevelTitle',
                $this->fieldLabel('UseLevelTitle')
            )
        );
        
        // Answer Field Objects:
        
        return $fields;
    }
687741
public function getCMSFields()
    {
        $fields = parent::getCMSFields();

        $field = SortableUploadField::create('Images', _t('CarouselPage.db_Images'));
        $field->setFolderName($this->getClassFolder());
        $field->setFileEditFields('getCarouselEditFields');

        $root = $fields->fieldByName('Root');
        $tab = $root->fieldByName('Images');
        if (! $tab) {
            $tab = Tab::create('Images');
            $tab->setTitle(_t('CarouselPage.db_Images'));
            $root->insertAfter($tab, 'Main');
        }
        $tab->push($field);

        return $fields;
    }
121918
public function getCMSFields()
    {
        /** @var FieldList $fields */
        $fields = parent::getCMSFields();

        // Get protector
        $protector = FormSpamProtectionExtension::get_protector();
        if (!$protector) {
            return $fields;
        }

        if ($this->Parent()->Fields() instanceof UnsavedRelationList) {
            return $fields;
        }

        // Each other text field in this group can be assigned a field mapping
        $mapGroup = FieldGroup::create()
            ->setTitle(_t(__CLASS__.'.SPAMFIELDMAPPING', 'Spam Field Mapping'))
            ->setName('SpamFieldMapping')
            ->setDescription(_t(
                __CLASS__.'.SPAMFIELDMAPPINGDESCRIPTION',
                'Select the form fields that correspond to any relevant spam protection identifiers'
            ));

        // Generate field specific settings
        $mappableFields = FormSpamProtectionExtension::config()->get('mappable_fields');
        $mappableFieldsMerged = array_combine($mappableFields, $mappableFields);
        foreach ($this->getCandidateFields() as $otherField) {
            $mapSetting = "Map-{$otherField->Name}";
            $fieldOption = DropdownField::create(
                'spammap-' . $mapSetting,
                $otherField->Title,
                $mappableFieldsMerged,
                $this->spamMapValue($mapSetting)
            )->setEmptyString('');
            $mapGroup->push($fieldOption);
        }
        $fields->addFieldToTab('Root.Main', $mapGroup);

        return $fields;
    }
1085613
public function getFields()
    {
        $fields = FieldList::create();

        foreach ($this->fieldgroups as $group) {
            if (method_exists($this, 'get'.$group.'Fields')) {
                $fields->merge($this->{'get'.$group.'Fields'}());
            }
        }

        return $fields;
    }
11721
public function getFields()
    {
        $fields = [];
        foreach ($this->fieldsets as $fieldset) {
            $fields = array_merge($fields, $fieldset->getAllFields());
        }
        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;
    }
431138
public function getCMSFields()
    {
        // Obtain Field Objects (from parent):
        
        $fields = parent::getCMSFields();
        
        // Define Placeholder:
        
        $placeholder = _t(__CLASS__ . '.DROPDOWNSELECT', 'Select');
        
        // Create Main Fields:
        
        $fields->addFieldsToTab(
            'Root.Main',
            [
                DropdownField::create(
                    'TagSourceID',
                    $this->fieldLabel('TagSourceID'),
                    $this->getTagSourceOptions()
                )->setEmptyString(' ')->setAttribute('data-placeholder', $placeholder)
            ]
        );
        
        // Create Style Fields:
        
        $fields->addFieldToTab(
            'Root.Style',
            FieldSection::create(
                'TagCloudStyle',
                $this->fieldLabel('TagCloudStyle'),
                [
                    ColorField::create(
                        'ColorText',
                        $this->fieldLabel('ColorText')
                    ),
                    ColorField::create(
                        'ColorOutline',
                        $this->fieldLabel('ColorOutline')
                    )
                ]
            )
        );
        
        // Create Options Fields:
        
        $fields->addFieldToTab(
            'Root.Options',
            FieldSection::create(
                'TagCloudOptions',
                $this->fieldLabel('TagCloudOptions'),
                [
                    FieldGroup::create(
                        $this->fieldLabel('Zoom'),
                        [
                            DropdownField::create(
                                'Zoom',
                                $this->fieldLabel('ZoomInitial'),
                                $this->getRangeOptions(0.5, 3, 0.1)
                            ),
                            DropdownField::create(
                                'ZoomMin',
                                $this->fieldLabel('ZoomMin'),
                                $this->getRangeOptions(0.5, 3, 0.1)
                            ),
                            DropdownField::create(
                                'ZoomMax',
                                $this->fieldLabel('ZoomMax'),
                                $this->getRangeOptions(0.5, 3, 0.1)
                            ),
                            DropdownField::create(
                                'Depth',
                                $this->fieldLabel('Depth'),
                                $this->getRangeOptions(0.1, 1, 0.1)
                            )
                        ]
                    ),
                    FieldGroup::create(
                        $this->fieldLabel('InitialRotation'),
                        [
                            DropdownField::create(
                                'InitialRotationH',
                                $this->fieldLabel('InitialRotationH'),
                                $this->getRangeOptions(-1, 1, 0.1)
                            ),
                            DropdownField::create(
                                'InitialRotationV',
                                $this->fieldLabel('InitialRotationV'),
                                $this->getRangeOptions(-1, 1, 0.1)
                            )
                        ]
                    ),
                    FieldGroup::create(
                        $this->fieldLabel('WeightSize'),
                        [
                            TextField::create(
                                'WeightSizeMin',
                                $this->fieldLabel('WeightSizeMin')
                            ),
                            TextField::create(
                                'WeightSizeMax',
                                $this->fieldLabel('WeightSizeMax')
                            )
                        ]
                    ),
                    CheckboxField::create(
                        'Weight',
                        $this->fieldLabel('Weight')
                    )
                ]
            )
        );
        
        // Answer Field Objects:
        
        return $fields;
    }
1018943
public function getCMSFields()
    {
        $fields = parent::getCMSFields();

        $bannerGridConfig = GridFieldConfig_RelationEditor::create();
        if ($this->Banners()->Count() > 0) {
            $bannerGridConfig->addComponent(new GridFieldOrderableRows());
        }

        $fields->addFieldToTab(
            'Root.Main',
            GridField::create(
                'Banners',
                'Banner',
                $this->Banners(),
                $bannerGridConfig
            )
        );

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

        return $fields;
    }
884890
public function getCMSFields()
    {
        // Create Field Tab Set:
        
        $fields = FieldList::create(TabSet::create('Root'));
        
        // Create Main Fields:
        
        $fields->addFieldsToTab(
            'Root.Main',
            [
                TextField::create(
                    'Title',
                    $this->fieldLabel('Title')
                )
            ]
        );
        
        // Extend Field Objects:
        
        $this->extend('updateCMSFields', $fields);
        
        // Answer Field Objects:
        
        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;
    }
110449
public function getCMSFields()
    {
        // Obtain Field Objects (from parent):
        
        $fields = parent::getCMSFields();
        
        // Create Main Fields:
        
        $fields->addFieldsToTab(
            'Root.Main',
            [
                TextField::create(
                    'Label',
                    $this->fieldLabel('Label')
                ),
                FontIconField::create(
                    'ButtonIcon',
                    $this->fieldLabel('ButtonIcon')
                )
            ]
        );
        
        // Create Style Fields:
        
        $fields->addFieldToTab(
            'Root.Style',
            FieldSection::create(
                'ScrollToTopStyle',
                $this->fieldLabel('ScrollToTopStyle'),
                [
                    ViewportsField::create(
                        'ButtonSize',
                        $this->fieldLabel('ButtonSize')
                    )->setUseTextInput(true),
                    ViewportsField::create(
                        'IconSize',
                        $this->fieldLabel('IconSize')
                    )->setUseTextInput(true)
                ]
            )
        );
        
        // Create Options Fields:
        
        $fields->addFieldToTab(
            'Root.Options',
            FieldSection::create(
                'ScrollToTopOptions',
                $this->fieldLabel('ScrollToTopOptions'),
                [
                    NumericField::create(
                        'OffsetShow',
                        $this->fieldLabel('OffsetShow')
                    ),
                    NumericField::create(
                        'OffsetOpacity',
                        $this->fieldLabel('OffsetOpacity')
                    ),
                    NumericField::create(
                        'ScrollDuration',
                        $this->fieldLabel('ScrollDuration')
                    )
                ]
            )
        );
        
        // Answer Field Objects:
        
        return $fields;
    }
860818
public function getCMSFields()
    {
        $commentField = $this->AllowHtml ? HTMLEditorField::class : TextareaField::class;
        $fields = new FieldList(
            $this
                ->obj('Created')
                ->scaffoldFormField($this->fieldLabel('Created'))
                ->performReadonlyTransformation(),
            TextField::create('Name', $this->fieldLabel('Name')),
            $commentField::create('Comment', $this->fieldLabel('Comment')),
            EmailField::create('Email', $this->fieldLabel('Email')),
            TextField::create('URL', $this->fieldLabel('URL')),
            FieldGroup::create(array(
                CheckboxField::create('Moderated', $this->fieldLabel('Moderated')),
                CheckboxField::create('IsSpam', $this->fieldLabel('IsSpam')),
            ))
                ->setTitle(_t(__CLASS__ . '.OPTIONS', 'Options'))
                ->setDescription(_t(
                    __CLASS__ . '.OPTION_DESCRIPTION',
                    'Unmoderated and spam comments will not be displayed until approved'
                ))
        );

        // Show member name if given
        if (($author = $this->Author()) && $author->exists()) {
            $fields->insertAfter(
                TextField::create('AuthorMember', $this->fieldLabel('Author'), $author->Title)
                    ->performReadonlyTransformation(),
                'Name'
            );
        }

        // Show parent comment if given
        if (($parent = $this->ParentComment()) && $parent->exists()) {
            $fields->push(new HeaderField(
                'ParentComment_Title',
                _t(__CLASS__ . '.ParentComment_Title', 'This comment is a reply to the below')
            ));
            // Created date
            // FIXME - the method setName in DatetimeField is not chainable, hence
            // the lack of chaining here
            $createdField = $parent
                ->obj('Created')
                ->scaffoldFormField($parent->fieldLabel('Created'));
            $createdField->setName('ParentComment_Created');
            $createdField->setValue($parent->Created);
            $createdField->performReadonlyTransformation();
            $fields->push($createdField);

            // Name (could be member or string value)
            $fields->push(
                $parent
                    ->obj('AuthorName')
                    ->scaffoldFormField($parent->fieldLabel('AuthorName'))
                    ->setName('ParentComment_AuthorName')
                    ->setValue($parent->getAuthorName())
                    ->performReadonlyTransformation()
            );

            // Comment body
            $fields->push(
                $parent
                    ->obj('EscapedComment')
                    ->scaffoldFormField($parent->fieldLabel(self::class))
                    ->setName('ParentComment_EscapedComment')
                    ->setValue($parent->Comment)
                    ->performReadonlyTransformation()
            );
        }

        $this->extend('updateCMSFields', $fields);
        return $fields;
    }
708796
public function getCMSFields()
    {
        $fields = new FieldList(
            new TabSet(
                "Root",
                new Tab(
                    'Members',
                    _t(__CLASS__ . '.MEMBERS', 'Members'),
                    new TextField("Title", $this->fieldLabel('Title')),
                    $parentidfield = DropdownField::create(
                        'ParentID',
                        $this->fieldLabel('Parent'),
                        Group::get()->exclude('ID', $this->ID)->map('ID', 'Breadcrumbs')
                    )->setEmptyString(' '),
                    new TextareaField('Description', $this->fieldLabel('Description'))
                ),
                $permissionsTab = new Tab(
                    'Permissions',
                    _t(__CLASS__ . '.PERMISSIONS', 'Permissions'),
                    $permissionsField = new PermissionCheckboxSetField(
                        'Permissions',
                        false,
                        Permission::class,
                        'GroupID',
                        $this
                    )
                )
            )
        );

        $parentidfield->setDescription(
            _t('SilverStripe\\Security\\Group.GroupReminder', 'If you choose a parent group, this group will take all it\'s roles')
        );

        if ($this->ID) {
            $group = $this;
            $config = GridFieldConfig_RelationEditor::create();
            $config->addComponent(new GridFieldButtonRow('after'));
            $config->addComponents(new GridFieldExportButton('buttons-after-left'));
            $config->addComponents(new GridFieldPrintButton('buttons-after-left'));
            $config->removeComponentsByType(GridFieldDeleteAction::class);
            $config->addComponent(new GridFieldGroupDeleteAction($this->ID), GridFieldPageCount::class);

            /** @var GridFieldAddExistingAutocompleter $autocompleter */
            $autocompleter = $config->getComponentByType(GridFieldAddExistingAutocompleter::class);
            /** @skipUpgrade */
            $autocompleter
                ->setResultsFormat('$Title ($Email)')
                ->setSearchFields(array('FirstName', 'Surname', 'Email'));
            /** @var GridFieldDetailForm $detailForm */
            $detailForm = $config->getComponentByType(GridFieldDetailForm::class);
            $detailForm
                ->setValidator(Member_Validator::create())
                ->setItemEditFormCallback(function ($form) use ($group) {
                    /** @var Form $form */
                    $record = $form->getRecord();
                    $groupsField = $form->Fields()->dataFieldByName('DirectGroups');
                    if ($groupsField) {
                        // If new records are created in a group context,
                        // set this group by default.
                        if ($record && !$record->ID) {
                            $groupsField->setValue($group->ID);
                        } elseif ($record && $record->ID) {
                            // TODO Mark disabled once chosen.js supports it
                            // $groupsField->setDisabledItems(array($group->ID));
                            $form->Fields()->replaceField(
                                'DirectGroups',
                                $groupsField->performReadonlyTransformation()
                            );
                        }
                    }
                });
            $memberList = GridField::create('Members', false, $this->DirectMembers(), $config)
                ->addExtraClass('members_grid');
            // @todo Implement permission checking on GridField
            //$memberList->setPermissions(array('edit', 'delete', 'export', 'add', 'inlineadd'));
            $fields->addFieldToTab('Root.Members', $memberList);
        }

        // Only add a dropdown for HTML editor configurations if more than one is available.
        // Otherwise Member->getHtmlEditorConfigForCMS() will default to the 'cms' configuration.
        $editorConfigMap = HTMLEditorConfig::get_available_configs_map();
        if (count($editorConfigMap) > 1) {
            $fields->addFieldToTab(
                'Root.Permissions',
                new DropdownField(
                    'HtmlEditorConfig',
                    'HTML Editor Configuration',
                    $editorConfigMap
                ),
                'Permissions'
            );
        }

        if (!Permission::check('EDIT_PERMISSIONS')) {
            $fields->removeFieldFromTab('Root', 'Permissions');
        }

        // Only show the "Roles" tab if permissions are granted to edit them,
        // and at least one role exists
        if (Permission::check('APPLY_ROLES') &&
            PermissionRole::get()->count() &&
            class_exists(SecurityAdmin::class)
        ) {
            $fields->findOrMakeTab('Root.Roles', _t(__CLASS__ . '.ROLES', 'Roles'));
            $fields->addFieldToTab(
                'Root.Roles',
                new LiteralField(
                    "",
                    "<p>" .
                    _t(
                        __CLASS__ . '.ROLESDESCRIPTION',
                        "Roles are predefined sets of permissions, and can be assigned to groups.<br />"
                        . "They are inherited from parent groups if required."
                    ) . '<br />' .
                    sprintf(
                        '<a href="%s" class="add-role">%s</a>',
                        SecurityAdmin::singleton()->Link('show/root#Root_Roles'),
                        // TODO This should include #Root_Roles to switch directly to the tab,
                        // but tabstrip.js doesn't display tabs when directly adressed through a URL pragma
                        _t('SilverStripe\\Security\\Group.RolesAddEditLink', 'Manage roles')
                    ) .
                    "</p>"
                )
            );

            // Add roles (and disable all checkboxes for inherited roles)
            $allRoles = PermissionRole::get();
            if (!Permission::check('ADMIN')) {
                $allRoles = $allRoles->filter("OnlyAdminCanApply", 0);
            }
            if ($this->ID) {
                $groupRoles = $this->Roles();
                $inheritedRoles = new ArrayList();
                $ancestors = $this->getAncestors();
                foreach ($ancestors as $ancestor) {
                    $ancestorRoles = $ancestor->Roles();
                    if ($ancestorRoles) {
                        $inheritedRoles->merge($ancestorRoles);
                    }
                }
                $groupRoleIDs = $groupRoles->column('ID') + $inheritedRoles->column('ID');
                $inheritedRoleIDs = $inheritedRoles->column('ID');
            } else {
                $groupRoleIDs = array();
                $inheritedRoleIDs = array();
            }

            $rolesField = ListboxField::create('Roles', false, $allRoles->map()->toArray())
                    ->setDefaultItems($groupRoleIDs)
                    ->setAttribute('data-placeholder', _t('SilverStripe\\Security\\Group.AddRole', 'Add a role for this group'))
                    ->setDisabledItems($inheritedRoleIDs);
            if (!$allRoles->count()) {
                $rolesField->setAttribute('data-placeholder', _t('SilverStripe\\Security\\Group.NoRoles', 'No roles found'));
            }
            $fields->addFieldToTab('Root.Roles', $rolesField);
        }

        $fields->push($idField = new HiddenField("ID"));

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

        return $fields;
    }
1189394
public function getCMSFields()
    {
        // Obtain Field Objects (from parent):
        
        $fields = parent::getCMSFields();
        
        // Create Style Fields:
        
        $fields->addFieldsToTab(
            'Root.Style',
            [
                FieldSection::create(
                    'NavigationStyle',
                    $this->fieldLabel('NavigationStyle'),
                    [
                        TextField::create(
                            'ButtonMargin',
                            $this->fieldLabel('ButtonMargin')
                        ),
                        TextField::create(
                            'ButtonPaddingX',
                            $this->fieldLabel('ButtonPaddingX')
                        ),
                        TextField::create(
                            'ButtonPaddingY',
                            $this->fieldLabel('ButtonPaddingY')
                        )
                    ]
                )
            ]
        );
        
        // Answer Field Objects:
        
        return $fields;
    }
650166
public function getCMSFields()
    {
        // Obtain Field Objects (from parent):
        
        $fields = parent::getCMSFields();
        
        // Define Placeholder:
        
        $placeholder = _t(__CLASS__ . '.DROPDOWNDEFAULT', '(default)');
        
        // Create Style Fields:
        
        $fields->addFieldsToTab(
            'Root.Style',
            [
                FieldSection::create(
                    'IconStyle',
                    $this->fieldLabel('IconStyle'),
                    [
                        DropdownField::create(
                            'IconSize',
                            $this->fieldLabel('IconSize'),
                            SharingIcon::singleton()->getIconSizeOptions()
                        ),
                        DropdownField::create(
                            'Placement',
                            $this->fieldLabel('Placement'),
                            SharingIcon::singleton()->getPlacementOptions()
                        )->setEmptyString(' ')->setAttribute('data-placeholder', $placeholder)
                    ]
                )
            ]
        );
        
        // Create Options Fields:
        
        $fields->addFieldsToTab(
            'Root.Options',
            [
                FieldSection::create(
                    'IconOptions',
                    $this->fieldLabel('IconOptions'),
                    [
                        CheckboxField::create(
                            'ShowTitles',
                            $this->fieldLabel('ShowTitles')
                        )
                    ]
                )
            ]
        );
        
        // Answer Field Objects:
        
        return $fields;
    }
1077231
public function getCMSFields()
    {
        // Obtain Field Objects (from parent):
        
        $fields = parent::getCMSFields();
        
        // Create Options Fields:
        
        $fields->addFieldsToTab(
            'Root.Options',
            [
                FieldSection::create(
                    'NavigationOptions',
                    $this->fieldLabel('NavigationOptions'),
                    [
                        ToggleGroup::create(
                            'ShowSubMenus',
                            $this->fieldLabel('ShowSubMenus'),
                            [
                                CheckboxField::create(
                                    'MultiLevelSubMenus',
                                    $this->fieldLabel('MultiLevelSubMenus')
                                ),
                                CheckboxField::create(
                                    'AddTopLinkToSub',
                                    $this->fieldLabel('AddTopLinkToSub')
                                ),
                                CheckboxField::create(
                                    'ShowDivider',
                                    $this->fieldLabel('ShowDivider')
                                ),
                                TextField::create(
                                    'MaximumSubMenuLevel',
                                    $this->fieldLabel('MaximumSubMenuLevel')
                                )
                            ]
                        )->addExtraClass('sub-menu-options')
                    ]
                )->addExtraClass('navigation-item-options')
            ]
        );
        
        // Answer Field Objects:
        
        return $fields;
    }
450770
public function getCMSFields()
    {
        // Obtain Field Objects (from parent):
        
        $fields = parent::getCMSFields();
        
        // Create Main Fields:
        
        $fields->addFieldToTab(
            'Root.Main',
            HTMLEditorField::create(
                'Content',
                $this->fieldLabel('Content')
            ),
            'LinkTo'
        );
        
        // Create Options Fields:
        
        $fields->addFieldToTab(
            'Root.Options',
            FieldSection::create(
                'ContentOptions',
                $this->fieldLabel('ContentOptions'),
                [
                    DropdownField::create(
                        'LinkMode',
                        $this->fieldLabel('LinkMode'),
                        $this->getLinkModeOptions()
                    ),
                    TextField::create(
                        'ButtonLabel',
                        $this->fieldLabel('ButtonLabel')
                    )
                ]
            )
        );
        
        // Answer Field Objects:
        
        return $fields;
    }