1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* @file
|
5
|
* Definition of RemoteStreamWrapperMediaBrowser.
|
6
|
*/
|
7
|
|
8
|
// If the Media Browser plugin class does not exist, prevent the rest of this
|
9
|
// file from being loaded.
|
10
|
if (!class_exists('MediaBrowserPlugin')) {
|
11
|
return;
|
12
|
}
|
13
|
|
14
|
/**
|
15
|
* Media browser plugin for remote files.
|
16
|
*/
|
17
|
class RemoteStreamWrapperMediaBrowser extends MediaBrowserPlugin {
|
18
|
/**
|
19
|
* Implements MediaBrowserPluginInterface::access().
|
20
|
*/
|
21
|
public function access($account = NULL) {
|
22
|
return user_access('administer files', $account) || user_access('add media from remote urls', $account);
|
23
|
}
|
24
|
|
25
|
/**
|
26
|
* Implements MediaBrowserPlugin::view().
|
27
|
*/
|
28
|
public function view() {
|
29
|
$build['form'] = drupal_get_form('remote_stream_wrapper_file_add_form', $this->params);
|
30
|
return $build;
|
31
|
}
|
32
|
}
|