You are here

function views_handler_argument_aggregator_category_cid::title_query in Views (for Drupal 7) 6.2

Same name and namespace in other branches
  1. 6.3 modules/aggregator/views_handler_argument_aggregator_category_cid.inc \views_handler_argument_aggregator_category_cid::title_query()
  2. 7.3 modules/aggregator/views_handler_argument_aggregator_category_cid.inc \views_handler_argument_aggregator_category_cid::title_query()

Override the behavior of title(). Get the title of the category.

Overrides views_handler_argument_numeric::title_query

File

modules/aggregator/views_handler_argument_aggregator_category_cid.inc, line 10

Class

views_handler_argument_aggregator_category_cid
Argument handler to accept an aggregator category id.

Code

function title_query() {
  $titles = array();
  $placeholders = implode(', ', array_fill(0, sizeof($this->value), '%d'));
  $result = db_query("SELECT c.title FROM {aggregator_category} c WHERE c.cid IN ({$placeholders})", $this->value);
  while ($term = db_fetch_object($result)) {
    $titles[] = check_plain($term->title);
  }
  return $titles;
}