Project

General

Profile

Revision b0d73b57

Added by Assos Assos over 9 years ago

Revert media to 2.0-alpha4

View differences:

drupal7/sites/all/modules/media/modules/media_internet/media_internet.api.php
6 6
 */
7 7

  
8 8
/**
9
 * Returns a list of Internet media providers for URL/embed code testing.
9
 * Implements hook_media_internet_providers().
10 10
 *
11
 * @return array
12
 *   A nested array of provider information, keyed by class name. This class
13
 *   must implement a claim() method and may (should) extend the
14
 *   @link MediaInternetBaseHandler MediaInternetBaseHandler @endlink class.
15
 *   Each provider info array may have the following keys:
16
 *   - title: (required) A name to be used when listing the currently supported
17
 *     providers on the web tab of the media browser.
18
 *   - hidden: (optional) Boolean to prevent the provider title from being
19
 *     listed on the web tab of the media browser.
20
 *   - weight: (optional) Integer to determine the tab order. Defaults to 0.
21
 *
22
 * @see hook_media_internet_providers_alter()
23
 * @see media_internet_get_providers()
11
 * Implementors return an multidim array, keyed by a class name with the
12
 * following elements:
13
 * - title
14
 * - image (optional)
15
 * - hidden: bool If the logo should be shown on form. (optional)
16
 * - weight (optional)
24 17
 */
25 18
function hook_media_internet_providers() {
26 19
  return array(
27
    'MyModuleYouTubeHandler' => array(
28
      'title' => t('YouTube'),
29
      'hidden' => TRUE,
20
    'youtube' => array(
21
      'title' => 'youtube',
22
      'image' => 'youtube.jpg',
30 23
    ),
31 24
  );
32 25
}
33

  
34
/**
35
 * Alter the list of Internet media providers.
36
 *
37
 * @param array $providers
38
 *   The associative array of Internet media provider definitions from
39
 *   hook_media_internet_providers().
40
 *
41
 * @see hook_media_internet_providers()
42
 * @see media_internet_get_providers()
43
 */
44
function hook_media_internet_providers_alter(&$providers) {
45
  $providers['MyModuleYouTubeHandler']['title'] = t('Google video hosting');
46
  $providers['MyModuleYouTubeHandler']['weight'] = 42;
47
}

Also available in: Unified diff