function media_media_browser_plugin_info

cis7 media.media.inc media_media_browser_plugin_info()
cle7 media.media.inc media_media_browser_plugin_info()
elmsmedia7 media.media.inc media_media_browser_plugin_info()
icor7 media.media.inc media_media_browser_plugin_info()
meedjum_blog7 media.media.inc media_media_browser_plugin_info()
mooc7 media.media.inc media_media_browser_plugin_info()

Implements hook_media_browser_plugin_info().

File

sites/all/modules/ulmus/media/media.media.inc, line 11
Media module integration for the Media module.

Code

function media_media_browser_plugin_info() {
  $info['upload'] = array(
    'title' => t('Upload'),
    'weight' => -10,
    'class' => 'MediaBrowserUpload',
  );

  // Add a plugin for each View display using the 'media_browser' display type.
  $view_weight = 10;
  foreach (views_get_enabled_views() as $view) {
    foreach ($view->display as $display) {
      if ($display->display_plugin == 'media_browser') {
        $title = $display->display_title;
        if (!empty($display->display_options['title'])) {
          $title = $display->display_options['title'];
        }
        $info["{$view->name}--{$display->id}"] = array(
          'title' => $title,
          
          // @TODO make this configurable.
          'weight' => $view_weight++,
          'class' => 'MediaBrowserView',
          'view_name' => $view->name,
          'view_display_id' => $display->id,
        );
      }
    }
  }

  return $info;
}