Projet

Général

Profil

Paste
Télécharger (1,22 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / media / modules / media_internet / tests / media_internet_test.module @ ca0757b9

1
<?php
2

    
3
/**
4
 * @file
5
 * Provides Media Internet module hook implementations for testing purposes.
6
 */
7

    
8
/**
9
 * Implements hook_media_internet_providers().
10
 */
11
function media_internet_test_media_internet_providers() {
12
  return array(
13
    'MediaInternetTestHandler' => array(
14
      'title' => t('Media Internet Test'),
15
    ),
16
  );
17
}
18

    
19
/**
20
 * Implements hook_stream_wrappers().
21
 */
22
function media_internet_test_stream_wrappers() {
23
  return array(
24
    'mediainternettest' => array(
25
      'name' => t('Media Internet Test'),
26
      'class' => 'MediaInternetTestStreamWrapper',
27
      'description' => t('Media Internet Test.'),
28
      'type' => STREAM_WRAPPERS_READ_VISIBLE,
29
    ),
30
  );
31
}
32

    
33
/**
34
 * Implements hook_media_parse().
35
 *
36
 * @todo This hook should be deprecated. Refactor Media module to not call it
37
 *   any more, since media_internet should be able to automatically route to the
38
 *   appropriate handler.
39
 */
40
function media_internet_test_media_parse($embed_code) {
41
  $handler = new MediaInternetTestHandler($embed_code);
42
  return $handler->parse($embed_code);
43
}
44

    
45
 /**
46
 * Implements hook_file_mimetype_mapping_alter().
47
 */
48
function media_internet_test_file_mimetype_mapping_alter(&$mapping) {
49
  $mapping['mimetypes'][] = 'video/mediainternettest';
50
}