jwysiwyg.inc 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * elFinder Integration
  4. *
  5. * Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
  6. */
  7. // $Id$
  8. /**
  9. * @file
  10. * jWYSIWYG integration plugin
  11. */
  12. /**
  13. * Pseudo-hook for elfinder hook_wysiwyg_plugin implementation
  14. */
  15. function elfinder_jwysiwyg_elfinder_editor_plugin($options) {
  16. if (VERSION < 7) {
  17. if (module_exists('jquery_update') && module_exists('jquery_ui')) {
  18. drupal_add_css(JQUERY_UI_PATH . '/themes/base/ui.all.css');
  19. jquery_ui_add(array('ui.dialog', 'ui.accordion', 'ui.draggable', 'ui.droppable', 'ui.selectable'));
  20. } else {
  21. drupal_set_message(t('elFinder requires jQuery 1.3+ and jQuery UI 1.7+ for jWYSIWYG support. Please install and enable <a href="http://drupal.org/project/jquery_update">jquery_update</a> and <a href="http://drupal.org/project/jquery_ui">jquery_ui</a> modules.'), 'error');
  22. }
  23. }
  24. drupal_add_js(array('elfinder' => array('file_browser_url' => $options['elfinder_url'])), 'setting');
  25. drupal_add_js($options['plugin_url_base'] . '/jwysiwyg.js');
  26. return array(
  27. 'elfinder' => array(
  28. 'extensions' => array('elfinder' => t('elFinder')),
  29. 'url' => $options['homepage_url'],
  30. 'options' => array(),
  31. 'load' => FALSE,
  32. ),
  33. );
  34. }