Index: modules/aggregator/aggregator.module =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.module,v retrieving revision 1.426 diff -u -r1.426 aggregator.module --- modules/aggregator/aggregator.module 12 Oct 2009 15:54:59 -0000 1.426 +++ modules/aggregator/aggregator.module 14 Oct 2009 20:04:34 -0000 @@ -23,8 +23,10 @@ return $output; case 'admin/config/services/aggregator': $output = '
' . t('Thousands of sites (particularly news sites and blogs) publish their latest headlines and posts in feeds, using a number of standardized XML-based formats. Formats supported by the aggregator include RSS, RDF, and Atom.', array('@rss' => 'http://cyber.law.harvard.edu/rss/', '@rdf' => 'http://www.w3.org/RDF/', '@atom' => 'http://www.atomenabled.org')) . '
'; - $output .= '' . t('Current feeds are listed below, and new feeds may be added. For each feed or feed category, the latest items block may be enabled at the blocks administration page.', array('@addfeed' => url('admin/config/services/aggregator/add/feed'), '@block' => url('admin/structure/block'))) . '
'; + $output .= '' . t('Current feeds are listed below, and new feeds may be added. For each feed, the latest items block may be enabled at the blocks administration page.', array('@addfeed' => url('admin/config/services/aggregator/add/feed'), '@block' => url('admin/structure/block'))) . '
'; return $output; + case 'admin/config/services/aggregator/categories': + return '' . t('Current categories are listed below, and new categories may be added. For each category, the latest items block may be enabled at the blocks administration page.', array('@addcategory' => url('admin/config/services/aggregator/add/category'), '@block' => url('admin/structure/block'))) . '
'; case 'admin/config/services/aggregator/add/feed': return '' . t('Add a feed in RSS, RDF or Atom format. A feed may only have one entry.') . '
'; case 'admin/config/services/aggregator/add/category': @@ -93,6 +95,18 @@ 'access arguments' => array('administer news feeds'), 'file' => 'aggregator.admin.inc', ); + $items['admin/config/services/aggregator/feeds'] = array( + 'title' => 'Feed overview', + 'type' => MENU_DEFAULT_LOCAL_TASK, + 'weight' => -10, + ); + $items['admin/config/services/aggregator/categories'] = array( + 'title' => 'Category overview', + 'page callback' => 'aggregator_category_overview', + 'access arguments' => array('administer news feeds'), + 'type' => MENU_LOCAL_TASK, + 'file' => 'aggregator.admin.inc', + ); $items['admin/config/services/aggregator/add/feed'] = array( 'title' => 'Add feed', 'page callback' => 'drupal_get_form', @@ -133,11 +147,6 @@ 'type' => MENU_CALLBACK, 'file' => 'aggregator.admin.inc', ); - $items['admin/config/services/aggregator/list'] = array( - 'title' => 'List', - 'type' => MENU_DEFAULT_LOCAL_TASK, - 'weight' => -10, - ); $items['admin/config/services/aggregator/settings'] = array( 'title' => 'Settings', 'description' => 'Configure the behavior of the feed aggregator, including when to discard feed items and how to present feed items and categories.', Index: modules/aggregator/aggregator.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.admin.inc,v retrieving revision 1.44 diff -u -r1.44 aggregator.admin.inc --- modules/aggregator/aggregator.admin.inc 9 Oct 2009 00:59:55 -0000 1.44 +++ modules/aggregator/aggregator.admin.inc 14 Oct 2009 20:04:33 -0000 @@ -10,43 +10,73 @@ * Menu callback; displays the aggregator administration page. */ function aggregator_admin_overview() { - return aggregator_view(); -} + $count_query = db_select('aggregator_feed'); + $count_query->addExpression('COUNT(fid)'); -/** - * Displays the aggregator administration page. - * - * @return - * The page HTML. - */ -function aggregator_view() { - $result = db_query('SELECT f.*, COUNT(i.iid) AS items FROM {aggregator_feed} f LEFT JOIN {aggregator_item} i ON f.fid = i.fid GROUP BY f.fid, f.title, f.url, f.refresh, f.checked, f.link, f.description, f.hash, f.etag, f.modified, f.image, f.block ORDER BY f.title'); + $query = db_select('aggregator_feed', 'f')->extend('PagerDefault')->extend('TableSort'); + $query->leftJoin('aggregator_item', 'i', 'f.fid = i.fid'); + $query->addExpression('COUNT(i.iid)', 'items'); + $query = $query + ->fields('f', array('fid', 'title', 'refresh', 'checked',)) + ->limit(50) + ->orderBy('f.title'); + $query->setCountQuery($count_query); + $result = $query->execute(); - $output = '