aggregator_page_category

Definition

aggregator_page_category($arg1, $arg2 = NULL)
modules/aggregator/aggregator.pages.inc, line 60

Description

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

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

Parameters

$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.

Code

<?php
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('category', $category);

  return _aggregator_page_list($items, arg(3));
}
?>
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.