diff options
author | Dries Buytaert <dries@buytaert.net> | 2007-03-12 13:01:10 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2007-03-12 13:01:10 +0000 |
commit | 66b99866b031756a581d4200a0ed89a1b519aae4 (patch) | |
tree | f9b1633b257a26ab95d48223c33dcd7a4f672aa5 /modules/aggregator | |
parent | 3f82b01def951235b50708fc0a1bdd74423a43f1 (diff) | |
download | brdo-66b99866b031756a581d4200a0ed89a1b519aae4.tar.gz brdo-66b99866b031756a581d4200a0ed89a1b519aae4.tar.bz2 |
- Patch #126128 by chx and Steven: menu fixes and enhancements. Yay.
Diffstat (limited to 'modules/aggregator')
-rw-r--r-- | modules/aggregator/aggregator.module | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index 56add8a25..9601203ac 100644 --- a/modules/aggregator/aggregator.module +++ b/modules/aggregator/aggregator.module @@ -91,8 +91,7 @@ function aggregator_menu() { $items['aggregator/categories'] = array( 'title' => t('Categories'), 'page callback' => 'aggregator_page_categories', - 'access arguments' => array('access news feeds'), - 'type' => MENU_ITEM_GROUPING, + 'access callback' => '_aggregator_has_categories', ); $items['aggregator/rss'] = array( 'title' => t('RSS feed'), @@ -112,6 +111,7 @@ function aggregator_menu() { $items[$path] = array( 'title' => $category['title'], 'page callback' => 'aggregator_page_category', + 'access callback' => 'user_access', 'access arguments' => array('access news feeds'), ); $items[$path .'/view'] = array( @@ -181,6 +181,10 @@ function aggregator_init() { drupal_add_css(drupal_get_path('module', 'aggregator') .'/aggregator.css'); } +function _aggregator_has_categories() { + return user_access('access news feeds') && db_result(db_query('SELECT COUNT(*) FROM {aggregator_category}')); +} + function aggregator_admin_settings() { $items = array(0 => t('none')) + drupal_map_assoc(array(3, 5, 10, 15, 20, 25), '_aggregator_items'); $period = drupal_map_assoc(array(3600, 10800, 21600, 32400, 43200, 86400, 172800, 259200, 604800, 1209600, 2419200, 4838400, 9676800), 'format_interval'); |