Updates the CMS fields of the extended object.

@param FieldList $fields List of CMS fields from the extended object.

@return void
483515
public function updateCMSFields(FieldList $fields)
    {
        // Update Field Objects (from parent):
        
        parent::updateCMSFields($fields);
        
        // Create Google Tab:
        
        $fields->findOrMakeTab(
            'Root.SilverWare.Services.Google',
            $this->owner->fieldLabel('Google')
        );
        
        // Define Placeholders:
        
        $placeholderAuto = _t(__CLASS__ . '.DROPDOWNAUTOMATIC', 'Automatic');
        
        // Create Field Objects:
        
        $fields->addFieldsToTab(
            'Root.SilverWare.Services.Google',
            [
                FieldSection::create(
                    'GoogleAPIConfig',
                    $this->owner->fieldLabel('GoogleAPIConfig'),
                    [
                        TextField::create(
                            'GoogleAPIKey',
                            $this->owner->fieldLabel('GoogleAPIKey')
                        )->setRightTitle(
                            _t(
                                __CLASS__ . '.GOOGLEAPIKEYRIGHTTITLE',
                                'Create credentials using the Google API Manager and paste the API key here.'
                            )
                        ),
                        DropdownField::create(
                            'GoogleAPILanguage',
                            $this->owner->fieldLabel('GoogleAPILanguage'),
                            $this->owner->getGoogleLanguageOptions()
                        )->setEmptyString(' ')->setAttribute('data-placeholder', $placeholderAuto)
                    ]
                ),
                FieldSection::create(
                    'GoogleAnalyticsConfig',
                    $this->owner->fieldLabel('GoogleAnalyticsConfig'),
                    [
                        CheckboxField::create(
                            'GoogleAnalyticsEnabled',
                            $this->owner->fieldLabel('GoogleAnalyticsEnabled')
                        ),
                        TextField::create(
                            'GoogleAnalyticsTrackingID',
                            $this->owner->fieldLabel('GoogleAnalyticsTrackingID')
                        )->setAttribute('spellcheck', 'false')
                    ]
                ),
                FieldSection::create(
                    'GoogleVerificationConfig',
                    $this->owner->fieldLabel('GoogleVerificationConfig'),
                    [
                        TextField::create(
                            'GoogleVerificationCode',
                            $this->owner->fieldLabel('GoogleVerificationCode')
                        )->setAttribute('spellcheck', 'false')
                    ]
                )
            ]
        );
    }
642194
public function setFields($values)
    {
        foreach ($values as $field => $value) {
            $this->setField($field, $value);
        }
    }
410507
public function updateCMSFields(FieldList $fields)
    {
        // only apply the update to files (not folders)
        if ($this->owner->class != 'Folder') {
            // add the tabs from the translatable tab set to the fields
            /** @var TabSet $set */
            $set = $this->owner->getTranslatableTabSet();

            // Remove the tab of the default locale (these are in the "main" tab)
            $set->removeByName(Translatable::default_locale());

            foreach ($set->FieldList() as $tab) {
                $fields->addFieldToTab('Root', $tab);
            }
        }
    }
632798
public function setFields( $fields )
	{
		if( is_array( $fields ) && count( $fields ) )
			$this->fields = $fields;
		else
			trigger_error( 'Field Array of Table Definition must no be empty.', E_USER_ERROR );
	}
1097631
public function updateCMSFields(FieldList $fields)
    {
        // Update Field Objects (from parent):
        
        parent::updateCMSFields($fields);
        
        // Create Icons Tab:
        
        $fields->findOrMakeTab('Root.SilverWare.Icons', $this->owner->fieldLabel('Icons'));
        
        // Create Icon Upload Fields:
        
        $fields->addFieldsToTab(
            'Root.SilverWare.Icons',
            [
                $small = UploadField::create(
                    'AppIconSmall',
                    $this->owner->fieldLabel('AppIconSmall')
                )->setAllowedFileCategories('image')->setFolderName($this->getAssetFolder()),
                $large = UploadField::create(
                    'AppIconLarge',
                    $this->owner->fieldLabel('AppIconLarge')
                )->setAllowedFileCategories('image')->setFolderName($this->getAssetFolder()),
                $touch = UploadField::create(
                    'AppIconTouch',
                    $this->owner->fieldLabel('AppIconTouch')
                )->setAllowedFileCategories('image')->setFolderName($this->getAssetFolder())
            ]
        );
        
        // Define Icon Upload Fields:
        
        $small->setRightTitle(
            _t(
                __CLASS__ . '.APPICONSMALLRIGHTTITLE',
                'Used for the bookmark icon (16 x 16 pixels recommended).'
            )
        );
        
        $large->setRightTitle(
            _t(
                __CLASS__ . '.APPICONLARGERIGHTTITLE',
                'Used for social media sharing (at least 500 x 500 pixels recommended).'
            )
        );
        
        $touch->getValidator()->setAllowedExtensions(['png']);
        $touch->setRightTitle(
            _t(
                __CLASS__ . '.APPICONTOUCHRIGHTTITLE',
                'Used for touch icons (at least 500 x 500 pixels recommended, PNG format required).'
            )
        );
    }
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);
        }
    }
1056399
public function updateCMSFields(FieldList $fields)
    {
        $owner = $this->owner;
        $fields->addFieldToTab(
            "Root.Main",
            HiddenField::create(
                'SubsiteID',
                'SubsiteID',
                Subsite::currentSubsiteID()
            )
        );
        return $fields;
    }
1265847
public function updateFrontEndFields(FieldList $fields)
    {
        if (!$this->owner->ID) {
            $fields->replaceField('InheritPerms', new CheckboxField('InheritPerms', _t('Restrictable.INHERIT_PERMS', 'Inherit Permissions'), true));
        }
        
        $ownerField = $fields->fieldByName('OwnerID');
        if ($ownerField) {
            $members = singleton('DataService')->getAllMember();
            $source = array();
            if ($members) {
                $source = $members->map();
            }
            if (method_exists($ownerField, 'setSource')) {
                $ownerField->setSource($source);
            }
        }
    }
23711
public function updateSettingsFields(FieldList $fields)
    {
        // Update Field Objects:
        
        $fields->addFieldToTab(
            'Root.Settings',
            $settings = FieldSection::create(
                'NavigationSettings',
                $this->owner->fieldLabel('NavigationSettings'),
                [
                    CheckboxField::create(
                        'CrumbsDisabled',
                        $this->owner->fieldLabel('CrumbsDisabled')
                    ),
                    CheckboxField::create(
                        'HideFromMainMenu',
                        $this->owner->fieldLabel('HideFromMainMenu')
                    )
                ]
            )
        );
        
        // Check Permissions and Modify Fields:
        
        if (!Permission::check(['ADMIN', 'SILVERWARE_PAGE_SETTINGS_CHANGE'])) {
            
            foreach ($settings->getChildren() as $field) {
                $settings->makeFieldReadonly($field);
            }
            
        }
    }
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)
                    ]
                )
            ]
        );
    }
598246
protected function setPostFields (array $fields)
	{
		foreach ($fields as $key => $value) $this->fields[$key] = $value;
	}
807250
public function updateCMSFields(FieldList $fields)
    {
        $fields->addFieldsToTab(
            'Root.Actions',
            array(
                UploadField::create(
                    'ActionImage',
                    _t('Actions.IMAGE', 'Image')
                ),
                TextareaField::create(
                    'ActionSummary',
                    _t('Actions.SUMMARY', 'Summary')
                )->setRows(3),
                TextField::create(
                    'ActionLabel',
                    _t('Actions.LABEL', 'More')
                )
            )
        );
        return $fields;
    }
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;
    }
136657
public function setFieldList($field_list = array())
    {
        if (empty($field_list)) $this->_field_list = array('*');
        $this->_field_list = (array)$field_list;

        return $this;
    }
970549
public function updateCMSFields(FieldList $fields)
    {
        // Update Field Objects:
        
        $fields->fieldByName('Root.Main')->setTitle(_t(__CLASS__ . '.TABMAIN', 'Main'));
        
        // Remove Field Objects:
        
        if ($this->owner->config()->disable_metadata_toggle) {
            $fields->removeFieldFromTab('Root', 'Metadata');
        }
        
        // Add Tab Number Badges:
        
        if ($badges = $this->owner->getNumberBadgeData()) {
            $fields->fieldByName('Root')->setAttribute('data-number-badges', json_encode($badges));
        }
    }
188635
public function updateFormFields(FieldList $fields, $controller, $formName, $context)
    {
        $image = isset($context['Record']) ? $context['Record'] : null;
        if ($image && $image->appCategory() === 'image') {
            $fields->insertAfter(
                'Title',
                FocusPointField::create('FocusPoint', $image->fieldLabel('FocusPoint'), $image)
                    ->setReadonly($formName === 'fileSelectForm')
            );
        }
    }
737508
protected function AddUpdateFields(&$Fields) {
      $this->DefineSchema();
      if ($this->Schema->FieldExists($this->Name, $this->DateUpdated)) {
         if (!isset($Fields[$this->DateUpdated]))
            $Fields[$this->DateUpdated] = Gdn_Format::ToDateTime();
      }

      $Session = Gdn::Session();
      if ($Session->UserID > 0 && $this->Schema->FieldExists($this->Name, $this->UpdateUserID))
         if (!isset($Fields[$this->UpdateUserID]))
            $Fields[$this->UpdateUserID] = $Session->UserID;

      if ($this->Schema->FieldExists($this->Name, 'UpdateIPAddress') && !isset($Fields['UpdateIPAddress'])) {
         $Fields['UpdateIPAddress'] = Gdn::Request()->IpAddress();
      }
   }