mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge pull request #7099 from open-sausages/pulls/4.0/thats-a-wrap
Update TinyMCEConfig to use theme CSS
This commit is contained in:
commit
40f8b04501
@ -51,6 +51,14 @@ abstract class HTMLEditorConfig
|
|||||||
*/
|
*/
|
||||||
private static $default_config = 'default';
|
private static $default_config = 'default';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of themes defined for the frontend
|
||||||
|
*
|
||||||
|
* @config
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
private static $user_themes = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the HTMLEditorConfig object for the given identifier. This is a correct way to get an HTMLEditorConfig
|
* Get the HTMLEditorConfig object for the given identifier. This is a correct way to get an HTMLEditorConfig
|
||||||
* instance - do not call 'new'
|
* instance - do not call 'new'
|
||||||
@ -103,7 +111,7 @@ abstract class HTMLEditorConfig
|
|||||||
*/
|
*/
|
||||||
public static function get_active_identifier()
|
public static function get_active_identifier()
|
||||||
{
|
{
|
||||||
$identifier = self::$current ?: static::config()->default_config;
|
$identifier = self::$current ?: static::config()->get('default_config');
|
||||||
return $identifier;
|
return $identifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -618,7 +618,8 @@ class TinyMCEConfig extends HTMLEditorConfig
|
|||||||
$editor[] = $this->getAdminModule()->getResourceURL('client/dist/styles/editor.css');
|
$editor[] = $this->getAdminModule()->getResourceURL('client/dist/styles/editor.css');
|
||||||
|
|
||||||
// Themed editor.css
|
// Themed editor.css
|
||||||
$themedEditor = ThemeResourceLoader::inst()->findThemedCSS('editor', SSViewer::get_themes());
|
$themes = $this->config()->get('user_themes') ?: SSViewer::get_themes();
|
||||||
|
$themedEditor = ThemeResourceLoader::inst()->findThemedCSS('editor', $themes);
|
||||||
if ($themedEditor) {
|
if ($themedEditor) {
|
||||||
$editor[] = Director::absoluteURL($themedEditor, Director::BASE);
|
$editor[] = Director::absoluteURL($themedEditor, Director::BASE);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user