diff options
Diffstat (limited to 'modules/aggregator/aggregator.module')
-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'); |