Updates the CMS fields of the extended object.

@param FieldList $fields
182312
public function updateCMSFields(FieldList $fields)
    {
        // Create Moderno Tab Set:
        
        $fields->addFieldToTab(
            'Root',
            TabSet::create(
                'Moderno',
                _t('ModernoConfigExtension.MODERNO', 'Moderno')
            )
        );
        
        // Create Colors Tab:
        
        $fields->findOrMakeTab('Root.Moderno.Colors', _t('ModernoConfigExtension.COLORS', 'Colors'));
        
        // Create Colors Fields:
        
        $fields->addFieldsToTab(
            'Root.Moderno.Colors',
            array(
                ColorField::create(
                    'ModernoHighlightColor',
                    _t('ModernoConfigExtension.HIGHLIGHTCOLOR', 'Highlight color')
                ),
                ColorField::create(
                    'ModernoLogoBkgColor',
                    _t('ModernoConfigExtension.LOGOBACKGROUNDCOLOR', 'Logo background color')
                ),
                ColorField::create(
                    'ModernoLinkColor',
                    _t('ModernoConfigExtension.LINKCOLOR', 'Link color')
                ),
                ColorField::create(
                    'ModernoProfileLinkColor',
                    _t('ModernoConfigExtension.PROFILELINKCOLOR', 'Profile link color')
                )
            )
        );
        
        // Create Branding Tab:
        
        $fields->findOrMakeTab('Root.Moderno.Branding', _t('ModernoConfigExtension.BRANDING', 'Branding'));
        
        // Create Branding Fields:
        
        $fields->addFieldsToTab(
            'Root.Moderno.Branding',
            array(
                TextField::create(
                    'ModernoApplicationName',
                    _t('ModernoConfigExtension.APPLICATIONNAME', 'Application name')
                ),
                TextField::create(
                    'ModernoApplicationLink',
                    _t('ModernoConfigExtension.APPLICATIONLINK', 'Application link')
                ),
                ToggleCompositeField::create(
                    'ModernoLogoToggle',
                    _t('ModernoConfigExtension.LOGOIMAGETOGGLETITLE', 'Logo Image'),
                    array(
                        UploadField::create(
                            'ModernoLogoImage',
                            _t('ModernoConfigExtension.LOGOIMAGE', 'Logo image')
                        )->setAllowedFileCategories('image')->setFolderName(self::get_asset_path()),
                        FieldGroup::create(
                            _t('ModernoConfigExtension.DIMENSIONSINPIXELS', 'Dimensions (in pixels)'),
                            array(
                                TextField::create('ModernoLogoImageWidth', '')->setAttribute(
                                    'placeholder',
                                    _t('ModernoConfigExtension.WIDTH', 'Width')
                                ),
                                LiteralField::create('ModernoLogoImageBy', '<i class="fa fa-times by"></i>'),
                                TextField::create('ModernoLogoImageHeight', '')->setAttribute(
                                    'placeholder',
                                    _t('ModernoConfigExtension.HEIGHT', 'Height')
                                )
                            )
                        ),
                        DropdownField::create(
                            'ModernoLogoImageResize',
                            _t('ModernoConfigExtension.RESIZEMETHOD', 'Resize method'),
                            self::get_resize_methods()
                        )->setEmptyString(' '),
                        CheckboxField::create(
                            'ModernoHideSiteName',
                            _t('ModernoConfigExtension.HIDESITENAME', 'Hide site name')
                        ),
                        CheckboxField::create(
                            'ModernoSupportRetina',
                            _t('ModernoConfigExtension.SUPPORTRETINADEVICES', 'Support Retina devices')
                        )
                    )
                ),
                ToggleCompositeField::create(
                    'ModernoLoadingToggle',
                    _t('ModernoConfigExtension.LOADINGIMAGETOGGLETITLE', 'Loading Image'),
                    array(
                        UploadField::create(
                            'ModernoLoadingImage',
                            _t('ModernoConfigExtension.LOADINGIMAGE', 'Loading image')
                        )->setAllowedFileCategories('image')->setFolderName(self::get_asset_path()),
                        FieldGroup::create(
                            _t('ModernoConfigExtension.DIMENSIONSINPIXELS', 'Dimensions (in pixels)'),
                            array(
                                TextField::create('ModernoLoadingImageWidth', '')->setAttribute(
                                    'placeholder',
                                    _t('ModernoConfigExtension.WIDTH', 'Width')
                                ),
                                LiteralField::create('ModernoLoadingImageBy', '<i class="fa fa-times by"></i>'),
                                TextField::create('ModernoLoadingImageHeight', '')->setAttribute(
                                    'placeholder',
                                    _t('ModernoConfigExtension.HEIGHT', 'Height')
                                )
                            )
                        ),
                        DropdownField::create(
                            'ModernoLoadingImageResize',
                            _t('ModernoConfigExtension.RESIZEMETHOD', 'Resize method'),
                            self::get_resize_methods()
                        )->setEmptyString(' ')
                    )
                )
            )
        );
    }
126942
public function updateCMSFields(FieldList $fields)
    {
        $owner = $this->owner;

        $fields->removeByName(
            array(
                'SiteTreeID',
                'Anchor'
            )
        );

        // Insert site tree field after the file selection field
        $fields->insertAfter(
            'Type',
            DisplayLogicWrapper::create(
                TreeDropdownField::create(
                    'SiteTreeID',
                    _t('Links.PAGE', 'Page'),
                    'SiteTree'
                ),
                TextField::create(
                    'Anchor',
                    _t('Links.ANCHOR', 'Anchor/Querystring')
                )->setRightTitle(_t('Links.ANCHORINFO', 'Include # at the start of your anchor name or, ? at the start of your querystring'))
            )->displayIf("Type")->isEqualTo("SiteTree")->end()
        );

        // Display warning if the selected page is deleted or unpublished
        if ($owner->SiteTreeID && !$owner->SiteTree()->isPublished()) {
            $fields
                ->dataFieldByName('SiteTreeID')
                ->setRightTitle(_t('Links.DELETEDWARNING', 'Warning: The selected page appears to have been deleted or unpublished. This link may not appear or may be broken in the frontend'));
        }
    }
665896
protected function updateFormField($field)
    {
        parent::updateFormField($field);

        if ($this->MinValue) {
            $field->setAttribute('data-rule-min', $this->MinValue);
        }

        if ($this->MaxValue) {
            $field->setAttribute('data-rule-max', $this->MaxValue);
        }
    }
451508
public function setFields($values)
    {
        foreach ($values as $field => $value) {
            $this->_setFieldValue($field, $value);
        }
    }
836609
public function setActualFields($fields)
    {
        if ($this->owner->model->hasMethod('getActualFields')) {
            $this->importFields($this->owner->model, $fields);
        }
    }
772419
public void addAdditionalFields(List<CmsSolrField> additionalFields) {

        if (additionalFields != null) {
            for (CmsSolrField solrField : additionalFields) {
                m_solrFields.put(solrField.getName(), solrField);
            }
        }
    }
974862
public function updateFormFields(FieldList $fields)
    {
        $sites = Subsite::accessible_sites('CMS_ACCESS_AssetAdmin');
        $values = [];
        $values[0] = _t(__CLASS__ . '.AllSitesDropdownOpt', 'All sites');
        foreach ($sites as $site) {
            $values[$site->ID] = $site->Title;
        }
        ksort($values);
        if ($sites) {
            // Dropdown needed to move folders between subsites
            /** @var @skipUpgrade */
            $dropdown = DropdownField::create(
                'SubsiteID',
                _t(__CLASS__ . '.SubsiteFieldLabel', 'Subsite'),
                $values
            );
            $dropdown->addExtraClass('subsites-move-dropdown');
            $fields->push($dropdown);
            $fields->push(LiteralField::create(
                'Message',
                '<p class="alert alert-info">' .
                _t(
                    __CLASS__ . '.SUBSITENOTICE',
                    'Folders and files created in the main site are accessible by all subsites.'
                )
                . '</p>'
            ));
        }
    }
343010
public function updateCMSFields(FieldList $fields)
    {
        if (!Permission::check("VIEW_SECTIONS")) {
            return $fields;
        }

        $SectionGrid = GridFieldConfig_RelationEditor::create()
            ->removeComponentsByType('GridFieldAddNewButton')
            ->addComponent(new GridFieldAddNewMultiClass())
            ->addComponent(new GridFieldOrderableRows());

        $SectionGrid->getComponentByType('GridFieldAddExistingAutocompleter')
            ->setSearchFields(array('AdminTitle', 'MenuTitle'))
            ->setResultsFormat('$AdminTitle - $Type');

        $AvailableTypes = $this->AvailableSectionTypes();

        foreach ($AvailableTypes as $key => $value) {
            if($value['selectable_option'] && !$value['limit_reached']){
                $AvailableTypes[$key] = $value['type'];
            }
        }

        $SectionGrid->getComponentByType('GridFieldAddNewMultiClass')
            ->setClasses($AvailableTypes);

        // Limit total sections
        $LimitSectionTotal = Config::inst()->get($this->owner->ClassName, 'LimitSectionTotal');
        if (isset($LimitSectionTotal) && $this->owner->Sections()->Count() >= $LimitSectionTotal) {
            // remove the buttons if we don't want to allow more records to be added/created
            $SectionGrid->removeComponentsByType('GridFieldAddNewButton');
            $SectionGrid->removeComponentsByType('GridFieldAddExistingAutocompleter');
            $SectionGrid->removeComponentsByType('GridFieldAddNewMultiClass');
        }

        if (!Permission::check("LINK_SECTIONS")) {
            $SectionGrid->removeComponentsByType('GridFieldAddExistingAutocompleter');
        }

        if (!Permission::check("REORDER_SECTIONS")) {
            $SectionGrid->removeComponentsByType('GridFieldOrderableRows');
        }

        if (!Permission::check("UNLINK_SECTIONS")) {
            $SectionGrid->removeComponentsByType('GridFieldDeleteAction');
        }

        $fields->addFieldToTab(
            'Root.Section',
            GridField::create(
                'Sections',
                'Current Section(s)',
                $this->owner->Sections(),
                $SectionGrid
            )
        );

        $fields->addFieldToTab(
            'Root.Preview',
            UploadField::create(
                'PreviewImage',
                'Preview image'
            )->setFolderName('Preview')
        );

        return $fields;
    }
1237867
protected function setSubmittedList($field)
    {
        $value = $this->getSubmitted($field);

        if (isset($value)) {
            $this->setSubmitted($field, $this->explodeList($value));
        }
    }
1138181
public function updateCMSFields(FieldList $fields)
    {
        // Update Field Objects (from parent):
        
        parent::updateCMSFields($fields);
        
        // Define Placeholder:
        
        $placeholder = _t(__CLASS__ . '.DROPDOWNDEFAULT', '(default)');
        
        // Create Style Fields:
        
        $fields->addFieldsToTab(
            'Root.Style',
            [
                FieldSection::create(
                    'CornerStyle',
                    $this->owner->fieldLabel('Corners'),
                    [
                        DropdownField::create(
                            'CornerStyle',
                            $this->owner->fieldLabel('CornerStyle'),
                            $this->owner->getCornerStyleOptions()
                        )->setEmptyString(' ')->setAttribute('data-placeholder', $placeholder)
                    ]
                )
            ]
        );
    }
1056399
public function updateCMSFields(FieldList $fields)
    {
        $owner = $this->owner;
        $fields->addFieldToTab(
            "Root.Main",
            HiddenField::create(
                'SubsiteID',
                'SubsiteID',
                Subsite::currentSubsiteID()
            )
        );
        return $fields;
    }
598246
protected function setPostFields (array $fields)
	{
		foreach ($fields as $key => $value) $this->fields[$key] = $value;
	}
201527
public function updateCMSFields(FieldList $fields) {
        
        $fields->addFieldToTab('Root.Main', $field=new OptionsetField('DefaultPreviewMode', _t('UserPreviewPreference.DEFAULT_MODE', '_Default Preview Mode'), array(
                                                                                                                                                            'content'=>_t('UserPreviewPreference.CONTENT_MODE', '_Content Mode: Only menu and content areas are shown'),
                                                                                                                                                            'split'=>_t('UserPreviewPreference.SPLIT_MODE', '_Split Mode: Side by Side editing and previewing'),
                                                                                                                                                            'preview'=>_t('UserPreviewPreference.PREVIEW_MODE', '_Preview Mode: Only menu and preview areas are shown')
                                                                                                                                                        ), Config::inst()->get('UserPreviewPreference', 'DefaultMode')));
        
        if(Controller::curr()->getRequest()->getSession()->get('ShowPreviewSettingChangeReload')==true) {
            $field->setMessage(_t('UserPreviewPreference.CHANGE_REFRESH', '_You have updated your preview preference, you must refresh your browser to see the updated setting'), 'warning');
            Requirements::javascript('webbuilders-group/silverstripe-cmspreviewpreference: javascript/clear-local-preference.js');
            
            if($this->isSaving==false) {
                Controller::curr()->getRequest()->getSession()->clear('ShowPreviewSettingChangeReload');
            }
        }
    }
713325
public function updateCMSFields(FieldList $fields)
    {
        $owner = $this->owner;
        $fields->removeByName(array('News', 'NewsID', 'SortOrder'));
        $fields->addFieldsToTab(
            'Root.Main', array(
                TextField::create('Title', $owner->fieldLabel('Title')),
                HtmlEditorField::create('Description', $owner->fieldLabel('Description')),
                UploadField::create('Image', $owner->fieldLabel('Image')),
            )
        );
    }
152637
public function addFields($fields)
    {
        if (!is_array($fields)) {
            $fields = array_map(function ($f) {
                return trim($f);
            }, explode(',', $fields));
        }

        $this->fields = array_merge($this->fields, $fields);

        return $this;
    }
101745
public function updateCMSFields(FieldList $fields)
    {
        // Define Placeholder:
        
        $placeholder = _t(__CLASS__ . '.DROPDOWNSELECT', 'Select');
        
        // Create Main Fields:
        
        $fields->addFieldsToTab(
            'Root.Main',
            [
                DropdownField::create(
                    'ListSourceID',
                    $this->owner->fieldLabel('ListSourceID'),
                    $this->getListSourceOptions()
                )->setEmptyString(' ')->setAttribute('data-placeholder', $placeholder)
            ]
        );
        
        // Create Options Fields:
        
        $fields->addFieldToTab(
            'Root.Options',
            FieldSection::create(
                'ListSourceOptions',
                $this->owner->fieldLabel('ListSourceOptions'),
                [
                    TextField::create(
                        'NumberOfItems',
                        $this->owner->fieldLabel('NumberOfItems')
                    ),
                    DropdownField::create(
                        'SortItemsBy',
                        $this->owner->fieldLabel('SortItemsBy'),
                        $this->owner->getSortItemsByOptions()
                    ),
                    CheckboxField::create(
                        'ReverseItems',
                        $this->owner->fieldLabel('ReverseItems')
                    ),
                    CheckboxField::create(
                        'ImageItems',
                        $this->owner->fieldLabel('ImageItems')
                    )
                ]
            )
        );
        
        // Create Pagination Options (if permitted):
        
        if ($this->owner->canPaginate()) {
            
            $fields->insertBefore(
                SelectionGroup::create(
                    'PaginateItems',
                    [
                        SelectionGroup_Item::create(
                            '0',
                            null,
                            $this->owner->fieldLabel('Disabled')
                        ),
                        SelectionGroup_Item::create(
                            '1',
                            TextField::create(
                                'ItemsPerPage',
                                $this->owner->fieldLabel('ItemsPerPage')
                            ),
                            $this->owner->fieldLabel('Enabled')
                        )
                    ]
                )->setTitle($this->owner->fieldLabel('PaginateItems')),
                'ReverseItems'
            );
            
        }
    }
1036608
public function updateCMSFields(FieldList $fields)
    {
        $owner = $this->owner;
        $fields->removeByName(array('MD5Email', 'NewsID'));
        $fields->addFieldsToTab(
            'Root.Main', array(
                TextField::create('Title', $owner->fieldLabel('Title')),
                TextField::create('Name', $owner->fieldLabel('Name')),
                TextField::create('Email', $owner->fieldLabel('Email')),
                TextField::create('URL', $owner->fieldLabel('URL')),
                HtmlEditorField::create('Comment', $owner->fieldLabel('Comment')),
                CheckboxField::create('AkismetMarked', $owner->fieldLabel('AkismetMarked')),
                CheckboxField::create('Visible', $owner->fieldLabel('Visible')),
                CheckboxField::create('ShowGravatar', $owner->fieldLabel('ShowGravatar')),
            )
        );
    }