mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-29 12:49:06 +02:00
Update TinyMCEConfig to use theme CSS
This commit is contained in:
parent
c69a565b08
commit
cddaaf1444
@ -51,6 +51,11 @@ abstract class HTMLEditorConfig
|
||||
*/
|
||||
private static $default_config = 'default';
|
||||
|
||||
/**
|
||||
* @var List of themes defined for the frontend
|
||||
*/
|
||||
private static $user_themes = [];
|
||||
|
||||
/**
|
||||
* Get the HTMLEditorConfig object for the given identifier. This is a correct way to get an HTMLEditorConfig
|
||||
* instance - do not call 'new'
|
||||
@ -147,6 +152,15 @@ abstract class HTMLEditorConfig
|
||||
return $configs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set user defined (non-admin) themes
|
||||
* @param array $themes
|
||||
*/
|
||||
public static function set_user_themes($themes)
|
||||
{
|
||||
self::config()->set('user_themes', $themes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current value of an option
|
||||
*
|
||||
|
@ -616,9 +616,8 @@ class TinyMCEConfig extends HTMLEditorConfig
|
||||
|
||||
// Add standard editor.css
|
||||
$editor[] = $this->getAdminModule()->getResourceURL('client/dist/styles/editor.css');
|
||||
|
||||
// Themed editor.css
|
||||
$themedEditor = ThemeResourceLoader::inst()->findThemedCSS('editor', SSViewer::get_themes());
|
||||
$themedEditor = ThemeResourceLoader::inst()->findThemedCSS('editor', $this->config()->user_themes);
|
||||
if ($themedEditor) {
|
||||
$editor[] = Director::absoluteURL($themedEditor, Director::BASE);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user