You are here

views_handler_argument_users_roles_rid.inc in Views (for Drupal 7) 6.3

File

modules/user/views_handler_argument_users_roles_rid.inc
View source
<?php

/**
 * Allow role ID(s) as argument.
 *
 * @ingroup views_argument_handlers
 */
class views_handler_argument_users_roles_rid extends views_handler_argument_many_to_one {
  function title_query() {
    $titles = array();
    $placeholders = implode(', ', array_fill(0, sizeof($this->value), '%d'));
    $result = db_query("SELECT name FROM {role} WHERE rid IN ({$placeholders})", $this->value);
    while ($term = db_fetch_object($result)) {
      $titles[] = check_plain($term->name);
    }
    return $titles;
  }

}

Classes

Namesort descending Description
views_handler_argument_users_roles_rid Allow role ID(s) as argument.