You are here

function footnotes_wysiwyg_wysiwyg_plugin in Footnotes 7.3

Same name and namespace in other branches
  1. 6.2 footnotes_wysiwyg/footnotes_wysiwyg.module \footnotes_wysiwyg_wysiwyg_plugin()
  2. 7.2 footnotes_wysiwyg/footnotes_wysiwyg.module \footnotes_wysiwyg_wysiwyg_plugin()

Implementation of hook_wysiwyg_plugin().

File

footnotes_wysiwyg/footnotes_wysiwyg.module, line 13
WYSIWYG support for the footnotes module. Currently this supports TinyMCE and CKEditor via the WYSIWYG module and CKEditor via the CKEditor module.

Code

function footnotes_wysiwyg_wysiwyg_plugin($editor, $version) {
  $plugin = array(
    'footnotes' => array(
      'buttons' => array(
        'footnotes' => t('Add Footnote'),
      ),
      'basePath' => base_path(),
      // This is required to auto-load the plugin.
      'load' => TRUE,
    ),
  );
  switch ($editor) {
    case 'tinymce':
      $plugin['footnotes']['filename'] = 'editor_plugin.js';
      $plugin['footnotes']['path'] = drupal_get_path('module', 'footnotes_wysiwyg') . '/tinymce_plugin/';
      $plugin['footnotes']['extended_valid_elements'] = array(
        'fn',
      );
      return $plugin;
    case 'ckeditor':

      // For CKEditor, path is the directory and the .js file must be called 'plugin.js'.
      $plugin['footnotes']['path'] = drupal_get_path('module', 'footnotes_wysiwyg') . '/ckeditor_plugin/';
      return $plugin;
  }
}