Projet

Général

Profil

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

root / drupal7 / sites / all / modules / views / modules / node / views_handler_argument_node_vid.inc @ 5d12d676

1
<?php
2

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

    
8
/**
9
 * Argument handler to accept a node revision id.
10
 */
11
class views_handler_argument_node_vid extends views_handler_argument_numeric {
12

    
13
  /**
14
   * Override the behavior of title(). Get the title of the revision.
15
   */
16
  public function title_query() {
17
    $titles = array();
18

    
19
    $result = db_query("SELECT n.title FROM {node_revision} n WHERE n.vid IN (:vids)", array(':vids' => $this->value));
20
    foreach ($result as $term) {
21
      $titles[] = check_plain($term->title);
22
    }
23
    return $titles;
24
  }
25

    
26
}