Index: modules/aggregator/aggregator.module =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.module,v retrieving revision 1.421 diff -u -r1.421 aggregator.module --- modules/aggregator/aggregator.module 24 Aug 2009 17:11:41 -0000 1.421 +++ modules/aggregator/aggregator.module 26 Aug 2009 23:35:31 -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.42 diff -u -r1.42 aggregator.admin.inc --- modules/aggregator/aggregator.admin.inc 24 Aug 2009 17:11:41 -0000 1.42 +++ modules/aggregator/aggregator.admin.inc 26 Aug 2009 23:35:30 -0000 @@ -8,21 +8,14 @@ /** * Menu callback; displays the aggregator administration page. - */ -function aggregator_admin_overview() { - return aggregator_view(); -} - -/** - * 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'); - - $output = '

' . t('Feed overview') . '

'; +function aggregator_admin_overview() { + $result = pager_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', 50, 0, 'SELECT COUNT(fid) FROM {aggregator_feed}'); + + $output = ''; $header = array(t('Title'), t('Items'), t('Last update'), t('Next update'), array('data' => t('Operations'), 'colspan' => '3')); $rows = array(); @@ -32,11 +25,23 @@ if (empty($rows)) { $rows[] = array(array('data' => t('No feeds available. Add feed.', array('@link' => url('admin/content/aggregator/add/feed'))), 'colspan' => '5', 'class' => array('message'))); } + $output .= theme('table', $header, $rows); + $output .= theme('pager', NULL); - $result = db_query('SELECT c.cid, c.title, COUNT(ci.iid) as items FROM {aggregator_category} c LEFT JOIN {aggregator_category_item} ci ON c.cid = ci.cid GROUP BY c.cid, c.title ORDER BY title'); + return $output; +} + +/** + * Menu callback; displays the aggregator category overview page. + * + * @return + * The page HTML. + */ +function aggregator_category_overview() { + $result = pager_query('SELECT c.cid, c.title, COUNT(ci.iid) as items FROM {aggregator_category} c LEFT JOIN {aggregator_category_item} ci ON c.cid = ci.cid GROUP BY c.cid, c.title ORDER BY title', 50, 0, 'SELECT COUNT(cid) FROM {aggregator_category}'); - $output .= '

' . t('Category overview') . '

'; + $output = ''; $header = array(t('Title'), t('Items'), t('Operations')); $rows = array(); @@ -46,7 +51,9 @@ if (empty($rows)) { $rows[] = array(array('data' => t('No categories available. Add category.', array('@link' => url('admin/config/services/aggregator/add/category'))), 'colspan' => '5', 'class' => array('message'))); } + $output .= theme('table', $header, $rows); + $output .= theme('pager', NULL); return $output; }