diff options
Diffstat (limited to 'sites/all/modules/views/modules/aggregator/views_handler_argument_aggregator_category_cid.inc')
-rw-r--r-- | sites/all/modules/views/modules/aggregator/views_handler_argument_aggregator_category_cid.inc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/sites/all/modules/views/modules/aggregator/views_handler_argument_aggregator_category_cid.inc b/sites/all/modules/views/modules/aggregator/views_handler_argument_aggregator_category_cid.inc new file mode 100644 index 000000000..92ae8b7f2 --- /dev/null +++ b/sites/all/modules/views/modules/aggregator/views_handler_argument_aggregator_category_cid.inc @@ -0,0 +1,26 @@ +<?php + +/** + * @file + * Definition of views_handler_argument_aggregator_category_cid. + */ + +/** + * Argument handler to accept an aggregator category id. + * + * @ingroup views_argument_handlers + */ +class views_handler_argument_aggregator_category_cid extends views_handler_argument_numeric { + /** + * Override the behavior of title(). Get the title of the category. + */ + function title_query() { + $titles = array(); + + $result = db_query("SELECT c.title FROM {aggregator_category} c WHERE c.cid IN (:cid)", array(':cid' => $this->value)); + foreach ($result as $term) { + $titles[] = check_plain($term->title); + } + return $titles; + } +} |