You are here

function _wysiwyg_ckeditor_plugin_meta in Wysiwyg 6.2

Same name and namespace in other branches
  1. 7.2 editors/ckeditor.inc \_wysiwyg_ckeditor_plugin_meta()

Build a JS settings array with global metadata for native external plugins.

1 string reference to '_wysiwyg_ckeditor_plugin_meta'
wysiwyg_ckeditor_editor in editors/ckeditor.inc
Plugin implementation of hook_editor().

File

editors/ckeditor.inc, line 710
Editor integration functions for CKEditor.

Code

function _wysiwyg_ckeditor_plugin_meta($editor, $plugin) {
  $meta = array();
  $name = $plugin['name'];

  // Register all plugins that need to be loaded.
  if (!empty($plugin['load'])) {

    // Add path for native external plugins.
    if (empty($plugin['internal']) && isset($plugin['path'])) {
      $meta['path'] = base_path() . $plugin['path'] . '/';
    }
    else {
      $meta['path'] = base_path() . $editor['library path'] . '/plugins/' . $name . '/';
    }

    // CKEditor defaults to 'plugin.js' on its own when filename is not set.
    if (!empty($plugin['filename'])) {
      $meta['fileName'] = $plugin['filename'];
    }
  }
  return $meta;
}