Skip navigation


6 aggregator_page_category($arg1, $arg2 = NULL)
7 aggregator_page_category($category)

Menu callback; displays all the items aggregated in a particular category.

If there are two arguments then this function is called as a form.


$arg1: If there are two arguments then $arg1 is $form_state. Otherwise, $arg1 is $category.

$arg2: If there are two arguments then $arg2 is $category.

Return value

The items HTML.

1 string reference to 'aggregator_page_category'


drupal/modules/aggregator/, line 61
User page callbacks for the aggregator module.


function aggregator_page_category($arg1, $arg2 = NULL) {
  // If there are two arguments then we are called as a form, $arg1 is
  // $form_state and $arg2 is $category. Otherwise, $arg1 is $category.
  $category = is_array($arg2) ? $arg2 : $arg1;

  drupal_add_feed(url('aggregator/rss/' . $category['cid']), variable_get('site_name', 'Drupal') . ' ' . t('aggregator - @title', array('@title' => $category['title'])));

  // It is safe to include the cid in the query because it's loaded from the
  // database by aggregator_category_load.
  $items = aggregator_feed_items_load('SELECT i.*, f.title AS ftitle, AS flink FROM {aggregator_category_item} c LEFT JOIN {aggregator_item} i ON c.iid = i.iid LEFT JOIN {aggregator_feed} f ON i.fid = f.fid WHERE cid = ' . $category['cid'] . ' ORDER BY timestamp DESC, i.iid DESC');

  return _aggregator_page_list($items, arg(3));