Fix change titles to return schema values in schema

Enhancement Add EditorExternalLink call for toolbar
This commit is contained in:
Christopher Joe 2017-04-20 12:08:46 +12:00 committed by Sam Minnée
parent 4af71b9ed7
commit 403f4db14d
2 changed files with 22 additions and 4 deletions

View File

@ -1534,12 +1534,12 @@ class FormField extends RequestHandler
'schemaType' => $this->getSchemaDataType(),
'component' => $this->getSchemaComponent(),
'holderId' => $this->HolderID(),
'title' => $this->Title(),
'title' => $this->obj('Title')->getSchemaValue(),
'source' => null,
'extraClass' => $this->extraClass(),
'description' => $this->obj('Description')->getSchemaValue(),
'rightTitle' => $this->RightTitle(),
'leftTitle' => $this->LeftTitle(),
'rightTitle' => $this->obj('RightTitle')->getSchemaValue(),
'leftTitle' => $this->obj('LeftTitle')->getSchemaValue(),
'readOnly' => $this->isReadonly(),
'disabled' => $this->isDisabled(),
'customValidationMessage' => $this->getCustomValidationMessage(),

View File

@ -2,6 +2,7 @@
namespace SilverStripe\Forms\HTMLEditor;
use SilverStripe\Admin\Forms\EditorExternalLinkFormFactory;
use SilverStripe\Assets\File;
use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\Control\Controller;
@ -9,6 +10,7 @@ use SilverStripe\Control\Director;
use SilverStripe\Control\RequestHandler;
use SilverStripe\Control\HTTPRequest;
use SilverStripe\Control\HTTPResponse_Exception;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Forms\CheckboxField;
use SilverStripe\Forms\CompositeField;
use SilverStripe\Forms\EmailField;
@ -33,6 +35,7 @@ class HTMLEditorField_Toolbar extends RequestHandler
private static $allowed_actions = array(
'LinkForm',
'EditorExternalLink',
'viewfile',
'getanchors'
);
@ -180,7 +183,22 @@ class HTMLEditorField_Toolbar extends RequestHandler
return $form;
}
/**
* Builds and returns the external link form
*
* @return null|Form
*/
public function EditorExternalLink()
{
/** @var EditorExternalLinkFormFactory $factory */
$factory = Injector::inst()->get(EditorExternalLinkFormFactory::class);
if ($factory) {
return $factory->getForm($this->controller, "{$this->name}/EditorExternalLink");
}
return null;
}
/**
* Get the folder ID to filter files by for the "from cms" tab
*