form->getActions('bottom'); $top = $this->form->getActions('top'); $edit = \tao_helpers_form_FormFactory::getElement('edit', 'Free'); $value = $edit ? $this->getReplaceAssetButtonTemplate() : ''; $edit->setValue($value); $top[] = $edit; $bottom[] = $edit; $this->form->setActions($bottom, 'bottom'); $this->form->setActions($top, 'top'); } private function isEnabled(): bool { return empty($this->options[self::IS_DISABLED] ?? false); } private function isReplaceEnabled(): bool { return empty($this->options[self::IS_REPLACE_ASSET_DISABLED] ?? false); } private function getReplaceAssetButtonTemplate(): string { return sprintf( '', ($this->isReplaceEnabled() ? '' : 'disabled="disabled" '), $this->getClazz()->getUri(), $this->getInstance()->getUri(), __('Replace Asset') ); } }