Projet

Général

Profil

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

root / drupal7 / sites / all / modules / media / includes / MediaBrowserUpload.inc @ 74f6bef0

1
<?php
2

    
3
/**
4
 * @file
5
 * Definition of MediaBrowserUpload.
6
 */
7

    
8
/**
9
 * Media browser plugin for showing the upload form.
10
 *
11
 * @deprecated
12
 */
13
class MediaBrowserUpload extends MediaBrowserPlugin {
14
  /**
15
   * Implements MediaBrowserPluginInterface::access().
16
   */
17
  public function access($account = NULL) {
18
    return file_entity_access('create', NULL, $account);
19
  }
20

    
21
  /**
22
   * Implements MediaBrowserPlugin::view().
23
   */
24
  public function view() {
25
    module_load_include('inc', 'file_entity', 'file_entity.pages');
26

    
27
    $build = array();
28
    if ($this->params['multiselect'] && module_exists('plupload')) {
29
      $build['form'] = drupal_get_form('file_entity_add_upload_multiple', $this->params);
30
      $build['#attached']['js'][] = drupal_get_path('module', 'media') . '/js/plugins/media.upload_multiple.js';
31
    }
32
    else {
33
      $build['form'] = drupal_get_form('file_entity_add_upload', $this->params);
34
    }
35

    
36
    return $build;
37
  }
38
}