\CustomHtmlEditorConfig
A PHP version of TinyMCE's configuration, to allow various parameters to be configured on a site or section basis
There can be multiple HtmlEditorConfig's, which should always be created / accessed using HtmlEditorConfig::get.
You can then set the currently active config using set_active. Whichever config is active when
HtmlEditorField#Field is called wins.
- Author: "Hamish Friedlander" <hamish@silverstripe.com>
Synopsis
class CustomHtmlEditorConfig
{
- // members
- private static array $configs = ;
- private static $current = NULL;
- protected array $settings = ;
- protected array $plugins = ;
- protected array $buttons = ;
- // methods
- public static HtmlEditorConfig get()
- public static null set_active()
- public static String get_active_identifier()
- public static HtmlEditorConfig get_active()
- public static array get_available_configs_map()
- public mixed getOption()
- public mixed setOption()
- public null setOptions()
- public null enablePlugins()
- public null disablePlugins()
- public Array getPlugins()
- public null setButtonsForLine()
- public null addButtonsToLine()
- protected boolean modifyButtons()
- public boolean insertButtonsBefore()
- public boolean insertButtonsAfter()
- public null removeButtons()
- public static void require_js()
Members
private
- $configs
- $current
protected
-
$plugins
Holder list of enabled plugins -
$settings
Holder for all TinyMCE settings _except_ plugins and buttons
Methods
protected
- modifyButtons() — Internal function for adding and removing buttons related to another button
public
- addButtonsToLine() — Add buttons to the end of a line
- disablePlugins() — Enable one or several plugins. Will properly handle being passed a plugin that is already disabled
- enablePlugins() — Enable one or several plugins. Will maintain unique list if already enabled plugin is re-passed. If passed in as a map of plugin-name to path, the plugin will be loaded by tinymce.PluginManager.load() instead of through tinyMCE.init().
- get() — Get the HtmlEditorConfig object for the given identifier. This is a correct way to get an HtmlEditorConfig instance - do not call 'new'
- getOption() — Get the current value of an option
- getPlugins()
- get_active() — Get the currently active configuration object
- get_active_identifier() — Get the currently active configuration identifier
- get_available_configs_map() — Get the available configurations as a map of friendly_name to configuration name.
- insertButtonsAfter() — Insert buttons after the first occurance of another button
- insertButtonsBefore() — Insert buttons before the first occurance of another button
- removeButtons() — Remove the first occurance of buttons
- require_js() — Generate the JavaScript that will set TinyMCE's configuration: - Parse all configurations into JSON objects to be used in JavaScript - Includes TinyMCE and configurations using the {@link Requirements} system
- setButtonsForLine() — Totally re-set the buttons on a given line
- setOption() — Set the value of one option
- setOptions() — Set multiple options
- set_active() — Set the currently active configuration object