MediaBrowserPlugin.inc

  1. cis7 sites/all/modules/ulmus/media/includes/MediaBrowserPlugin.inc
  2. cle7 sites/all/modules/ulmus/media/includes/MediaBrowserPlugin.inc
  3. ecd7 sites/all/modules/ulmus/media/includes/MediaBrowserPlugin.inc
  4. elmsmedia7 sites/all/modules/ulmus/media/includes/MediaBrowserPlugin.inc
  5. harmony7 sites/all/modules/ulmus/media/includes/MediaBrowserPlugin.inc
  6. icor7 sites/all/modules/ulmus/media/includes/MediaBrowserPlugin.inc
  7. meedjum_blog7 sites/all/modules/ulmus/media/includes/MediaBrowserPlugin.inc
  8. mooc7 sites/all/modules/ulmus/media/includes/MediaBrowserPlugin.inc

Definition of MediaBrowserPlugin.

Classes

Namesort descending Description
MediaBrowserPlugin Defines a Media browser plugin base class.

File

sites/all/modules/ulmus/media/includes/MediaBrowserPlugin.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * Definition of MediaBrowserPlugin.
  5. */
  6. /**
  7. * Defines a Media browser plugin base class.
  8. *
  9. * MediaBrowserPlugin implementations need to implement at least the
  10. * view() method.
  11. */
  12. abstract class MediaBrowserPlugin implements MediaBrowserPluginInterface {
  13. /**
  14. * The plugin metadata array from hook_media_browser_plugin_info().
  15. *
  16. * @var array
  17. */
  18. protected $info;
  19. /**
  20. * The parameters for the current media browser from
  21. * media_get_browser_params().
  22. *
  23. * @var array
  24. */
  25. protected $params;
  26. /**
  27. * Implements MediaBrowserPluginInterface::__construct().
  28. */
  29. public function __construct($info, $params) {
  30. $this->info = $info;
  31. $this->params = $params;
  32. }
  33. /**
  34. * Implements MediaBrowserPluginInterface::access().
  35. */
  36. public function access($account = NULL) {
  37. // Backwards compatible support for 'access callback' definitions.
  38. if (isset($this->info['access callback'])) {
  39. $access_callback = $this->info['access callback'];
  40. $access_arguments = isset($this->info['access arguments']) ? $this->info['access arguments'] : array();
  41. return function_exists($access_callback) && call_user_func_array($access_callback, $access_arguments);
  42. }
  43. return TRUE;
  44. }
  45. /**
  46. * Provide a render array to display the plugin in a media browser.
  47. *
  48. * This render array will be a jQuery tab in the media browser.
  49. *
  50. * Some elements are special:
  51. * - #settings: Drupal.settings.media.browser.$key (where key is the array
  52. * key).
  53. * - #callback: If provided, will make the tab an "ajax" tab.
  54. * - #title: If provided, will be used as the tab's title. Otherwise the
  55. * 'title' value from the plugin's hook_media_browser_plugin_info() will
  56. * be used.
  57. * - #weight: If provided, will be used to order the tabs between each other.
  58. * A lower weight will be displayed first while a higher weight will be
  59. * displayed later. If not provided, and there is a 'weight' value in the
  60. * plugin's hook_media_browser_plugin_info() then it will be used,
  61. * otherwise a default of 0 will be used.
  62. * - form: If the plugin is to display a native Drupal form, then the output
  63. * of drupal_get_form should be returned into the 'form' render key. If a
  64. * form's callback isn't normally loaded, module_load_include() should be
  65. * used to ensure that the form can be displayed.
  66. *
  67. * Example usage:
  68. * @code
  69. * module_load_include('inc', 'mymodule', 'mymodule.pages');
  70. * $build['#attached']['js'][] = drupal_get_path('module', 'mymodule') . '/js/mymodule.media.browser.js';
  71. * $build['form'] = drupal_get_form('mymodule_media_form');
  72. * return $build;
  73. * @endcode
  74. *
  75. * @return array
  76. * Renderable array.
  77. */
  78. abstract public function view();
  79. }
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.