You are here

function hook_media_browser_plugin_view in D7 Media 7

Return an array of plugins for the media browser.

Implementors are expected to return a renderable element.

Each element will be a jQuery tab on the media browser.

Some elements are special:

  • #title: The title that goes on the tab
  • #settings: Drupal.settings.media.browser.$key (where key is the array key).
  • #callback: If provided, will make the tab an "ajax" tab.

Example: $plugins['library'] = array( '#title' => t('Library'), '#attached' => array( 'js' => array( $path . '/js/plugins/media.library.js', ), ), '#settings' => array( 'viewMode' => 'thumbnails', 'getMediaUrl' => url('media/browser/list'), ), '#markup' => '<div> Library goes here</div>', );

Parameters

$plugin_name: The name of the plugin to view

$params: An array of parameters which came in is $_GET['params']. The expected parameters is still being defined.

  • types: Array of media types to support
  • multiselect: Boolean enabling or disabling multiselect

Return value

Renderable array.

2 functions implement hook_media_browser_plugin_view()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

media_internet_media_browser_plugin_view in modules/media_internet/media_internet.media.inc
Implements hook_media_browser_plugin_view().
media_media_browser_plugin_view in ./media.media.inc
Implements hook_media_browser_plugin_view().
1 invocation of hook_media_browser_plugin_view()
media_browser in includes/media.browser.inc
@file Media Browser page callback

File

./media.api.php, line 47
Hook provided by the media module.

Code

function hook_media_browser_plugin_view($plugin_name, $params) {
}