Get form fields for create new embed

@return FieldList
506007
protected function getCreateFormFields()
    {
        return FieldList::create([
            TextField::create(
                'Url',
                'Embed URL'
            )
                ->setInputType('url')
                ->addExtraClass('insert-embed-modal__url-create')
                ->setDescription(_t(
                    __CLASS__.'.UrlDescription',
                    'Embed Youtube and Vimeo videos, images and other media directly from the web.'
                )),
        ]);
    }
1364007
public function VisibleFields()
    {
        $visibleFields = new FieldList();

        foreach ($this as $field) {
            if (!($field instanceof HiddenField)) {
                $visibleFields->push($field);
            }
        }

        return $visibleFields;
    }
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;
    }
1164776
public function getFields() {
        if($this->cachedFields == null) {
            $this->cachedFields = $this->createFields();
        }

        return $this->cachedFields;
    }
119018
public function getCMSFields()
    {
        // Obtain Field Objects (from parent):
        
        $fields = parent::getCMSFields();
        
        // Create Main Fields:
        
        $fields->addFieldsToTab(
            'Root.Main',
            [
                $image = UploadField::create(
                    'Image',
                    $this->fieldLabel('Image')
                ),
                HTMLEditorField::create(
                    'Caption',
                    $this->fieldLabel('Caption')
                )->setRows(10),
                TextField::create(
                    'ImageTitle',
                    $this->fieldLabel('ImageTitle')
                ),
                TextField::create(
                    'ImageAlt',
                    $this->fieldLabel('ImageAlt')
                )
            ]
        );
        
        // Define Image Field:
        
        $image->setAllowedExtensions(['gif', 'jpg', 'jpeg', 'png', 'svg']);
        $image->setFolderName($this->getAssetFolder());
        
        // Create Options Fields:
        
        $fields->addFieldToTab(
            'Root.Options',
            FieldSection::create(
                'ImageOptions',
                $this->fieldLabel('ImageOptions'),
                [
                    CheckboxField::create(
                        'LinkImage',
                        $this->fieldLabel('LinkImage')
                    ),
                    CheckboxField::create(
                        'HideCaption',
                        $this->fieldLabel('HideCaption')
                    ),
                    CheckboxField::create(
                        'InlineVector',
                        $this->fieldLabel('InlineVector')
                    )
                ]
            )
        );
        
        // Answer Field Objects:
        
        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;
    }
701721
public function getCMSFields()
    {
        $fields = parent::getCMSFields();
        $fields->addFieldsToTab(
            "Root.Main",
            array(
                DropdownField::create(
                    'FormPageID',
                    'Select a page',
                    UserDefinedForm::get()->map('ID', 'Title')
                )
            )
        );

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

        return $fields;
    }
693199
public function getCMSFields()
    {
        // Obtain Field Objects (from parent):
        
        $fields = parent::getCMSFields();
        
        // Insert Image Tab:
        
        $fields->insertAfter(
            Tab::create(
                'Image',
                $this->fieldLabel('Image')
            ),
            'Main'
        );
        
        // Create Image Fields:
        
        $fields->addFieldsToTab(
            'Root.Image',
            [
                FieldSection::create(
                    'LinkImage',
                    $this->fieldLabel('LinkImage'),
                    [
                        $image = UploadField::create(
                            'LinkImage',
                            $this->fieldLabel('LinkImageFile')
                        ),
                        ViewportsField::create(
                            'LinkImageWidth',
                            $this->fieldLabel('LinkImageWidth')
                        )->setUseTextInput(true),
                        ViewportsField::create(
                            'LinkImageHeight',
                            $this->fieldLabel('LinkImageHeight')
                        )->setUseTextInput(true),
                        CheckboxField::create(
                            'InlineVector',
                            $this->fieldLabel('InlineVector')
                        )
                    ]
                )
            ]
        );
        
        // Define Image Field:
        
        $image->setAllowedExtensions(['gif', 'jpg', 'jpeg', 'png', 'svg']);
        $image->setFolderName($this->getAssetFolder());
        
        // Answer Field Objects:
        
        return $fields;
    }
1260374
public function getFieldsMap() {

		$formFields = $this->fields;
		$fieldsMap	= [];

		foreach( $formFields as $formField ) {

			$fieldsMap[ $formField->name ] = $formField;
		}

		return $fieldsMap;
	}
629208
protected function getEditFormFields($context)
    {
        // Check if the url is valid
        $url = (isset($context['url'])) ? $context['url'] : null;
        if (empty($url)) {
            return $this->getCreateFormFields();
        }

        $url = trim($url);

        // Get embed
        $this->validateUrl($url);

        /** @var Embeddable $embed */
        $embed = Injector::inst()->create(Embeddable::class, $url);
        $this->validateEmbed($embed);

        // Build form
        $alignments = array(
            'leftAlone' => _t('SilverStripe\\AssetAdmin\\Controller\\AssetAdmin.AlignmentLeftAlone', 'Left'),
            'center' => _t('SilverStripe\\AssetAdmin\\Controller\\AssetAdmin.AlignmentCenter', 'Center'),
            'rightAlone' => _t('SilverStripe\\AssetAdmin\\Controller\\AssetAdmin.AlignmentRightAlone', 'Right'),
            'left' => _t('SilverStripe\\AssetAdmin\\Controller\\AssetAdmin.AlignmentLeft', 'Left wrap'),
            'right' => _t('SilverStripe\\AssetAdmin\\Controller\\AssetAdmin.AlignmentRight', 'Right wrap'),
        );

        $width = $embed->getWidth();
        $height = $embed->getHeight();

        $fields = CompositeField::create([
            LiteralField::create(
                'Preview',
                sprintf(
                    '<img src="%s" class="%s" />',
                    $embed->getPreviewURL(),
                    'insert-embed-modal__preview'
                )
            )->addExtraClass('insert-embed-modal__preview-container'),
            HiddenField::create('PreviewUrl', 'PreviewUrl', $embed->getPreviewURL()),
            CompositeField::create([
                TextField::create('UrlPreview', $embed->getName(), $url)
                    ->setReadonly(true),
                HiddenField::create('Url', false, $url),
                TextField::create(
                    'CaptionText',
                    _t('SilverStripe\\AssetAdmin\\Controller\\AssetAdmin.Caption', 'Caption')
                ),
                OptionsetField::create(
                    'Placement',
                    _t('SilverStripe\\AssetAdmin\\Controller\\AssetAdmin.Placement', 'Placement'),
                    $alignments
                )
                    ->addExtraClass('insert-embed-modal__placement'),
                $dimensions = FieldGroup::create(
                    _t('SilverStripe\\AssetAdmin\\Controller\\AssetAdmin.ImageSpecs', 'Dimensions'),
                    TextField::create('Width', '', $width)
                        ->setRightTitle(_t(
                            'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin.ImageWidth',
                            'Width'
                        ))
                        ->setMaxLength(5)
                        ->addExtraClass('flexbox-area-grow'),
                    TextField::create('Height', '', $height)
                        ->setRightTitle(_t(
                            'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin.ImageHeight',
                            'Height'
                        ))
                        ->setMaxLength(5)
                        ->addExtraClass('flexbox-area-grow')
                )->addExtraClass('fieldgroup--fill-width')
                    ->setName('Dimensions')
            ])->addExtraClass('flexbox-area-grow'),
        ])->addExtraClass('insert-embed-modal__fields--fill-width');

        if ($dimensions && $width && $height) {
            $ratio = $width / $height;

            $dimensions->setSchemaComponent('ProportionConstraintField');
            $dimensions->setSchemaState([
                'data' => [
                    'ratio' => $ratio
                ]
            ]);
        }
        return FieldList::create($fields);
    }
368238
public function getCMSFields() {
		$fields = parent::getCMSFields();

		$fields->removeByName('Sort');
		$fields->removeByName('ParentID');
		$fields->addFieldToTab('Root.Main', new TextField('Name', _t('ExternalContentSource.NAME', 'Name')));
		$fields->addFieldToTab('Root.Main', new CheckboxField("ShowContentInMenu", _t('ExternalContentSource.SHOW_IN_MENUS', 'Show Content in Menus')));

		return $fields;
	}
692185
public function getFormFields(): array
    {
        $properties = $this->getProperties();

        $fields = array_diff($properties, ['id']);

        $fieldsWithTypes = [];
        foreach ($fields as $field) {
            $fieldsWithTypes[$field] = null;
        }

        return $fieldsWithTypes;
    }
56672
public function get_form_fields() {
        if (empty($this->type)) {
            return '';
        }

        $result  = '<input type="hidden" name="gpr_type" value="'.$this->type.'" />';

        if (!empty($this->plugin)) {
            $result .= '<input type="hidden" name="gpr_plugin" value="'.$this->plugin.'" />';
        }

        if (!empty($this->courseid)) {
            $result .= '<input type="hidden" name="gpr_courseid" value="'.$this->courseid.'" />';
        }

        if (!empty($this->userid)) {
            $result .= '<input type="hidden" name="gpr_userid" value="'.$this->userid.'" />';
        }

        if (!empty($this->groupid)) {
            $result .= '<input type="hidden" name="gpr_groupid" value="'.$this->groupid.'" />';
        }

        if (!empty($this->page)) {
            $result .= '<input type="hidden" name="gpr_page" value="'.$this->page.'" />';
        }
        return $result;
    }
634727
public function HiddenFields()
    {
        $hiddenFields = new FieldList();
        $dataFields = $this->dataFields();

        if ($dataFields) {
            foreach ($dataFields as $field) {
                if ($field instanceof HiddenField) {
                    $hiddenFields->push($field);
                }
            }
        }

        return $hiddenFields;
    }
365791
public function getFields()
    {
        $model = $this->getModelInstance();
        $fields = $model->getFillable();
        $filtered_fields = [];

        foreach ($fields as $f) {
            if ($f !== 'password' && $f !== 'Password') {
                $filtered_fields[] = $f;
            }
        }

        return $filtered_fields;
    }
1289530
public function getCMSFields() {
        $fields=new FieldList(
                            new TabSet('Root',
                                    new Tab('Main', _t('KapostObject.MAIN', '_Main'),
                                        new ReadonlyField('Created', $this->fieldLabel('Created')),
                                        new ReadonlyField('KapostChangeTypeNice', $this->fieldLabel('KapostChangeType')),
                                        new ReadonlyField('KapostAuthor', $this->fieldLabel('KapostAuthor')),
                                        new ReadonlyField('ToPublishNice', $this->fieldLabel('ToPublish')),
                                        new ReadonlyField('ClassNameNice', _t('KapostObject.CONTENT_TYPE', '_Content Type')),
                                        new ReadonlyField('Title', $this->fieldLabel('Title')),
                                        HtmlEditorField_Readonly::create('ContentNice', $this->fieldLabel('Content'), $this->sanitizeHTML($this->Content))
                                    )
                                )
                        );
        
        
        //Allow extensions to adjust the fields
        $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;
    }