Gets fields used in the cms
@return {FieldSet} Fields to be used
490533
public function getCMSFields() {
        $fields=new FieldList(
                            new TextField('Name', _t('SnippetLanguage.NAME', '_Name'), null, 100),
                            new TextField('FileExtension', _t('SnippetLanguage.FILE_EXTENSION', '_File Extension'), null, 45),
                            new CheckboxField('Hidden', _t('SnippetLanguage.HIDDEN', '_Hidden'))
                        );
        
        if($this->UserLanguage==false) {
            $fields->replaceField('Name', $fields->dataFieldByName('Name')->performReadonlyTransformation());
            $fields->replaceField('FileExtension', $fields->dataFieldByName('FileExtension')->performReadonlyTransformation());
        }
        
        return $fields;
    }
334056
public function getCMSFields() {

		$fields = parent::getCMSFields();
		Requirements::css('nglasl/silverstripe-extensible-search: client/css/extensible-search.css');

		// Determine the search engines that are available.

		$engines = array();
		foreach(self::config()->custom_search_engines as $engine => $display) {

			// The search engines may define an optional display title.

			if(is_numeric($engine)) {
				$engine = $display;
			}

			// Determine whether the search engines exist.

			if(ClassInfo::exists($engine)) {
				$engines[$engine] = $display;
			}
		}

		// Determine whether the full-text search engine is available.

		$configuration = Config::inst();
		$classes = $configuration->get(FulltextSearchable::class, 'searchable_classes');
		if(is_array($classes) && (count($classes) > 0)) {
			$engines['Full-Text'] = 'Full-Text';
		}

		// Display the search engine selection.

		$fields->addFieldToTab('Root.Main', DropdownField::create(
			'SearchEngine',
			_t('EXTENSIBLE_SEARCH.SEARCH_ENGINE', 'Search Engine'),
			$engines
		)->setHasEmptyDefault(true)->setDescription('This needs to be saved before further customisation is available'), 'Title');

		// Determine whether a search engine has been selected.

		if($this->SearchEngine && isset($engines[$this->SearchEngine])) {

			// Display a search engine specific notice.

			$fields->addFieldToTab('Root.Main', LiteralField::create(
				'SearchEngineNotice',
				"<p class='extensible-search notice'><strong>{$engines[$this->SearchEngine]} Search Page</strong></p>"
			), 'Title');

			// Determine whether the search engine supports hierarchy filtering.

			$hierarchy = $this->supports_hierarchy;
			if($this->SearchEngine !== 'Full-Text') {
				$hierarchy = singleton($this->SearchEngine)->supports_hierarchy;
			}

			// The search engine may only support limited hierarchy filtering for multiple sites.

			if($hierarchy || ClassInfo::exists(Multisites::class)) {

				// Display the search trees selection.

				$fields->addFieldToTab('Root.Main', $tree = TreeMultiselectField::create(
					'SearchTrees',
					_t('EXTENSIBLE_SEARCH.SEARCH_TREES', 'Search Trees'),
					SiteTree::class
				), 'Content');

				// Determine whether the search engine only supports limited hierarchy filtering.

				if(!$hierarchy) {

					// Update the search trees to reflect this.

					$tree->setDisableFunction(function($page) {

						return ($page->ParentID != 0);
					});
					$tree->setDescription('This <strong>search engine</strong> only supports limited hierarchy');
				}
			}

			// Display the sorting selection.

			$fields->addFieldToTab('Root.Main', DropdownField::create(
				'SortBy',
				_t('EXTENSIBLE_SEARCH.SORT_BY', 'Sort By'),
				$this->getSelectableFields()
			), 'Content');
			$fields->addFieldToTab('Root.Main', DropdownField::create(
				'SortDirection',
				_t('EXTENSIBLE_SEARCH.SORT_DIRECTION', 'Sort Direction'),
				array(
					'DESC' => _t('EXTENSIBLE_SEARCH.DESCENDING', 'Descending'),
					'ASC' => _t('EXTENSIBLE_SEARCH.ASCENDING', 'Ascending')
				)
			), 'Content');

			// Display the start with listing selection.

			$fields->addFieldToTab('Root.Main', CheckboxField::create(
				'StartWithListing',
				_t('EXTENSIBLE_SEARCH.START_WITH_LISTING?', 'Start With Listing?')
			)->addExtraClass('start-with-listing'), 'Content');

			// Display the results per page selection.

			$fields->addFieldToTab('Root.Main', NumericField::create(
				'ResultsPerPage',
				_t('EXTENSIBLE_SEARCH.RESULTS_PER_PAGE', 'Results Per Page')
			), 'Content');
		}
		else {

			// The search engine has not been selected.

			$fields->addFieldToTab('Root.Main', LiteralField::create(
				'SearchEngineNotification',
				"<p class='extensible-search notification'><strong>Select a Search Engine</strong></p>"
			), 'Title');
		}

		// The history view shouldn't show the following, as they're not versioned.

		$pageHistory = Controller::has_curr() && (Controller::curr() instanceof CMSPageHistoryController);

		// Determine whether analytics have been enabled.

		if($configuration->get(ExtensibleSearch::class, 'enable_analytics') && !$pageHistory) {

			// Instantiate the analytic summary.

			$fields->findOrMakeTab('Root.SearchAnalytics.Current', _t('EXTENSIBLE_SEARCH.CURRENT', 'Current'));
			$fields->findOrMakeTab('Root.SearchAnalytics')->setTitle(_t('EXTENSIBLE_SEARCH.SEARCH_ANALYTICS', 'Search Analytics'));
			$fields->addFieldToTab('Root.SearchAnalytics.Current', $summary = GridField::create(
				'HistorySummary',
				_t('EXTENSIBLE_SEARCH.SUMMARY', 'Summary'),
				$this->getHistorySummary()
			)->setModelClass(ExtensibleSearch::class));
			$summaryConfiguration = $summary->getConfig();

			// Update the display columns.

			$summaryDisplay = singleton(ExtensibleSearchArchived::class)->fieldLabels();
			$summaryConfiguration->getComponentByType(GridFieldDataColumns::class)->setDisplayFields($summaryDisplay);

			// Instantiate an export button.

			if($this->getHistorySummary()->exists()) {
				$summaryConfiguration->addComponent($summaryExport = new GridFieldExportButton());
				$summaryExport->setExportColumns($summaryDisplay);
			}

			// Update the custom summary fields to be sortable.

			$summaryConfiguration->getComponentByType(GridFieldSortableHeader::class)->setFieldSorting(array(
				'FrequencyPercentage' => 'Frequency'
			));
			$summaryConfiguration->removeComponentsByType(GridFieldFilterHeader::class);

			// Instantiate the analytic history.

			$fields->addFieldToTab('Root.SearchAnalytics.Current', $history = GridField::create(
				'History',
				_t('EXTENSIBLE_SEARCH.HISTORY', 'History'),
				$this->History()
			)->setModelClass(ExtensibleSearch::class));
			$historyConfiguration = $history->getConfig();

			// Update the custom summary fields to be sortable.

			$historyConfiguration->getComponentByType(GridFieldSortableHeader::class)->setFieldSorting(array(
				'Created.Nice' => 'Created',
				'TimeTakenSummary' => 'Time',
				'SearchEngineSummary' => 'SearchEngine'
			));
			$historyConfiguration->removeComponentsByType(GridFieldFilterHeader::class);

			// Instantiate the archived collection of search analytics.

			$archives = $this->Archives();
			if($archives->exists() && $archives->first()->canView()) {
				$fields->findOrMakeTab('Root.SearchAnalytics.Archives', _t('EXTENSIBLE_SEARCH.ARCHIVES', 'Archives'));
				$fields->addFieldToTab('Root.SearchAnalytics.Archives', GridField::create(
					'Archives',
					_t('EXTENSIBLE_SEARCH.ARCHIVES', 'Archives'),
					$archives,
					$archivesConfiguration = GridFieldConfig_RecordEditor::create()
				)->setModelClass(ExtensibleSearchArchive::class));

				// Update the custom summary fields to be sortable.

				$archivesConfiguration->getComponentByType(GridFieldSortableHeader::class)->setFieldSorting(array(
					'TitleSummary' => 'StartingDate'
				));
				$archivesConfiguration->removeComponentsByType(GridFieldFilterHeader::class);
			}
		}

		// Determine whether suggestions have been enabled.

		if($configuration->get(ExtensibleSearchSuggestion::class, 'enable_suggestions') && !$pageHistory) {

			// Appropriately restrict the approval functionality.

			$user = Member::currentUserID();
			if(Permission::checkMember($user, 'EXTENSIBLE_SEARCH_SUGGESTIONS')) {
				Requirements::javascript('nglasl/silverstripe-extensible-search: client/javascript/extensible-search-approval.js');
			}

			// Determine the search page specific suggestions.

			$fields->findOrMakeTab('Root.SearchSuggestions', _t('EXTENSIBLE_SEARCH.SEARCH_SUGGESTIONS', 'Search Suggestions'));
			$fields->addFieldToTab('Root.SearchSuggestions', GridField::create(
				'Suggestions',
				_t('EXTENSIBLE_SEARCH.SUGGESTIONS', 'Suggestions'),
				$this->Suggestions(),
				$suggestionsConfiguration =
					singleton(ExtensibleSearchSuggestion::class)->canEdit() ? GridFieldConfig_RecordEditor::create() : GridFieldConfig_Base::create()
			)->setModelClass(ExtensibleSearchSuggestion::class));

			// Update the custom summary fields to be sortable.

			$suggestionsConfiguration->getComponentByType(GridFieldSortableHeader::class)->setFieldSorting(array(
				'FrequencySummary' => 'Frequency',
				'FrequencyPercentage' => 'Frequency',
				'ApprovedField' => 'Approved'
			));
			$suggestionsConfiguration->removeComponentsByType(GridFieldFilterHeader::class);
		}

		// Allow extension customisation.

		$this->extend('updateExtensibleSearchPageCMSFields', $fields);
		return $fields;
	}
1244081
public function getCMSFields()
    {
        // Obtain Field Objects (from parent):
        
        $fields = parent::getCMSFields();
        
        // Create Main Fields:
        
        $fields->addFieldsToTab(
            'Root.Main',
            [
                FieldSection::create(
                    'EmailSection',
                    $this->fieldLabel('Email'),
                    [
                        TextField::create(
                            'EmailSubject',
                            $this->fieldLabel('EmailSubject')
                        )->setRightTitle(
                            _t(
                                __CLASS__ . '.EMAILSUBJECTRIGHTTITLE',
                                'Uses the title of the current page if blank.'
                            )
                        ),
                        TextField::create(
                            'EmailMessage',
                            $this->fieldLabel('EmailMessage')
                        )->setRightTitle(
                            _t(
                                __CLASS__ . '.EMAILMESSAGERIGHTTITLE',
                                'Included in the body of the email before the shared link.'
                            )
                        )
                    ]
                )
            ]
        );
        
        // Answer Field Objects:
        
        return $fields;
    }
1068114
public function getCMSFields()
    {
        $fields = FieldList::create(
            TabSet::create(
                "Root",
                Tab::create("Main")
            )
            ->setTitle(_t('SiteTree.TABMAIN', "Main"))
        );
        $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;
    }
606183
@SuppressWarnings("unchecked")
    private Set<String> getResourcePaths() {

        Set<String> resources = new HashSet<String>();
        for (Component c : m_resources) {
            if (c instanceof CmsRemovableFormRow<?>) {
                String value = ((CmsRemovableFormRow<CmsPathSelectField>)c).getInput().getValue();
                if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(value)) {
                    resources.add(value);
                }
            }
        }
        return resources;
    }
604337
public function getFields()
    {
        $fields = FieldList::create($this->fields);
        
        foreach ($fields as $field) {
            
            $fields->insertAfter(
                $field->getName(),
                LiteralField::create(
                    sprintf('%s_ByLiteral', $field->getName()),
                    '<div class="by"><span class="icon"></span></div>'
                )
            );
            
        }
        
        return $fields;
    }
11721
public function getFields()
    {
        $fields = [];
        foreach ($this->fieldsets as $fieldset) {
            $fields = array_merge($fields, $fieldset->getAllFields());
        }
        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();
    }
1252340
public function getCMSFields()
    {
        $fields = parent::getCMSFields();

        $TeaserConfig = GridFieldConfig_RecordEditor::create();
        if ($this->LinkList()->Count() > 0) {
            $TeaserConfig->addComponent(new GridFieldOrderableRows());
        }

        $fields->removeByName(
            array(
                'ParentPageID',
                'ParentPage',
                'LinkLimit',
                'LinkList'
            )
        );

        $fields->addFieldsToTab(
            'Root.Main',
            array(
                TextareaField::create(
                    'Title'
                )->setRows(1),
                DropdownField::create(
                    'LinkType',
                    'Type',
                    array(
                        "currentchildren" => "List all sub pages of this page",
                        "children" => "Specify a page and list all its sub pages",
                        "specify" => "Specify each link"
                    )
                ),
                DisplayLogicWrapper::create(
                    TreeDropdownField::create(
                        'ParentPageID',
                        'Select a page',
                        'SiteTree'
                    )
                )->displayIf("LinkType")->isEqualTo("children")->end(),
                DisplayLogicWrapper::create(
                    NumericField::create(
                        'LinkLimit',
                        'Limit links'
                    )
                    ->setDescription("0 equals unlimited amount.")
                )->displayIf("LinkType")->isNotEqualTo("specify")->end(),
                DisplayLogicWrapper::create(
                    GridField::create(
                        'LinkList',
                        'Current Link(s)',
                        $this->LinkList(),
                        $TeaserConfig
                    )
                )->displayIf("LinkType")->isEqualTo("specify")->end()
            )
        );

        $this->extend('updateCMSFields', $fields);

        return $fields;
    }
794122
public function getCMSFields()
    {
        // Obtain Field Objects (from parent):
        
        $fields = parent::getCMSFields();
        
        // Create Style Fields:
        
        $fields->addFieldToTab(
            'Root.Style',
            FieldSection::create(
                'SharingStyle',
                $this->fieldLabel('SharingStyle'),
                [
                    DropdownField::create(
                        'ButtonLayout',
                        $this->fieldLabel('ButtonLayout'),
                        $this->getButtonLayoutOptions()
                    )
                ]
            )
        );
        
        // Answer Field Objects:
        
        return $fields;
    }
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;
    }
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;
    }
759308
public function getCMSFields()
    {
        $fields = parent::getCMSFields();
        $fields->addFieldsToTab(
            "Root.Main",
            array(
                DropdownField::create(
                    'ShowHome',
                    'Show home',
                    array(
                        "1" => "Yes",
                        "0" => "No"
                    ),
                    1
                )
            )
        );

        $this->extend('updateCMSFields', $fields);

        return $fields;
    }
407733
public function getCMSFields()
    {
        $fields = parent::getCMSFields();
        $fields->addFieldsToTab(
            "Root.Main",
            array(
                UploadField::create(
                    'Image'
                )->setFolderName('Person'),
                TextField::create(
                    'Name'
                ),
                TextField::create(
                    'Title'
                ),
                TextField::create(
                    'Email'
                ),
                TextField::create(
                    'Phone'
                ),
                TextField::create(
                    'Mobile'
                ),
                HTMLEditorField::create(
                    'Description'
                ),
            )
        );
        $this->extend('updateCMSFields', $fields);
        return $fields;
    }
1139916
public function getFieldsUsed(): array
    {
        $fields = [];

        /** @var Field $node */
        foreach ($this->getNodesOfType(Field::NODE_TYPE) as $node) {
            $fields[$node->getName()] = true;
        }

        return array_keys($fields);
    }
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;
    }