function imce_wysiwyg_plugin

cis7 imce_wysiwyg.module imce_wysiwyg_plugin($editor, $version)
cle7 imce_wysiwyg.module imce_wysiwyg_plugin($editor, $version)
elmsmedia7 imce_wysiwyg.module imce_wysiwyg_plugin($editor, $version)
icor7 imce_wysiwyg.module imce_wysiwyg_plugin($editor, $version)
meedjum_blog7 imce_wysiwyg.module imce_wysiwyg_plugin($editor, $version)
mooc7 imce_wysiwyg.module imce_wysiwyg_plugin($editor, $version)

Implements hook_wysiwyg_plugin().

File

sites/all/modules/ulmus/imce_wysiwyg/imce_wysiwyg.module, line 12
Makes IMCE available as plugin for client-side editors integrated via Wysiwyg API.

Code

function imce_wysiwyg_plugin($editor, $version) {
  static $integrated = array();

  if (!module_invoke('imce', 'access')) {
    return;
  }
  // Load our invocation scripts.
  if (empty($integrated)) {
    $imcepath = drupal_get_path('module', 'imce');
    $path = drupal_get_path('module', 'imce_wysiwyg');
    drupal_add_js($imcepath . '/js/imce.js');
    drupal_add_js($imcepath . '/js/imce_set_app.js');
    drupal_add_js($path . '/js/imce_wysiwyg.js');
  }

  switch ($editor) {
    case 'tinymce':
      if (!isset($integrated[$editor])) {
        $integrated[$editor] = TRUE;
        // @todo If some other editor also needs the URL to be passed via
        //   Drupal.settings.imce, then we need another sub-key '$editor'.
        $settings = array(
          'imce' => array('url' => url('imce', array('query' => array('app' => $editor . '|url@')))),
        );
        drupal_add_js($settings, 'setting');
      }
      return array(
        'imce' => array(
          'extensions' => array('imce' => t('IMCE')),
          'url' => 'http://drupal.org/project/imce',
          'options' => array(
            'file_browser_callback' => 'imceImageBrowser',
            'inline_styles' => TRUE,
          ),
          'load' => FALSE,
        ),
      );

    case 'ckeditor':
      $integrated[$editor] = TRUE;
      return array(
        'imce' => array(
          'extensions' => array('imce' => t('IMCE')),
          'url' => 'http://drupal.org/project/imce',
          'options' => array(
            'filebrowserBrowseUrl' => url('imce', array('query' => array('app' => $editor . '|sendto@imceCkeditSendTo|params@'))),
          ),
          'load' => FALSE,
        ),
      );

    case 'fckeditor':
      $integrated[$editor] = TRUE;
      return array(
        'imce' => array(
          'extensions' => array('imce' => t('IMCE')),
          'url' => 'http://drupal.org/project/imce',
          'options' => array(
            'LinkBrowser' => TRUE,
            'LinkBrowserURL' => url('imce', array('query' => array('app' => $editor . '|url@txtUrl'))),
            'ImageBrowser' => TRUE,
            'ImageBrowserURL' => url('imce', array('query' => array('app' => $editor . '|url@txtUrl|width@txtWidth|height@txtHeight'))),
            'FlashBrowser' => TRUE,
            'FlashBrowserURL' => url('imce', array('query' => array('app' => $editor . '|url@txtUrl'))),
          ),
          'load' => FALSE,
        ),
      );
  }
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.