Projet

Général

Profil

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

root / drupal7 / sites / all / modules / views / modules / taxonomy / views_handler_argument_vocabulary_vid.inc @ 4003efde

1 85ad3d82 Assos Assos
<?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 5d12d676 Assos Assos
15 85ad3d82 Assos Assos
  /**
16
   * Override the behavior of title(). Get the name of the vocabulary.
17
   */
18 5d12d676 Assos Assos
  public function title() {
19 85ad3d82 Assos Assos
    $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 5d12d676 Assos Assos
28 85ad3d82 Assos Assos
}