Projet

Général

Profil

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

root / drupal7 / sites / all / modules / views / modules / aggregator / views_handler_argument_aggregator_category_cid.inc @ 5d12d676

1
<?php
2

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

    
8
/**
9
 * Argument handler to accept an aggregator category id.
10
 *
11
 * @ingroup views_argument_handlers
12
 */
13
class views_handler_argument_aggregator_category_cid extends views_handler_argument_numeric {
14

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

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

    
28
}