Projet

Général

Profil

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

root / drupal7 / sites / all / modules / views / modules / taxonomy / views_handler_argument_vocabulary_vid.inc @ 7547bb19

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
   * Override the behavior of title(). Get the name of the vocabulary.
16
   */
17
  function title() {
18
    $title = db_query("SELECT v.name FROM {taxonomy_vocabulary} v WHERE v.vid = :vid", array(':vid' => $this->argument))->fetchField();
19

    
20
    if (empty($title)) {
21
      return t('No vocabulary');
22
    }
23

    
24
    return check_plain($title);
25
  }
26
}