Returns an inplace editable element with the model's name.

@return \core\output\inplace_editable
14464
public function inplace_editable_name() {

        $displayname = format_string($this->get_name());

        return new \core\output\inplace_editable('core_analytics', 'modelname', $this->model->id,
            has_capability('moodle/analytics:managemodels', \context_system::instance()), $displayname, $this->model->name);
    }
398393
public function getInheritedElement()
    {
        /** @var ClassDescriptor|InterfaceDescriptor|null $associatedClass */
        $associatedClass = $this->getParent();

        if (($associatedClass instanceof ClassDescriptor || $associatedClass instanceof InterfaceDescriptor)
            && ($associatedClass->getParent() instanceof ClassDescriptor
                || $associatedClass->getParent() instanceof InterfaceDescriptor
            )
        ) {
            /** @var ClassDescriptor|InterfaceDescriptor $parentClass */
            $parentClass = $associatedClass->getParent();

            return $parentClass->getProperties()->get($this->getName());
        }

        return null;
    }
979262
protected function getEditPath()
    {
        $key = $this->panel->getParent()->getModel()->getKey();

        return $this->getListPath().'/'.$key.'/edit';
    }
752294
public function getEditForm()
    {
        if (null === $this->editForm) {
            $this->setEditForm($this->getServiceLocator()->get('dlccategory_editcategory_form'));
        }
        return $this->editForm;
    }
78649
public function getForeignModel()
    {
        $model = $this->getFullForeignModel();

        if ($this->isModel($model)) {
            return class_basename($model);
        }

        $position = strrpos($model, '\\');

        if ($position !== false) {
            return substr($model, $position + 1);
        }

        return '';
    }
959360
protected function scaffoldForm()
    {
        $editable = new Mutable();

        if ($eloquent = $this->model()) {
            $editable = $editable
                ->merge($translatable = $this->scaffoldTranslatable($eloquent))
                ->merge($eloquent->getFillable());

            return $editable->map(function ($name) use ($eloquent, $translatable) {
                $formElement = InputFactory::make(
                    $name,
                    $this->inputType($name, $eloquent)
                );

                if (in_array($name, $translatable, true)) {
                    $formElement->setTranslatable(true);
                }

                // For Enums (Select|Radio) try to extract values from database.
                if (is_a($formElement, Select::class)
                    && empty($formElement->getOptions())
                    && connection('mysql')
                ) {
                    $formElement->setOptions(
                        $values = enum_values($table = $eloquent->getTable(), $name)
                    );

                    // set appropriate styling
                    if (count($values) > 5) {
                        $formElement->setStyle([
                            'display' => 'block',
                        ]);
                    }

                    // set default value
                    if ($default = scheme()->columns($table)[$name]->getDefault()) {
                        $formElement->setValue($default);
                    }
                }

                $container = new FormElement($name);

                return $container->setInput($formElement);
            });
        }

        return $editable;
    }
825130
public function getPlaceholder(): Placeholder
    {
        if ($this->placeholderInstance === null) {
            $this->placeholderInstance = new Placeholder();
        }

        return $this->placeholderInstance;
    }
60131
public function editaddress()
    {
        $member = Security::getCurrentUser();
        $id = $this->getOwner()->request->param("ID");
        $address = ContactLocation::get()->byID($id);

        if ($address && $address->canEdit($member)) {
            $form = $this->AddressForm();
            $form->loadDataFrom($address);
            $form
                ->Actions()
                ->dataFieldByName("action_doSaveAddress")
                ->setTitle(_t("SilverCommerce\ContactAdmin.Save", "Save"));

            $this
                ->getOwner()
                ->customise([
                    "Title" => _t(
                        "SilverCommerce\ContactAdmin.EditAddress",
                        "Edit Address"
                    ),
                    "MenuTitle" => _t(
                        "SilverCommerce\ContactAdmin.EditAddress",
                        "Edit Address"
                    ),
                    "Form" => $form
                ]);

            $this->getOwner()->extend("updateEditAddress");
            
            return $this
                ->getOwner()
                ->renderWith([
                    'AccountController_editaddress',
                    AccountController::class . '_editaddress',
                    'AccountController',
                    AccountController::class,
                    'Page'
                ]);
        } else {
            return $this->getOwner()->httpError(404);
        }
    }
1273784
private function getEditableProperties()
    {
        if (!isset($this->_editableProperties)) {
            $reflection = new ReflectionClass('WhEditableField');
            $this->_editableProperties = array_map(
                function ($d) {
                    return $d->getName();
                },
                $reflection->getProperties()
            );
        }
        return $this->_editableProperties;
    }
938360
public function getLayoutPlaceHolderNames()
	{
		$layout = $this->getLayout();

		if ($layout === null) {
			return null;
		}

		return $this->getLayoutProcessor()
				->getPlaces($layout->getFileName());
	}
1107270
public function getFormElements()
    {
        $sm = $this->getServiceLocator();
        $formElements = array();
        $placeholders = $this->getPlaceholderParameters();
        $replacePlaceholderWithValues = array();
        foreach ($this->formElements as $element) {
            // Remove form element if it is available in the remove list
            if (in_array($element['name'], $this->removeElements)) {
                continue;
            }
            $formElement = $this->formatFormElement($element);
            // Replace placeholder with default values
            $replacePlaceholderWithValues = $sm->get($this->moduleService)->defaultConfig('placeholder');
            // Replace placeholder with global form values
            if (!empty($placeholders) && is_array($placeholders)) {
                // Replace placeholder with global values
                if (array_key_exists('global', $placeholders) &&  !empty($placeholders['global']) &&  is_array($placeholders['global'])) {
                    $replacePlaceholderWithValues = array_merge($replacePlaceholderWithValues, $placeholders['global']);
                }
                // Replace placeholder with element form values
                if (array_key_exists('element', $placeholders) &&  !empty($placeholders['element']) &&  is_array($placeholders['element'])) {
                    if (array_key_exists($element['name'], $placeholders['element'])) {
                        $replacePlaceholderWithValues = array_merge($replacePlaceholderWithValues, $placeholders['element'][$element['name']]);
                    }
                }
            }
            $formElement = $this->searchAndReplacePlaceHolders($formElement, $replacePlaceholderWithValues);
            $formElements[] = $formElement;
        }
        return $formElements;
    }
999766
public static function update_inplace_editable_returns() {
        return new external_single_structure(
            array(
                'displayvalue' => new external_value(PARAM_RAW, 'display value (may contain link or other html tags)'),
                'component' => new external_value(PARAM_NOTAGS, 'component responsible for the update', VALUE_OPTIONAL),
                'itemtype' => new external_value(PARAM_NOTAGS, 'itemtype', VALUE_OPTIONAL),
                'value' => new external_value(PARAM_RAW, 'value of the item as it is stored', VALUE_OPTIONAL),
                'itemid' => new external_value(PARAM_RAW, 'identifier of the updated item', VALUE_OPTIONAL),
                'edithint' => new external_value(PARAM_NOTAGS, 'hint for editing element', VALUE_OPTIONAL),
                'editlabel' => new external_value(PARAM_NOTAGS, 'label for editing element', VALUE_OPTIONAL),
                'type' => new external_value(PARAM_ALPHA, 'type of the element (text, toggle, select)', VALUE_OPTIONAL),
                'options' => new external_value(PARAM_RAW, 'options of the element, format depends on type', VALUE_OPTIONAL),
                'linkeverything' => new external_value(PARAM_INT, 'Should everything be wrapped in the edit link or link displayed separately', VALUE_OPTIONAL),
            )
        );
    }
1349842
public function getHtmlEditorConfigForCMS()
    {
        $currentName = '';
        $currentPriority = 0;

        foreach ($this->Groups() as $group) {
            $configName = $group->HtmlEditorConfig;
            if ($configName) {
                $config = HTMLEditorConfig::get($group->HtmlEditorConfig);
                if ($config && $config->getOption('priority') > $currentPriority) {
                    $currentName = $configName;
                    $currentPriority = $config->getOption('priority');
                }
            }
        }

        // If can't find a suitable editor, just default to cms
        return $currentName ? $currentName : 'cms';
    }
1236104
public function forTemplate()
    {
        $value = parent::forTemplate();
        if (FrontendEditing::editingEnabled() && FrontendEditing::isEditable($this)) {
            $value = '<span class="frontend-editable frontend-editable-varchar" data-feclass="'.FrontendEditing::getClassName($this).'" data-feid="'.FrontendEditing::getID($this).'" data-fefield="'.$this->name.'">'.$value.'</span>';
        }
        return $value;
    }
479688
public function getFieldEditorGrid()
    {
        Requirements::javascript('silverstripe/userforms:client/dist/js/userforms-cms.js');

        $fields = $this->owner->Fields();

        $this->createInitialFormStep(true);

        $editableColumns = new GridFieldEditableColumns();
        $fieldClasses = singleton(EditableFormField::class)->getEditableFieldClasses();
        $editableColumns->setDisplayFields([
            'ClassName' => function ($record, $column, $grid) use ($fieldClasses) {
                if ($record instanceof EditableFormField) {
                    return $record->getInlineClassnameField($column, $fieldClasses);
                }
            },
            'Title' => function ($record, $column, $grid) {
                if ($record instanceof EditableFormField) {
                    return $record->getInlineTitleField($column);
                }
            }
        ]);

        $config = GridFieldConfig::create()
            ->addComponents(
                $editableColumns,
                new GridFieldButtonRow(),
                (new GridFieldAddClassesButton(EditableTextField::class))
                    ->setButtonName(_t(__CLASS__.'.ADD_FIELD', 'Add Field'))
                    ->setButtonClass('btn-primary'),
                (new GridFieldAddClassesButton(EditableFormStep::class))
                    ->setButtonName(_t(__CLASS__.'.ADD_PAGE_BREAK', 'Add Page Break'))
                    ->setButtonClass('btn-secondary'),
                (new GridFieldAddClassesButton([EditableFieldGroup::class, EditableFieldGroupEnd::class]))
                    ->setButtonName(_t(__CLASS__.'.ADD_FIELD_GROUP', 'Add Field Group'))
                    ->setButtonClass('btn-secondary'),
                $editButton = new GridFieldEditButton(),
                new GridFieldDeleteAction(),
                new GridFieldToolbarHeader(),
                new GridFieldOrderableRows('Sort'),
                new GridFieldDetailForm()
            );

        $editButton->removeExtraClass('grid-field__icon-action--hidden-on-hover');

        $fieldEditor = GridField::create(
            'Fields',
            '',
            $fields,
            $config
        )->addExtraClass('uf-field-editor');

        return $fieldEditor;
    }
807779
public function getReplace()
    {
        return [
            'iblockId' => $this->fields['IBLOCK_ID'],
            'code'     => "'".$this->fields['FIELD_NAME']."'",
            'entity'   => "'".$this->fields['ENTITY_ID']."'",
            'fields'   => var_export($this->fields, true),
        ];
    }
266370
public function getEditable($is_create = true)
    {
        return
            (
                $this->getParent()->getEditable() ||
                $this->getParent()->getRequired()
            ) &&
            ! $this->getField()->getCalculated() &&
            ! $this->getField()->getAutoNumber() &&
            (
                $is_create && $this->getField()->getCreateable() ||
                ! $is_create && $this->getField()->getUpdateable()
            )
        ;
    }