footnotes_wysiwyg.module

  1. cis7 sites/all/modules/ulmus/footnotes/footnotes_wysiwyg/footnotes_wysiwyg.module
  2. cle7 sites/all/modules/ulmus/footnotes/footnotes_wysiwyg/footnotes_wysiwyg.module
  3. ecd7 sites/all/modules/ulmus/footnotes/footnotes_wysiwyg/footnotes_wysiwyg.module
  4. elmsmedia7 sites/all/modules/ulmus/footnotes/footnotes_wysiwyg/footnotes_wysiwyg.module
  5. harmony7 sites/all/modules/ulmus/footnotes/footnotes_wysiwyg/footnotes_wysiwyg.module
  6. icor7 sites/all/modules/ulmus/footnotes/footnotes_wysiwyg/footnotes_wysiwyg.module
  7. meedjum_blog7 sites/all/modules/ulmus/footnotes/footnotes_wysiwyg/footnotes_wysiwyg.module
  8. mooc7 sites/all/modules/ulmus/footnotes/footnotes_wysiwyg/footnotes_wysiwyg.module

WYSIWYG support for the footnotes module. Currently this supports TinyMCE and CKEditor via the WYSIWYG module and CKEditor via the CKEditor module.

Functions

Namesort descending Description
footnotes_wysiwyg_ckeditor_plugin Implements hook_ckeditor_plugin().
footnotes_wysiwyg_wysiwyg_plugin Implementation of hook_wysiwyg_plugin().

File

sites/all/modules/ulmus/footnotes/footnotes_wysiwyg/footnotes_wysiwyg.module
View source
  1. <?php
  2. /**
  3. * @file
  4. * WYSIWYG support for the footnotes module.
  5. * Currently this supports TinyMCE and CKEditor via the WYSIWYG module and
  6. * CKEditor via the CKEditor module.
  7. */
  8. /**
  9. * Implementation of hook_wysiwyg_plugin().
  10. */
  11. function footnotes_wysiwyg_wysiwyg_plugin($editor, $version) {
  12. $plugin = array(
  13. 'footnotes' => array(
  14. 'buttons' => array('footnotes' => t('Add Footnote')),
  15. 'basePath' => base_path(),
  16. // This is required to auto-load the plugin.
  17. 'load' => TRUE,
  18. ),
  19. );
  20. switch ($editor) {
  21. case 'tinymce':
  22. $plugin['footnotes']['filename'] = 'editor_plugin.js';
  23. $plugin['footnotes']['path'] = drupal_get_path('module', 'footnotes_wysiwyg') . '/tinymce_plugin/';
  24. $plugin['footnotes']['extended_valid_elements'] = array('fn');
  25. return $plugin;
  26. case 'ckeditor':
  27. // For CKEditor, path is the directory and the .js file must be called 'plugin.js'.
  28. $plugin['footnotes']['path'] = drupal_get_path('module', 'footnotes_wysiwyg') . '/ckeditor_plugin/';
  29. return $plugin;
  30. }
  31. }
  32. /**
  33. * Implements hook_ckeditor_plugin().
  34. *
  35. * Register the CKEditor plugin for the CKEditor module.
  36. */
  37. function footnotes_wysiwyg_ckeditor_plugin() {
  38. return array(
  39. 'footnotes' => array(
  40. 'name' => 'footnotes',
  41. 'desc' => t('Add Footnotes'),
  42. 'path' => drupal_get_path('module', 'footnotes_wysiwyg') . '/ckeditor_plugin/',
  43. 'buttons' => array(
  44. 'footnotes' => array(
  45. 'icon' => 'images/footnotes.png',
  46. 'label' => 'Footnotes',
  47. )
  48. ),
  49. )
  50. );
  51. }