diff --git a/src/Forms/HTMLEditor/HTMLEditorConfig.php b/src/Forms/HTMLEditor/HTMLEditorConfig.php
index df863b78b..35508d4b6 100644
--- a/src/Forms/HTMLEditor/HTMLEditorConfig.php
+++ b/src/Forms/HTMLEditor/HTMLEditorConfig.php
@@ -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
*
diff --git a/src/Forms/HTMLEditor/TinyMCEConfig.php b/src/Forms/HTMLEditor/TinyMCEConfig.php
index 79189c8ba..c62a5adb4 100644
--- a/src/Forms/HTMLEditor/TinyMCEConfig.php
+++ b/src/Forms/HTMLEditor/TinyMCEConfig.php
@@ -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);
}