Projet

Général

Profil

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

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

1
<?php
2

    
3
/**
4
 * @file
5
 * Definition of views_handler_argument_vocabulary_machine_name.
6
 */
7

    
8
/**
9
 * Argument handler to accept a vocabulary machine name.
10
 *
11
 * @ingroup views_argument_handlers
12
 */
13
class views_handler_argument_vocabulary_machine_name extends views_handler_argument_string {
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.machine_name = :machine_name", array(':machine_name' => $this->argument))->fetchField();
20

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

    
25
    return check_plain($title);
26
  }
27

    
28
}