CMS Fields
@return FieldList
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;
    }
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;
    }
515765
public function getCMSFields()
    {
        $self = $this;
   
        $this->beforeUpdateCMSFields(function ($fields) use ($self) {
            $siteconfig = SiteConfig::current_site_config();

            $fields->removeByName("StartDate");
            $fields->removeByName("CustomerID");
            $fields->removeByName("EndDate");
            $fields->removeByName("Number");
            $fields->removeByName("Ref");
            $fields->removeByName("AccessKey");
            $fields->removeByName("Items");
            $fields->removeByName("Prefix");
            
            $fields->addFieldsToTab(
                "Root.Main",
                [
                    // Items field
                    ReadOnlyGridField::create(
                        "Items",
                        "",
                        $this->Items(),
                        $config = GridFieldConfig::create()
                            ->addComponents(
                                new GridFieldButtonRow('before'),
                                new GridFieldTitleHeader(),
                                new GridFieldEditableColumns(),
                                new GridFieldEditButton(),
                                new GridFieldDetailForm(),
                                new GridFieldDeleteAction(),
                                new AddLineItem()
                            )
                    ),

                    LiteralField::create(
                        "ItemsDivider",
                        '<div class="field form-group"></div>'
                    ),
                    
                    // Totals and settings
                    CompositeField::create(
                        CompositeField::create(
                            DateField::create("StartDate", _t("OrdersAdmin.Date", "Date")),
                            DateField::create("EndDate", _t("OrdersAdmin.Expires", "Expires")),
                            ReadonlyField::create("FullRef", "#"),
                            TextField::create("Ref", $this->fieldLabel("Ref"))
                        )->setName("OrdersDetailsInfo")
                        ->addExtraClass("col"),
                        CompositeField::create([])
                            ->setName("OrdersDetailsMisc")
                        ->addExtraClass("col"),
                        CompositeField::create(
                            ReadonlyField::create("SubTotalValue", _t("OrdersAdmin.SubTotal", "Sub Total"))
                                ->setValue($this->obj("SubTotal")->Nice()),
                            ReadonlyField::create("TaxValue", _t("OrdersAdmin.Tax", "Tax"))
                                ->setValue($this->obj("TaxTotal")->Nice()),
                            ReadonlyField::create("TotalValue", _t("OrdersAdmin.Total", "Total"))
                                ->setValue($this->obj("Total")->Nice())
                        )->setName("OrdersDetailsTotals")
                        ->addExtraClass("col")
                    )->setName("OrdersDetails")
                    ->addExtraClass("orders-details-field")
                    ->setColumnCount(2)
                    ->setFieldHolderTemplate("SilverCommerce\\OrdersAdmin\\Forms\\OrderDetailsField_holder")
                ]
            );

            $fields->addFieldsToTab(
                "Root.Customer",
                [
                    HasOneButtonField::create(
                        $this,
                        'Customer'
                    ),
                    TextField::create("Company"),
                    TextField::create("FirstName"),
                    TextField::create("Surname"),
                    TextField::create("Address1"),
                    TextField::create("Address2"),
                    TextField::create("City"),
                    TextField::create("County"),
                    TextField::create("PostCode"),
                    DropdownField::create(
                        'Country',
                        _t('OrdersAdmin.Country', 'Country'),
                        i18n::getData()->getCountries()
                    )->setEmptyString(""),
                    TextField::create("Email"),
                    TextField::create("PhoneNumber")
                ]
            );

            $fields->addFieldsToTab(
                "Root.Delivery",
                [
                    HeaderField::create(
                        "DeliveryDetailsHeader",
                        _t("Orders.DeliveryDetails", "Delivery Details")
                    ),
                    TextField::create("DeliveryCompany"),
                    TextField::create("DeliveryFirstName"),
                    TextField::create("DeliverySurname"),
                    TextField::create("DeliveryAddress1"),
                    TextField::create("DeliveryAddress2"),
                    TextField::create("DeliveryCity"),
                    TextField::create("DeliveryCounty"),
                    TextField::create("DeliveryPostCode"),
                    DropdownField::create(
                        'DeliveryCountry',
                        _t('OrdersAdmin.Country', 'Country'),
                        i18n::getData()->getCountries()
                    )->setEmptyString("")
                ]
            );

            $fields->addFieldToTab(
                "Root.History",
                VersionHistoryField::create(
                    "History",
                    _t("SilverCommerce\VersionHistoryField.History", "History"),
                    $self
                )->addExtraClass("stacked")
            );
            
            $root = $fields->findOrMakeTab("Root");

            if ($root) {
                $root->addextraClass('orders-root');
            }
        });
        
        return parent::getCMSFields();
    }
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;
    }
542842
public List<CmsLuceneField> getLuceneFields() {

        List<CmsLuceneField> result = new ArrayList<CmsLuceneField>();
        for (CmsSearchField field : getFields()) {
            if (field instanceof CmsLuceneField) {
                result.add((CmsLuceneField)field);
            }
        }
        return result;
    }
484825
public function getCMSFields()
    {
        $fields = parent::getCMSFields();
        $fields->removeByName(array(
            'SortOrder',
            'PhotoGalleryID',
            'ElementLinkID',
        ));
        $image = $fields->dataFieldByName('Image')->setFolderName('Uploads/Elements/PhotoGallery/');
        $fields->insertBefore($image, 'Content');

        // so if anything depends on PageLink it doesn't flake out
        $fields->replaceField('PageLink', new LiteralField('PageLink', ''));

        return $fields;
    }
224237
public function getCMSFields()
    {
        // Obtain Field Objects (from parent):
        
        $fields = parent::getCMSFields();
        
        // Define Placeholder:
        
        $placeholder = _t(__CLASS__ . '.DROPDOWNDEFAULT', '(default)');
        
        // Create Style Fields:
        
        $fields->addFieldToTab(
            'Root.Style',
            FieldSection::create(
                'CarouselStyle',
                $this->fieldLabel('CarouselStyle'),
                [
                    DropdownField::create(
                        'HeadingLevel',
                        $this->fieldLabel('HeadingLevel'),
                        $this->getTitleLevelOptions()
                    )->setEmptyString(' ')->setAttribute('data-placeholder', $placeholder)
                ]
            )
        );
        
        // Create Options Fields:
        
        $fields->addFieldToTab(
            'Root.Options',
            FieldSection::create(
                'CarouselOptions',
                $this->fieldLabel('CarouselOptions'),
                [
                    NumericField::create(
                        'SlideInterval',
                        $this->fieldLabel('SlideInterval')
                    ),
                    CheckboxField::create(
                        'ShowControls',
                        $this->fieldLabel('ShowControls')
                    ),
                    CheckboxField::create(
                        'ShowIndicators',
                        $this->fieldLabel('ShowIndicators')
                    ),
                    CheckboxField::create(
                        'HideCaptionsOnMobile',
                        $this->fieldLabel('HideCaptionsOnMobile')
                    )
                ]
            )
        );
        
        // Answer Field Objects:
        
        return $fields;
    }
241162
public function getFieldLIst()
    {
        if (!isset($this->model->field_list)) {

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

        return $this->model->field_list;
    }
1060245
public function getCMSFields()
    {
        $linksGridConfig = GridFieldConfig_RelationEditor::create();
        if ($this->Links()->Count() > 0) {
            $linksGridConfig->addComponent(new GridFieldOrderableRows());
        }

        $fields = parent::getCMSFields();
        $fields->addFieldsToTab(
            "Root.Main",
            array(
                TextareaField::create(
                    'Title'
                )->setRows(1),
                HTMLEditorField::create(
                    'Content'
                ),
                SortableUploadField::create(
                    'Images',
                    'Current Image(s)'
                ),
                GridField::create(
                    'Links',
                    'Links',
                    $this->Links(),
                    $linksGridConfig
                )
            )
        );

        $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;
    }
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;
    }
359500
public function getCMSFields()
    {
        // Obtain Field Objects (from parent):
        
        $fields = parent::getCMSFields();
        
        // Create Options Fields:
        
        $fields->addFieldToTab(
            'Root.Options',
            FieldSection::create(
                'RowOptions',
                $this->fieldLabel('RowOptions'),
                [
                    CheckboxField::create(
                        'NoGutters',
                        $this->fieldLabel('NoGutters')
                    ),
                    CheckboxField::create(
                        'UseContainer',
                        $this->fieldLabel('UseContainer')
                    ),
                    CheckboxField::create(
                        'EdgeToEdge',
                        $this->fieldLabel('EdgeToEdge')
                    )
                ]
            )
        );
        
        // 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;
	}
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;
    }
1044165
public function getCMSFields() {
        $fields = parent::getCMSFields();
        $fields->addFieldsToTab(
            "Root.Main",
            array(
                OptionsetField::create(
                    'Status',
                    'Status',
                    array(
                        "1" => "Active",
                        "0" => "Disabled"
                    ),
                    1
                ),
                TextField::create(
                    'AdminTitle'
                )
                ->setDescription('This field is for adminisration use only and will not display on the site.'),
                TextareaField::create(
                    'Title',
                    'Title'
                )
                ->setRows(2),
                TextareaField::create(
                    'Content',
                    'Content'
                ),
                UploadField::create(
                    'Image',
                    'Image'
                )->setFolderName('Banner')
            )
        );
        $linksGridConfig = GridFieldConfig_RelationEditor::create();
        if ($this->Links()->Count() > 0) {
            $linksGridConfig->addComponent(new GridFieldOrderableRows());
        }
        $fields->addFieldToTab(
            'Root.Links',
            GridField::create(
                'Links',
                'Link(s)',
                $this->Links(),
                $linksGridConfig
            )
        );
        $this->extend('updateCMSFields', $fields);
        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;
    }
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;
    }