Projet

Général

Profil

Révision 2b3c8cc1

Ajouté par Assos Assos il y a presque 9 ans

Weekly update of contrib modules

Voir les différences:

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

  
8 8
/**
9
 * Implements hook_media_internet_providers().
9
 * Returns a list of Internet media providers for URL/embed code testing.
10 10
 *
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)
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()
17 24
 */
18 25
function hook_media_internet_providers() {
19 26
  return array(
20
    'youtube' => array(
21
      'title' => 'youtube',
22
      'image' => 'youtube.jpg',
27
    'MyModuleYouTubeHandler' => array(
28
      'title' => t('YouTube'),
29
      'hidden' => TRUE,
23 30
    ),
24 31
  );
25 32
}
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
}

Formats disponibles : Unified diff