Index: includes/menu.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/menu.inc,v retrieving revision 1.357 diff -u -p -r1.357 menu.inc --- includes/menu.inc 17 Oct 2009 11:39:15 -0000 1.357 +++ includes/menu.inc 29 Oct 2009 03:54:24 -0000 @@ -118,6 +118,11 @@ define('MENU_IS_LOCAL_TASK', 0x0080); define('MENU_IS_LOCAL_ACTION', 0x0100); /** + * Internal menu flag -- menu item represents a summary page. + */ +define('MENU_IS_SUMMARY_PAGE', 0x0120); + +/** * @} End of "Menu flags". */ @@ -138,6 +143,11 @@ define('MENU_IS_LOCAL_ACTION', 0x0100); define('MENU_NORMAL_ITEM', MENU_VISIBLE_IN_TREE | MENU_VISIBLE_IN_BREADCRUMB); /** + * @todo Document this. + */ +define('MENU_SUMMARY_PAGE', MENU_VISIBLE_IN_TREE | MENU_VISIBLE_IN_BREADCRUMB | MENU_IS_SUMMARY_PAGE); + +/** * Menu type -- A hidden, internal callback, typically used for API calls. * * Callbacks simply register a path so that the correct function is fired @@ -1188,7 +1198,10 @@ function menu_tree_page_data($menu_name, // Build an ordered array of links using the query result object. $links = array(); foreach ($query->execute() as $item) { - $links[] = $item; + // Do not show empty summary pages. + if (!($item['type'] & MENU_IS_SUMMARY_PAGE) || $item['has_children']) { + $links[] = $item; + } } $data['tree'] = menu_tree_data($links, $parents); $data['node_links'] = array(); Index: modules/system/system.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v retrieving revision 1.216 diff -u -p -r1.216 system.admin.inc --- modules/system/system.admin.inc 19 Oct 2009 23:28:40 -0000 1.216 +++ modules/system/system.admin.inc 29 Oct 2009 03:54:24 -0000 @@ -90,7 +90,9 @@ function system_admin_config_page() { WHERE ml.link_path != 'admin/help' AND menu_name = :menu_name AND ml.plid = :mlid AND hidden = 0", $admin, array('fetch' => PDO::FETCH_ASSOC)); foreach ($result as $item) { _menu_link_translate($item); - if (!$item['access']) { + // Do not show empty summary pages. + // @todo: Probably put this in a better place. + if (!$item['access'] || (($item['type'] & MENU_IS_SUMMARY_PAGE) && !$item['has_children'])) { continue; } // The link 'description' either derived from the hook_menu 'description' Index: modules/system/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.module,v retrieving revision 1.827 diff -u -p -r1.827 system.module --- modules/system/system.module 27 Oct 2009 04:16:39 -0000 1.827 +++ modules/system/system.module 29 Oct 2009 03:54:25 -0000 @@ -768,6 +768,7 @@ function system_menu() { 'weight' => 10, 'page callback' => 'system_admin_menu_block_page', 'access arguments' => array('access administration pages'), + 'type' => MENU_SUMMARY_PAGE, 'file' => 'system.admin.inc', ); $items['admin/config/development/maintenance'] = array( @@ -793,6 +794,7 @@ function system_menu() { 'weight' => 10, 'page callback' => 'system_admin_menu_block_page', 'access arguments' => array('access administration pages'), + 'type' => MENU_SUMMARY_PAGE, 'file' => 'system.admin.inc', ); $items['admin/config/media/file-system'] = array( @@ -816,6 +818,7 @@ function system_menu() { 'description' => 'Tools related to web services.', 'page callback' => 'system_admin_menu_block_page', 'access arguments' => array('access administration pages'), + 'type' => MENU_SUMMARY_PAGE, 'file' => 'system.admin.inc', ); $items['admin/config/services/rss-publishing'] = array( @@ -843,6 +846,7 @@ function system_menu() { 'weight' => -7, 'page callback' => 'system_admin_menu_block_page', 'access arguments' => array('access administration pages'), + 'type' => MENU_SUMMARY_PAGE, 'file' => 'system.admin.inc', ); $items['admin/config/regional/settings'] = array( @@ -942,6 +946,7 @@ function system_menu() { 'description' => 'Local site search, metadata and SEO.', 'page callback' => 'system_admin_menu_block_page', 'access arguments' => array('access administration pages'), + 'type' => MENU_SUMMARY_PAGE, 'file' => 'system.admin.inc', ); $items['admin/config/search/clean-urls'] = array( @@ -967,6 +972,7 @@ function system_menu() { 'weight' => 5, 'page callback' => 'system_admin_menu_block_page', 'access arguments' => array('access administration pages'), + 'type' => MENU_SUMMARY_PAGE, 'file' => 'system.admin.inc', ); $items['admin/config/system'] = array( @@ -976,6 +982,7 @@ function system_menu() { 'weight' => -5, 'page callback' => 'system_admin_menu_block_page', 'access arguments' => array('access administration pages'), + 'type' => MENU_SUMMARY_PAGE, 'file' => 'system.admin.inc', ); $items['admin/config/system/site-information'] = array( @@ -987,6 +994,16 @@ function system_menu() { 'file' => 'system.admin.inc', 'weight' => -10, ); + $items['admin/config/example'] = array( + 'title' => 'Example category', + 'description' => 'This category only shows up when you add items to it. If it is empty, it will not be displayed in the administrative area of your site, or in the Management menu.', + 'position' => 'right', + 'weight' => -5, + 'page callback' => 'system_admin_menu_block_page', + 'access arguments' => array('access administration pages'), + 'type' => MENU_SUMMARY_PAGE, + 'file' => 'system.admin.inc', + ); // Reports. $items['admin/reports'] = array( Index: modules/user/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.module,v retrieving revision 1.1073 diff -u -p -r1.1073 user.module --- modules/user/user.module 23 Oct 2009 22:24:19 -0000 1.1073 +++ modules/user/user.module 29 Oct 2009 03:54:25 -0000 @@ -1430,6 +1430,7 @@ function user_menu() { 'position' => 'right', 'page callback' => 'system_admin_menu_block_page', 'access arguments' => array('access administration pages'), + 'type' => MENU_SUMMARY_PAGE, 'file' => 'system.admin.inc', 'file path' => drupal_get_path('module', 'system'), );