1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* @file
|
5
|
* Definition of views_handler_argument_file_fid.
|
6
|
*/
|
7
|
|
8
|
/**
|
9
|
* Argument handler to accept multiple file ids.
|
10
|
*
|
11
|
* @ingroup views_argument_handlers
|
12
|
*/
|
13
|
class views_handler_argument_file_fid extends views_handler_argument_numeric {
|
14
|
|
15
|
/**
|
16
|
* Override the behavior of title_query(). Get the filenames.
|
17
|
*/
|
18
|
public function title_query() {
|
19
|
$titles = db_select('file_managed', 'f')
|
20
|
->fields('f', array('filename'))
|
21
|
->condition('fid', $this->value)
|
22
|
->execute()
|
23
|
->fetchCol();
|
24
|
foreach ($titles as &$title) {
|
25
|
$title = check_plain($title);
|
26
|
}
|
27
|
return $titles;
|
28
|
}
|
29
|
|
30
|
}
|