1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* @file
|
5
|
* Definition of views_handler_argument_vocabulary_vid.
|
6
|
*/
|
7
|
|
8
|
/**
|
9
|
* Argument handler to accept a vocabulary id.
|
10
|
*
|
11
|
* @ingroup views_argument_handlers
|
12
|
*/
|
13
|
class views_handler_argument_vocabulary_vid extends views_handler_argument_numeric {
|
14
|
|
15
|
/**
|
16
|
* Override the behavior of title(). Get the name of the vocabulary.
|
17
|
*/
|
18
|
public function title() {
|
19
|
$title = db_query("SELECT v.name FROM {taxonomy_vocabulary} v WHERE v.vid = :vid", array(':vid' => $this->argument))->fetchField();
|
20
|
|
21
|
if (empty($title)) {
|
22
|
return t('No vocabulary');
|
23
|
}
|
24
|
|
25
|
return check_plain($title);
|
26
|
}
|
27
|
|
28
|
}
|