CMS Fields
@return FieldList
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;
    }
322285
public function getCMSFields() {

        $fields = parent::getCMSFields();

        $fields->addFieldsToTab('Root.Gallery', [

            UploadField::create(
                'GalleryImages',
                'Gallery Images'
            )
            ->setFolderName('gallery-images')
            ->setAllowedExtensions(['jpg', 'jpeg', 'png', 'gif', 'bmp'])

        ]);

        return $fields;
    }
8869
protected function getFields() {
        if (!$this->_fields) {
            $this->_fields = new FieldList(
                $this->version,
                $this->solution['assistantSid'],
                $this->solution['sid']
            );
        }

        return $this->_fields;
    }
68002
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(
                    'PageClass',
                    $this->fieldLabel('PageClass'),
                    $this->getPageClassOptions()
                )->setEmptyString(' ')->setAttribute('data-placeholder', $placeholder),
                DropdownField::create(
                    'MyTemplateID',
                    $this->fieldLabel('MyTemplateID'),
                    Template::get()->map()
                )->setEmptyString(' ')->setAttribute('data-placeholder', $placeholder),
                DropdownField::create(
                    'MyLayoutID',
                    $this->fieldLabel('MyLayoutID'),
                    Layout::get()->map()
                )->setEmptyString(' ')->setAttribute('data-placeholder', $placeholder)
            ]
        );
        
        // Create Grid Field Config:
        
        $spansConfig = GridFieldConfig_RecordEditor::create();
        
        // Obtain Edit Form Component:
        
        $editComponent = $spansConfig->getComponentByType(GridFieldDetailForm::class);
        
        // Define Edit Form Callback:
        
        $editComponent->setItemEditFormCallback(function ($form, $itemRequest) {
            
            // Define Column Options:
            
            $form->Fields()->dataFieldByName('ColumnID')->setSource($this->getColumnOptions());
            
        });
        
        // Create Column Spans Grid Field:
        
        $spans = GridField::create(
            'ColumnSpans',
            $this->fieldLabel('Spans'),
            $this->ColumnSpans(),
            $spansConfig
        );
        
        // Create Column Spans Tab:
        
        $fields->findOrMakeTab('Root.ColumnSpans', $this->owner->fieldLabel('Spans'));
        
        // Add Grid Field to Column Spans Tab:
        
        $fields->addFieldToTab('Root.ColumnSpans', $spans);
        
        // Extend Field Objects:
        
        $this->extend('updateCMSFields', $fields);
        
        // Answer Field Objects:
        
        return $fields;
    }
111417
public function getCMSFields() {
		$fields = parent::getCMSFields();

		$modes = array(
			''		=> 'No filing',
			'day'	=> '/Year/Month/Day',
			'month'	=> '/Year/Month',
			'year'	=> '/Year'
		);
		$fields->addFieldToTab('Root.Main', new DropdownField('FilingMode', _t('NewsHolder.FILING_MODE', 'File into'), $modes), 'Content');
		$fields->addFieldToTab('Root.Main', new DropdownField('FileBy', _t('NewsHolder.FILE_BY', 'File by'), array('Published' => 'Published', 'Created' => 'Created')), 'Content');
		$fields->addFieldToTab('Root.Main', new CheckboxField('PrimaryNewsSection', _t('NewsHolder.PRIMARY_SECTION', 'Is this a primary news section?'), true), 'Content');

		$fields->addFieldToTab('Root.Main', new DropdownField('OrderBy', _t('NewsHolder.ORDER_BY', 'Order by'), array('OriginalPublishedDate' => 'Published', 'Created' => 'Created')), 'Content');
		$fields->addFieldToTab('Root.Main', new DropdownField('OrderDir', _t('NewsHolder.ORDER_DIR', 'Order direction'), array('DESC' => 'Descending date', 'ASC' => 'Ascending date')), 'Content');
		
		$this->extend('updateNewsHolderCMSFields', $fields);

		return $fields;
	}
1289530
public function getCMSFields() {
        $fields=new FieldList(
                            new TabSet('Root',
                                    new Tab('Main', _t('KapostObject.MAIN', '_Main'),
                                        new ReadonlyField('Created', $this->fieldLabel('Created')),
                                        new ReadonlyField('KapostChangeTypeNice', $this->fieldLabel('KapostChangeType')),
                                        new ReadonlyField('KapostAuthor', $this->fieldLabel('KapostAuthor')),
                                        new ReadonlyField('ToPublishNice', $this->fieldLabel('ToPublish')),
                                        new ReadonlyField('ClassNameNice', _t('KapostObject.CONTENT_TYPE', '_Content Type')),
                                        new ReadonlyField('Title', $this->fieldLabel('Title')),
                                        HtmlEditorField_Readonly::create('ContentNice', $this->fieldLabel('Content'), $this->sanitizeHTML($this->Content))
                                    )
                                )
                        );
        
        
        //Allow extensions to adjust the fields
        $this->extend('updateCMSFields', $fields);
        
        return $fields;
    }
241162
public function getFieldLIst()
    {
        if (!isset($this->model->field_list)) {

            return $this->model->getFieldList();
        }

        return $this->model->field_list;
    }
75089
public function getCMSFields()
    {
        // Obtain Field Objects (from parent):
        
        $fields = parent::getCMSFields();
        
        // Create Style Fields:
        
        $style = [];
        
        // Create Column Span Field:
        
        if (self::framework()->useColumnSpan()) {
            
            $style[] = ViewportsField::create(
                'Span',
                $this->fieldLabel('Span'),
                $this->getColumnSpanOptions()
            );
            
        }
        
        // Create Column Offset Field:
        
        if (self::framework()->useColumnOffset()) {
            
            $style[] = ViewportsField::create(
                'Offset',
                $this->fieldLabel('Offset'),
                $this->getColumnOffsetOptions()
            );
            
        }
        
        // Add Style Fields to Tab:
        
        if (!empty($style)) {
            
            $fields->addFieldToTab(
                'Root.Style',
                FieldSection::create(
                    'ColumnStyle',
                    $this->fieldLabel('ColumnStyle'),
                    $style
                )
            );
            
        }
        
        // Create Options Fields:
        
        $fields->addFieldToTab(
            'Root.Options',
            FieldSection::create(
                'ColumnOptions',
                $this->fieldLabel('ColumnOptions'),
                [
                    CheckboxField::create(
                        'Sidebar',
                        $this->fieldLabel('Sidebar')
                    ),
                    CheckboxField::create(
                        'HideEmpty',
                        $this->fieldLabel('HideEmpty')
                    ),
                    CheckboxField::create(
                        'EdgeToEdge',
                        $this->fieldLabel('EdgeToEdge')
                    )
                ]
            )
        );
        
        // Answer Field Objects:
        
        return $fields;
    }
44307
public function getCMSFields()
    {
        // Obtain Field Objects (from parent):
        
        $fields = parent::getCMSFields();
        
        // Define Placeholders:
        
        $placeholderDefault = _t(__CLASS__ . '.DROPDOWNDEFAULT', '(default)');
        
        // Create Style Fields:
        
        $fields->addFieldsToTab(
            'Root.Style',
            [
                FieldSection::create(
                    'ListStyle',
                    $this->fieldLabel('ListStyle'),
                    [
                        DropdownField::create(
                            'HeadingLevel',
                            $this->fieldLabel('HeadingLevel'),
                            $this->getTitleLevelOptions()
                        )->setEmptyString(' ')->setAttribute('data-placeholder', $placeholderDefault),
                        DropdownField::create(
                            'ImageAlign',
                            $this->fieldLabel('ImageAlign'),
                            $this->getImageAlignOptions()
                        )->setEmptyString(' ')->setAttribute('data-placeholder', $placeholderDefault),
                        ColorField::create(
                            'OverlayBackground',
                            $this->fieldLabel('OverlayBackground')
                        ),
                        ColorField::create(
                            'OverlayForeground',
                            $this->fieldLabel('OverlayForeground')
                        ),
                        FontIconField::create(
                            'OverlayIcon',
                            $this->fieldLabel('OverlayIcon')
                        ),
                        ColorField::create(
                            'OverlayIconColor',
                            $this->fieldLabel('OverlayIconColor')
                        ),
                        FontIconField::create(
                            'ButtonIcon',
                            $this->fieldLabel('ButtonIcon')
                        )
                    ]
                )
            ]
        );
        
        // Add List Style Fields:
        
        $fields->addFieldsToTab('Root.Style', $this->getListStyleFields());
        
        // Create Options Fields:
        
        $fields->addFieldsToTab(
            'Root.Options',
            [
                FieldSection::create(
                    'ListOptions',
                    $this->fieldLabel('ListOptions'),
                    [
                        DropdownField::create(
                            'ShowImage',
                            $this->fieldLabel('ShowImage'),
                            $this->getShowOptions()
                        ),
                        DropdownField::create(
                            'ShowHeader',
                            $this->fieldLabel('ShowHeader'),
                            $this->getShowOptions()
                        ),
                        DropdownField::create(
                            'ShowDetails',
                            $this->fieldLabel('ShowDetails'),
                            $this->getShowOptions()
                        ),
                        DropdownField::create(
                            'ShowSummary',
                            $this->fieldLabel('ShowSummary'),
                            $this->getShowOptions()
                        ),
                        DropdownField::create(
                            'ShowContent',
                            $this->fieldLabel('ShowContent'),
                            $this->getShowOptions()
                        ),
                        DropdownField::create(
                            'ShowFooter',
                            $this->fieldLabel('ShowFooter'),
                            $this->getShowOptions()
                        ),
                        TextField::create(
                            'ButtonLabel',
                            $this->fieldLabel('ButtonLabel')
                        ),
                        CheckboxField::create(
                            'ButtonLink',
                            $this->fieldLabel('ButtonLink')
                        ),
                        CheckboxField::create(
                            'LinkTitles',
                            $this->fieldLabel('LinkTitles')
                        ),
                        CheckboxField::create(
                            'HideNoDataMessage',
                            $this->fieldLabel('HideNoDataMessage')
                        )
                    ]
                ),
                FieldSection::create(
                    'ListImageOptions',
                    $this->fieldLabel('ListImageOptions'),
                    [
                        DropdownField::create(
                            'ImageLinksTo',
                            $this->fieldLabel('ImageLinksTo'),
                            $this->getImageLinksToOptions()
                        ),
                        CheckboxField::create(
                            'OverlayImages',
                            $this->fieldLabel('OverlayImages')
                        ),
                        CheckboxField::create(
                            'OverlayTitle',
                            $this->fieldLabel('OverlayTitle')
                        ),
                        CheckboxField::create(
                            'LinkImages',
                            $this->fieldLabel('LinkImages')
                        )
                    ]
                )
            ]
        );
        
        // Add List Option Fields:
        
        $fields->addFieldsToTab('Root.Options', $this->getListOptionFields());
        
        // Answer Field Objects:
        
        return $fields;
    }
630314
public function getCMSFields()
    {
        // Obtain Field Objects (from parent):
        
        $fields = parent::getCMSFields();
        
        // Create Style Fields:
        
        $fields->addFieldToTab(
            'Root.Style',
            FieldSection::create(
                'ColumnStyle',
                $this->fieldLabel('Column'),
                [
                    ViewportsField::create(
                        'ColumnSpan',
                        $this->fieldLabel('Span'),
                        $this->getColumnSpanOptions()
                    )
                ]
            )
        );
        
        // 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;
    }
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;
    }
918312
public function getCMSFields()
    {
        // Obtain Field Objects (from parent):
        
        $fields = parent::getCMSFields();
        
        // Add Class Ancestry:
        
        foreach ($this->getAncestorClassNames(false) as $class) {
            $fields->fieldByName('Root')->addExtraClass($class);
        }
        
        // Remove Field Objects:
        
        $fields->removeFieldsFromTab('Root.Main', ['Content', 'Metadata']);
        
        // Modify Field Objects:
        
        $fields->fieldByName('Root.Main')->setTitle(_t(__CLASS__ . '.TABMAIN', 'Main'));
        $fields->dataFieldByName('MenuTitle')->addExtraClass('hidden');
        
        // Answer Field Objects:
        
        return $fields;
    }
753459
public function getCMSPageFields()
    {
        $fields = parent::getCMSPageFields();
        $fields->removeByName('Title');
        $fields->addFields(
            array(
                HtmlEditorField::create(
                    'Content',
                    _t('MainBlock.CONTENT', 'Content')
                )
            )
        );
        $this->extend('updateCMSPageFields', $fields);
        return $fields;
    }
965369
public function getCMSFields()
    {
        // Obtain Field Objects (from parent):
        
        $fields = parent::getCMSFields();
        
        // Create Style Fields:
        
        $fields->addFieldToTab(
            'Root.Style',
            FieldSection::create(
                'ButtonStyle',
                $this->fieldLabel('ButtonStyle'),
                [
                    DropdownField::create(
                        'ButtonSize',
                        $this->fieldLabel('ButtonSize'),
                        $this->getButtonSizeOptions()
                    ),
                    DropdownField::create(
                        'ButtonAnnotation',
                        $this->fieldLabel('ButtonAnnotation'),
                        $this->getButtonAnnotationOptions()
                    )
                ]
            )
        );
        
        // Answer Field Objects:
        
        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;
    }
154510
public function getCMSFields()
    {
        // Obtain Field Objects (from parent):
        
        $fields = parent::getCMSFields();
        
        // Create Main Fields:
        
        $fields->addFieldsToTab(
            'Root.Main',
            [
                HTMLEditorField::create(
                    'HeaderContent',
                    $this->fieldLabel('HeaderContent')
                )->setRows(10),
                HTMLEditorField::create(
                    'FooterContent',
                    $this->fieldLabel('FooterContent')
                )->setRows(10)
            ]
        );
        
        // Insert Links Tab:
        
        $fields->insertAfter(
            Tab::create(
                'Links',
                $this->fieldLabel('Links')
            ),
            'Main'
        );
        
        // Add Links Fields:
        
        $fields->addFieldsToTab(
            'Root.Links',
            [
                DropdownField::create(
                    'LinkMode',
                    $this->fieldLabel('LinkMode'),
                    $this->getLinkModeOptions()
                ),
                PageMultiselectField::create(
                    'LinkedPages',
                    $this->fieldLabel('LinkedPages')
                )
            ]
        );
        
        // Create Options Fields:
        
        $fields->addFieldToTab(
            'Root.Options',
            FieldSection::create(
                'NavigationOptions',
                $this->fieldLabel('NavigationOptions'),
                [
                    DropdownField::create(
                        'SortBy',
                        $this->fieldLabel('SortBy'),
                        $this->getSortByOptions()
                    ),
                    CheckboxField::create(
                        'ShowIcons',
                        $this->fieldLabel('ShowIcons')
                    )
                ]
            )
        );
        
        // Answer Field Objects:
        
        return $fields;
    }