NEW Make default TinyMCE settings configurable

This commit is contained in:
Guy Sartorelli 2024-04-18 14:38:26 +12:00
parent 2bdc24c86a
commit 72692f9f10
No known key found for this signature in database
GPG Key ID: F313E3B9504D496A

View File

@ -250,13 +250,11 @@ class TinyMCEConfig extends HTMLEditorConfig implements i18nEntityProvider
private static $image_size_presets = [ ]; private static $image_size_presets = [ ];
/** /**
* TinyMCE JS settings * Default TinyMCE JS options which apply to all new configurations.
* *
* @link https://www.tiny.cloud/docs/tinymce/6/tinydrive-getting-started/#configure-the-required-tinymce-options * @link https://www.tiny.cloud/docs/tinymce/6/tinydrive-getting-started/#configure-the-required-tinymce-options
*
* @var array
*/ */
protected $settings = [ private static array $default_options = [
'fix_list_elements' => true, // https://www.tiny.cloud/docs/tinymce/6/content-filtering/#fix_list_elements 'fix_list_elements' => true, // https://www.tiny.cloud/docs/tinymce/6/content-filtering/#fix_list_elements
'formats' => [ 'formats' => [
'alignleft' => [ 'alignleft' => [
@ -327,6 +325,8 @@ class TinyMCEConfig extends HTMLEditorConfig implements i18nEntityProvider
. "dd[id|class|title|dir],dl[id|class|title|dir],dt[id|class|title|dir]," . "dd[id|class|title|dir],dl[id|class|title|dir],dt[id|class|title|dir],"
]; ];
protected $settings = [];
/** /**
* Holder list of enabled plugins * Holder list of enabled plugins
* *
@ -351,6 +351,11 @@ class TinyMCEConfig extends HTMLEditorConfig implements i18nEntityProvider
*/ */
protected $theme = 'silver'; protected $theme = 'silver';
public function __construct()
{
$this->settings = static::config()->get('default_options');
}
/** /**
* Get the theme * Get the theme
* *