You are here

function media_library_wysiwyg_plugin in Media Library 6

Implementation of hook_wysiwyg_plugin()

File

./media_library.module, line 319
Main Media Library module file.

Code

function media_library_wysiwyg_plugin($editor, $version) {
  switch ($editor) {
    case 'tinymce':
      if ($version > 3) {

        // Prepare buttons
        $types = media_library_get_types();
        $buttons = array();
        foreach ($types as $type => $info) {
          $buttons['media_library_' . $type] = t('Media Library - !type', array(
            '!type' => $info['title'],
          ));
        }
        return array(
          'media_library' => array(
            'path' => drupal_get_path('module', 'media_library') . '/ml_tiny/editor_plugin.js',
            'buttons' => $buttons,
            'url' => 'http://drupal.org/project/media_library',
            'extended_valid_elements' => array(
              'img[class|src|border=0|alt|title|width|height|align|name|style]',
              'div[class|id]',
            ),
            'load' => TRUE,
          ),
        );
      }
  }
}