Projet

Général

Profil

Paste
Télécharger (1,58 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / media / modules / media_wysiwyg / wysiwyg_plugins / media.inc @ ca0757b9

1
<?php
2

    
3
/**
4
 * @file
5
 * Define the WYSIWYG browser plugin.
6
 */
7

    
8
/**
9
 * Implements WYSIWYG's hook_INCLUDE_plugin().
10
 */
11
function media_wysiwyg_media_plugin() {
12
  // Include the required browser JS.
13
  // @todo: wyswiyg should allow libraries and multiple js files
14
  // to be defined by this hook.
15
  // @see http://drupal.org/node/1039076
16
  media_wysiwyg_include_browser_js();
17

    
18
  // Add the filter handling.
19
  drupal_add_js(drupal_get_path('module', 'media_wysiwyg') . '/js/media_wysiwyg.filter.js');
20

    
21
  // Plugin definition.
22
  $plugins['media'] = array(
23
    'title' => variable_get('media_wysiwyg_wysiwyg_title', t('Media browser')),
24
    'vendor url' => 'http://drupal.org/project/media',
25
    'icon path' => drupal_get_path('module', 'media_wysiwyg') . '/wysiwyg_plugins/media_ckeditor/images',
26
    'icon file' => 'icon.gif',
27
    'icon title' => variable_get('media_wysiwyg_wysiwyg_icon_title', t('Add media')),
28
    // @todo: move this to the plugin directory for the wysiwyg plugin.
29
    'js path' => drupal_get_path('module', 'media_wysiwyg') . '/js',
30
    'js file' => 'wysiwyg-media.js',
31
    'css path' => drupal_get_path('module', 'media_wysiwyg') . '/css',
32
    'css file' => 'media_wysiwyg.css',
33
    'settings' => array(
34
      'global' => array(
35
        'enabledPlugins' => variable_get('media_wysiwyg_wysiwyg_browser_plugins', array()),
36
        'file_directory' => variable_get('media_wysiwyg_wysiwyg_upload_directory', ''),
37
        'types' => variable_get('media_wysiwyg_wysiwyg_allowed_types', array('audio', 'image', 'video', 'document')),
38
        'id' => 'media_wysiwyg',
39
      ),
40
    ),
41
  );
42

    
43
  return $plugins;
44
}