Revision 2b3c8cc1
Added by Assos Assos about 9 years ago
drupal7/sites/all/modules/media/tests/media_module_test.module | ||
---|---|---|
5 | 5 |
* Provides Media module pages for testing purposes. |
6 | 6 |
*/ |
7 | 7 |
|
8 |
/** |
|
9 |
* Implements hook_media_browser_plugin_info(). |
|
10 |
*/ |
|
11 |
function media_module_test_media_browser_plugin_info() { |
|
12 |
// Allow tests to enable or disable this hook. |
|
13 |
if (!variable_get('media_module_test_media_browser_plugin_info', FALSE)) { |
|
14 |
return array(); |
|
15 |
} |
|
16 |
|
|
17 |
$info['media_module_test'] = array( |
|
18 |
'title' => t('Media module test'), |
|
19 |
'class' => 'MediaModuleTest', |
|
20 |
'weight' => 50, |
|
21 |
); |
|
22 |
|
|
23 |
return $info; |
|
24 |
} |
|
25 |
|
|
26 |
/** |
|
27 |
* Implements hook_media_browser_plugin_info_alter(). |
|
28 |
*/ |
|
29 |
function media_module_test_media_browser_plugin_info_alter(&$info) { |
|
30 |
// Allow tests to enable or disable this hook. |
|
31 |
if (!variable_get('media_module_test_media_browser_plugin_info_alter', FALSE)) { |
|
32 |
return; |
|
33 |
} |
|
34 |
|
|
35 |
$info['media_module_test']['title'] = t('Altered plugin title'); |
|
36 |
} |
|
37 |
|
|
38 |
/** |
|
39 |
* Implements hook_media_browser_plugins_alter(). |
|
40 |
*/ |
|
41 |
function media_module_test_media_browser_plugins_alter(&$plugin_output) { |
|
42 |
// Allow tests to enable or disable this hook. |
|
43 |
if (!variable_get('media_module_test_media_browser_plugins_alter', FALSE)) { |
|
44 |
return; |
|
45 |
} |
|
46 |
|
|
47 |
$plugin_output['media_module_test']['test']['#markup'] = '<p>' . t('Altered browser plugin output.') . '</p>'; |
|
48 |
} |
|
49 |
|
|
8 | 50 |
/** |
9 | 51 |
* Implements hook_menu(). |
10 | 52 |
*/ |
Also available in: Unified diff
Weekly update of contrib modules