Project

General

Profile

Paste
Download (556 Bytes) Statistics
| Branch: | Revision:

root / drupal7 / sites / all / modules / views / modules / user / views_handler_argument_users_roles_rid.inc @ 8be7bf84

1
<?php
2

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

    
8
/**
9
 * Allow role ID(s) as argument.
10
 *
11
 * @ingroup views_argument_handlers
12
 */
13
class views_handler_argument_users_roles_rid extends views_handler_argument_many_to_one {
14

    
15
  /**
16
   * {@inheritdoc}
17
   */
18
  public function title_query() {
19
    $titles = array();
20

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

    
28
}