Projet

Général

Profil

Paste
Télécharger (878 octets) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / media_youtube / includes / MediaYouTubeBrowser.inc @ 74f6bef0

1
<?php
2

    
3
/**
4
 * @file media_youtube/includes/MediaYouTubeBrowser.inc
5
 *
6
 * Definition of MediaYouTubeBrowser.
7
 */
8

    
9
/**
10
 * Media browser plugin for displaying a specific view and display.
11
 */
12
class MediaYouTubeBrowser extends MediaBrowserPlugin {
13
  /**
14
   * Implements MediaBrowserPluginInterface::access().
15
   */
16
  public function access($account = NULL) {
17
    // @TODO: media_access() is a wrapper for file_entity_access(). Switch to the
18
    // new function when Media 1.x is deprecated.
19
    return media_access('create', $account);
20
  }
21

    
22
  /**
23
   * Implements MediaBrowserPlugin::view().
24
   */
25
  public function view() {
26
    // Check if the user is able to add remote media.
27
    if (user_access('add media from remote sources')) {
28
      $build['form'] = drupal_get_form('media_youtube_add', $this->params['types'], $this->params['multiselect']);
29
      return $build;
30
    }
31
  }
32
}