You are here

function wysiwyg_tinymce_plugin_settings in Wysiwyg 5.2

Same name and namespace in other branches
  1. 5 editors/tinymce.inc \wysiwyg_tinymce_plugin_settings()
  2. 6 editors/tinymce.inc \wysiwyg_tinymce_plugin_settings()

Build a JS settings array of native external plugins that need to be loaded separately.

TinyMCE requires that external plugins (i.e. not residing in the editor's directory) are loaded (once) upon initializing the editor.

1 string reference to 'wysiwyg_tinymce_plugin_settings'
wysiwyg_tinymce_editor in editors/tinymce.inc
Plugin implementation of hook_editor().

File

editors/tinymce.inc, line 311
Editor integration functions for TinyMCE.

Code

function wysiwyg_tinymce_plugin_settings($editor, $profile, $plugins) {
  $settings = array();
  foreach ($plugins as $name => $plugin) {
    if (!empty($plugin['load'])) {

      // Add path for native external plugins; internal ones are loaded
      // automatically.
      if (empty($plugin['internal']) && isset($plugin['path'])) {
        $settings[$name] = base_path() . $plugin['path'];
      }
    }
  }
  return $settings;
}