Projet

Général

Profil

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

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

1
<?php
2

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

    
8
/**
9
 * Argument handler to accept an aggregator item id.
10
 *
11
 * @ingroup views_argument_handlers
12
 */
13
class views_handler_argument_aggregator_iid 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
    $placeholders = implode(', ', array_fill(0, sizeof($this->value), '%d'));
21

    
22
    $result = db_select('aggregator_item', 'ai')
23
      ->condition('iid', $this->value, 'IN')
24
      ->fields('ai', array('title'))
25
      ->execute();
26
    foreach ($result as $term) {
27
      $titles[] = check_plain($term->title);
28
    }
29
    return $titles;
30
  }
31

    
32
}