Projet

Général

Profil

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

root / drupal7 / sites / all / modules / views / modules / node / views_handler_argument_node_vid.inc @ 13755f8d

1
<?php
2

    
3
/**
4
 * @file
5
 * Provide node vid argument handler.
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
  // No constructor is necessary.
13

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

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