views_handler_argument_aggregator_category_cid.inc

  1. 3.x modules/aggregator/views_handler_argument_aggregator_category_cid.inc
  2. 2.x modules/aggregator/views_handler_argument_aggregator_category_cid.inc

Definition of views_handler_argument_aggregator_category_cid.

File

modules/aggregator/views_handler_argument_aggregator_category_cid.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * Definition of views_handler_argument_aggregator_category_cid.
  5. */
  6. /**
  7. * Argument handler to accept an aggregator category id.
  8. *
  9. * @ingroup views_argument_handlers
  10. */
  11. class views_handler_argument_aggregator_category_cid extends views_handler_argument_numeric {
  12. /**
  13. * Override the behavior of title(). Get the title of the category.
  14. */
  15. function title_query() {
  16. $titles = array();
  17. $result = db_query("SELECT c.title FROM {aggregator_category} c WHERE c.cid IN (:cid)", array(':cid' => $this->value));
  18. foreach ($result as $term) {
  19. $titles[] = check_plain($term->title);
  20. }
  21. return $titles;
  22. }
  23. }