blob: 41311160078822463fee5e8a72f71b5e45d5815c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
<?php
/**
* @file
* The media browser style plugin.
*/
/**
* Media Views style plugin.
*
* Style plugin to render media items as an interactive grid for the media
* browser.
*
* @ingroup views_style_plugins
*/
class media_views_plugin_style_media_browser extends views_plugin_style_list {
// Stores the files loaded with pre_render.
public $files = array();
/**
* Set default options.
*/
function option_definition() {
$options = parent::option_definition();
$options['type'] = array('default' => 'ul');
$options['class'] = array('default' => 'media-list-thumbnails');
$options['wrapper_class'] = array('default' => '');
return $options;
}
/**
* Prevents a problem with views when get_row_class() is not set.
*/
public function get_row_class($row_index) {
}
/**
* Add the base field (fid) to the query.
*/
public function query() {
if (method_exists($this->view->query, 'add_field')) {
// Normal file_managed based view.
$this->view->query->add_field($this->view->base_table, $this->view->base_field);
}
if (method_exists($this->view->query, 'addField')) {
// Search API based view.
$this->view->query->addField('fid');
}
parent::query();
}
}
|