1 filter.api.php hook_editor_EDITOR_js_settings($format, $filters, $existing_settings)

JavaScript settings callback for hook_editor_info().

Note: This is not really a hook. The function name is manually specified via 'js settings callback' in hook_editor_info(), with this recommended callback name pattern. It is called from filter_get_js_settings().

Most editors use JavaScript to provide a WYSIWYG or toolbar on the client side interface. This callback can be used to convert internal settings of the editor into JavaScript variables that will be accessible when the editor is loaded.

Parameters

$format: The format object on which this editor will be used.

$filters: The complete list of filter objects that are enabled for the given format.

$existing_settings: The existing settings that have so far been added to the page, including all settings by individual filters. The existing settings added by filters can be used to adjust the editor-specific settings.

Return value

An array of settings that will be added to the page for use by this: editor's JavaScript integration.

File

core/modules/filter/filter.api.php, line 573
Hooks provided by the Filter module.

Code

function hook_editor_EDITOR_js_settings($format, $filters, $existing_settings) {
  return array(
    'toolbar' => $format->settings['enable_toolbar'],
    'buttons' => $format->settings['buttons'],
    'resizeable' => $format->settings['resizeable'],
  );
}