CMS Fields
@return FieldList
2563
public function getCMSFields()
    {
        $fields = parent::getCMSFields();
        $fields->addFieldsToTab(
            'Root.Main',
            array(
                DaysOfWeekField::create(
                    'DayOfWeek',
                    _t('SchemaOpeningHours.DAYOFWEEK', 'Days of the week')
                ),
                TextField::create(
                    'Opens',
                    _t('SchemaOpeningHours.OPENS', 'Opens')
                ),
                TextField::create(
                    'Closes',
                    _t('SchemaOpeningHours.CLOSES', 'Closes')
                ),
                TextField::create(
                    'ValidFrom',
                    _t('SchemaOpeningHours.VALIDFROM', 'Valid from')
                ),
                TextField::create(
                    'ValidThrough',
                    _t('SchemaOpeningHours.VALIDTROUGH', 'Valid through')
                )
            )
        );
        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;
    }
932449
public function getCMSFields() {
        $self=$this;
        $this->beforeUpdateCMSFields(function($fields) use($self) {
            $fields->insertAfter(new ReadonlyField('MenuTitle', $self->fieldLabel('MenuTitle')), 'Title');
            $fields->addFieldToTab('Root.Main', new ReadonlyField('MetaDescription', $self->fieldLabel('MetaDescription')));
        });
        
        
        return parent::getCMSFields();
    }
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;
    }
973819
public function updateCMSFields(FieldList $fields)
    {
        $fields->addFieldsToTab(
            'Root.Meta',
            array(
                UploadField::create('MetaImageCustom', 'Default Meta Image'),
                GridField::create(
                    'ContactPoints',
                    _t('SiteConfig.CONTACTPOINTS', 'Contact points'),
                    $this->owner->ContactPoints(),
                    GridFieldConfig_RecordEditor::create()
                ),
                GridField::create(
                    'LocalBusiness',
                    _t('SiteConfig.LOCALBUSINESS', 'Local business'),
                    $this->owner->LocalBusiness(),
                    GridFieldConfig_RecordEditor::create()
                )
            )
        );
        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;
    }
1021526
public function getCMSFields()
    {
        $this->beforeUpdateCMSFields(function ($fields) {
            // Go through a convoluted process to find out field group
            // as the default fieldlist doesn't seem to register it!
            $main = $fields->findOrMakeTab("Root.Main");
            $details = null;

            $enddate_field = $fields->dataFieldByName("EndDate");
            $enddate_field->setTitle(_t("OrdersAdmin.Due", "Due"));

            // Manually loop through fields to find info composite field, as
            // fieldByName cannot reliably find this.
            foreach ($main->getChildren() as $field) {
                if ($field->getName() == "OrdersDetails") {
                    foreach ($field->getChildren() as $field) {
                        if ($field->getName() == "OrdersDetailsInfo") {
                            $details = $field;
                        }
                    }
                }
            }

            if ($details) {
                $details->insertBefore(
                    "StartDate",
                    DropdownField::create(
                        'Status',
                        null,
                        $this->config()->get("statuses")
                    )
                );
            }
        });

        return parent::getCMSFields();
    }
224008
public function getCMSFields()
    {
        // PHP 5.3 only
        $self = $this;
        $this->beforeUpdateCMSFields(function (FieldList $fields) use ($self) {
            $fields->removeFieldsFromTab(
                'Root.Main',
                array('KeyValuePairs', 'SortBy', 'SortByDirection')
            );
            // Don't put the GridField for documents in until the set has been created
            if (!$self->isInDB()) {
                $fields->addFieldToTab(
                    'Root.Main',
                    LiteralField::create(
                        'GridFieldNotice',
                        '<p class="message warning">' . _t(
                            'DMSDocumentSet.GRIDFIELD_NOTICE',
                            'Managing documents will be available once you have created this document set.'
                        ) . '</p>'
                    ),
                    'Title'
                );
            } else {
                $fields->removeByName('DocumentSetSort');
                // Document listing
                $gridFieldConfig = GridFieldConfig::create()
                    ->addComponents(
                        new GridFieldButtonRow('before'),
                        new GridFieldToolbarHeader(),
                        new GridFieldFilterHeader(),
                        new GridFieldSortableHeader(),
                        new GridFieldDataColumns(),
                        new DMSGridFieldEditButton(),
                        // Special delete dialog to handle custom behaviour of unlinking and deleting
                        new GridFieldDeleteAction(true),
                        new GridFieldDetailForm()
                    );

                if (class_exists('GridFieldPaginatorWithShowAll')) {
                    $paginatorComponent = new GridFieldPaginatorWithShowAll(15);
                } else {
                    $paginatorComponent = new GridFieldPaginator(15);
                }
                $gridFieldConfig->addComponent($paginatorComponent);

                if (class_exists('GridFieldSortableRows')) {
                    $gridFieldConfig->addComponent(new GridFieldSortableRows('DocumentSort'));
                } elseif (class_exists('GridFieldOrderableRows')) {
                    $gridFieldConfig->addComponent(new GridFieldOrderableRows('DocumentSort'));
                }

                // Don't show which page this is if we're already editing within a page context
                if (Controller::curr() instanceof CMSPageEditController) {
                    $fields->removeByName('PageID');
                } else {
                    $fields->fieldByName('Root.Main.PageID')->setTitle(_t('DMSDocumentSet.SHOWONPAGE', 'Show on page'));
                }

                // Don't show which page this is if we're already editing within a page context
                if (Controller::curr() instanceof CMSPageEditController) {
                    $fields->removeByName('PageID');
                } else {
                    $fields->fieldByName('Root.Main.PageID')->setTitle(_t('DMSDocumentSet.SHOWONPAGE', 'Show on page'));
                }

                $gridFieldConfig->getComponentByType('GridFieldDataColumns')
                    ->setDisplayFields($self->getDocumentDisplayFields())
                    ->setFieldCasting(array('LastEdited' => 'Datetime->Ago'))
                    ->setFieldFormatting(
                        array(
                            'FilenameWithoutID' => '<a target=\'_blank\' class=\'file-url\''
                                . ' href=\'$Link\'>$FilenameWithoutID</a>',
                            'ManuallyAdded' => function ($value) {
                                if ($value) {
                                    return _t('DMSDocumentSet.MANUAL', 'Manually');
                                }
                                return _t('DMSDocumentSet.QUERYBUILDER', 'Query Builder');
                            }
                        )
                    );

                // Override delete functionality with this class
                $gridFieldConfig->getComponentByType('GridFieldDetailForm')
                    ->setItemRequestClass('DMSGridFieldDetailForm_ItemRequest');
                $gridField = GridField::create(
                    'Documents',
                    false,
                    $self->Documents(),
                    $gridFieldConfig
                );
                $gridField->setModelClass('DMSDocument');
                $gridField->addExtraClass('documents');

                $gridFieldConfig->addComponent(
                    $addNewButton = new DMSGridFieldAddNewButton('buttons-before-left'),
                    'GridFieldExportButton'
                );
                $addNewButton->setDocumentSetId($self->ID);

                $fields->removeByName('Documents');
                $fields->addFieldsToTab(
                    'Root.Main',
                    array(
                        $gridField,
                        HiddenField::create('DMSShortcodeHandlerKey', false, DMS::inst()->getShortcodeHandlerKey())
                    )
                );
                $self->addQueryFields($fields);
            }
        });
        $this->addRequirements();
        return parent::getCMSFields();
    }
1176087
public function getFieldList()
    {
        // Get additional fields of current structure
        $fields = dbQuery('\samson\cms\web\field\CMSField')
            ->join('\samson\cms\CMSNavField')
            ->cond('StructureID', $this->id)
            ->exec();

        // Create list view
        $items = '';

        // If structure has additional fields then add them to list
        if (sizeof($fields)) {
            foreach ($fields as $field) {
                $items .= m('structure')->view('form/field/field_item')->field($field)->structure($this)->output();
            }
        } else {
            // Add empty row
            $items = m('structure')->view('form/field/empty_field')->output();
        }

        // Return items view
        return $items;
    }
11721
public function getFields()
    {
        $fields = [];
        foreach ($this->fieldsets as $fieldset) {
            $fields = array_merge($fields, $fieldset->getAllFields());
        }
        return $fields;
    }
1252702
public function getCMSFields()
    {
        // Obtain Field Objects (from parent):
        
        $fields = parent::getCMSFields();
        
        // Create Field Objects:
        
        $fields->fieldByName('Root.Options.TitleOptions')->push(
            CheckboxField::create(
                'HidePageTitle',
                _t(__CLASS__ . '.HIDETITLEOFPAGE', 'Hide title of page')
            )
        );
        
        // Answer Field Objects:
        
        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;
    }
8869
protected function getFields() {
        if (!$this->_fields) {
            $this->_fields = new FieldList(
                $this->version,
                $this->solution['assistantSid'],
                $this->solution['sid']
            );
        }

        return $this->_fields;
    }
129750
public function getCMSFields()
    {
        $this->beforeUpdateCMSFields(function (FieldList $fields) {
            $fields
                ->fieldByName('Root.Main.HTML')
                ->setTitle(_t(__CLASS__ . '.ContentLabel', 'Content'));
        });
        return parent::getCMSFields();
    }
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;
    }
1153137
public function getCMSFields()
    {
        $this->beforeUpdateCMSFields(function (FieldList $fields) {
            if ($this->exists()) {
                // Add a GridField for domains to a new tab if the subsite has already been created
                $fields->addFieldsToTab('Root.Domains', [
                    GridField::create(
                        'Domains',
                        '',
                        $this->Domains(),
                        GridFieldConfig_RecordEditor::create(10)
                    )
                ]);
            }

            // Remove the default scaffolded blacklist field, we replace it with a checkbox set field
            // in a wrapper further down. The RedirectURL field is currently not in use.
            $fields->removeByName(['PageTypeBlacklist', 'RedirectURL']);

            $fields->addFieldToTab('Root.Main', DropdownField::create(
                'Language',
                $this->fieldLabel('Language'),
                Injector::inst()->get(IntlLocales::class)->getLocales()
            ), 'DefaultSite');

            $fields->addFieldsToTab('Root.Main', [
                ToggleCompositeField::create(
                    'PageTypeBlacklistToggle',
                    _t(__CLASS__ . '.PageTypeBlacklistField', 'Disallow page types?'),
                    [
                        CheckboxSetField::create('PageTypeBlacklist', '', $this->getPageTypeMap())
                    ]
                )->setHeadingLevel(4),
                HiddenField::create('ID', '', $this->ID),
                HiddenField::create('IsSubsite', '', 1)
            ]);

            // If there are any themes available, add the dropdown
            $themes = $this->allowedThemes();
            if (!empty($themes)) {
                $fields->addFieldToTab(
                    'Root.Main',
                    DropdownField::create('Theme', $this->fieldLabel('Theme'), $this->allowedThemes(), $this->Theme)
                        ->setEmptyString(_t(__CLASS__ . '.ThemeFieldEmptyString', '-')),
                    'PageTypeBlacklistToggle'
                );
            }

            // Targetted by the XHR PJAX JavaScript to reload the subsite list in the CMS
            $fields->fieldByName('Root.Main')->addExtraClass('subsite-model');

            // We don't need the Groups many many tab
            $fields->removeByName('Groups');

            // Rename the main tab to configuration
            $fields->fieldByName('Root.Main')->setTitle(_t(__CLASS__ . '.ConfigurationTab', 'Configuration'));
        });

        return parent::getCMSFields();
    }
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;
    }