You are here

function media_set_browser_params in D7 Media 7

Same name and namespace in other branches
  1. 7.4 media.module \media_set_browser_params()
  2. 7.2 media.module \media_set_browser_params()
  3. 7.3 media.module \media_set_browser_params()

Provides a singleton of the params passed to the media browser.

This is useful in situations like form alters because callers can pass id="wysiywg_form" or whatever they want, and a form alter could pick this up. We may want to change the hook_media_browser_plugin_view() implementations to use this function instead of being passed params for consistency.

It also offers a chance for some meddler to meddle with them.

Parameters

array $params: An array of parameters provided when a media_browser is launched.

See also

media_browser()

2 calls to media_set_browser_params()
media_browser in includes/media.browser.inc
@file Media Browser page callback
media_get_browser_params in includes/media.browser.inc
For sanity in grammar.

File

includes/media.browser.inc, line 138
Media Browser page callback

Code

function media_set_browser_params(array $params = NULL) {
  $stored_params =& drupal_static(__FUNCTION__, array());
  if (isset($params)) {
    $stored_params = $params;

    // Allow modules to alter the parameters.
    drupal_alter('media_browser_params', $stored_params);
  }
  return $stored_params;
}