root / drupal7 / sites / all / modules / media / modules / media_internet / media_internet.api.php @ 1f623f01
1 |
<?php
|
---|---|
2 |
|
3 |
/**
|
4 |
* @file
|
5 |
* Hooks provided by the media_internet module.
|
6 |
*/
|
7 |
|
8 |
/**
|
9 |
* Returns a list of Internet media providers for URL/embed code testing.
|
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()
|
24 |
*/
|
25 |
function hook_media_internet_providers() { |
26 |
return array( |
27 |
'MyModuleYouTubeHandler' => array( |
28 |
'title' => t('YouTube'), |
29 |
'hidden' => TRUE, |
30 |
), |
31 |
); |
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 |
} |