? .project 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 17 Oct 2009 11:53:13 -0000 @@ -118,6 +118,11 @@ define('MENU_IS_LOCAL_TASK', 0x0080); define('MENU_IS_LOCAL_ACTION', 0x0100); /** + * Internal menu flag -- menu item is the default settings page. + */ +define('MENU_SETTINGS_DEFAULT', 0x0016); + +/** * @} End of "Menu flags". */ Index: modules/aggregator/aggregator.module =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.module,v retrieving revision 1.426 diff -u -p -r1.426 aggregator.module --- modules/aggregator/aggregator.module 12 Oct 2009 15:54:59 -0000 1.426 +++ modules/aggregator/aggregator.module 17 Oct 2009 11:53:14 -0000 @@ -92,6 +92,7 @@ function aggregator_menu() { 'page callback' => 'aggregator_admin_overview', 'access arguments' => array('administer news feeds'), 'file' => 'aggregator.admin.inc', + 'type' => MENU_NORMAL_ITEM, ); $items['admin/config/services/aggregator/add/feed'] = array( 'title' => 'Add feed', @@ -144,7 +145,7 @@ function aggregator_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('aggregator_admin_form'), 'access arguments' => array('administer news feeds'), - 'type' => MENU_LOCAL_TASK, + 'type' => MENU_LOCAL_TASK | MENU_SETTINGS_DEFAULT, 'file' => 'aggregator.admin.inc', ); $items['aggregator'] = array( Index: modules/block/block.module =================================================================== RCS file: /cvs/drupal/drupal/modules/block/block.module,v retrieving revision 1.392 diff -u -p -r1.392 block.module --- modules/block/block.module 17 Oct 2009 05:50:28 -0000 1.392 +++ modules/block/block.module 17 Oct 2009 11:53:16 -0000 @@ -82,6 +82,7 @@ function block_menu() { 'page arguments' => array($default_theme), 'access arguments' => array('administer blocks'), 'file' => 'block.admin.inc', + 'type' => MENU_NORMAL_ITEM | MENU_SETTINGS_DEFAULT, ); $items['admin/structure/block/list'] = array( 'title' => 'List', @@ -850,7 +851,7 @@ function _block_render_blocks($region_bl */ function _block_get_cache_id($block) { global $user; - + // User 1 being out of the regular 'roles define permissions' schema, // it brings too many chances of having unwanted output get in the cache // and later be served to other users. We therefore exclude user 1 from @@ -913,7 +914,7 @@ function template_preprocess_block(&$var /** * Implement hook_user_role_delete(). * - * Remove deleted role from blocks that use it. + * Remove deleted role from blocks that use it. */ function block_user_role_delete($role) { db_delete('block_role') Index: modules/book/book.module =================================================================== RCS file: /cvs/drupal/drupal/modules/book/book.module,v retrieving revision 1.519 diff -u -p -r1.519 book.module --- modules/book/book.module 15 Oct 2009 14:07:26 -0000 1.519 +++ modules/book/book.module 17 Oct 2009 11:53:17 -0000 @@ -117,7 +117,7 @@ function book_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('book_admin_settings'), 'access arguments' => array('administer site configuration'), - 'type' => MENU_LOCAL_TASK, + 'type' => MENU_LOCAL_TASK | MENU_SETTINGS_DEFAULT, 'weight' => 8, 'file' => 'book.admin.inc', ); Index: modules/filter/filter.module =================================================================== RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v retrieving revision 1.298 diff -u -p -r1.298 filter.module --- modules/filter/filter.module 16 Oct 2009 19:06:23 -0000 1.298 +++ modules/filter/filter.module 17 Oct 2009 11:53:20 -0000 @@ -76,6 +76,7 @@ function filter_menu() { 'page arguments' => array('filter_admin_overview'), 'access arguments' => array('administer filters'), 'file' => 'filter.admin.inc', + 'type' => MENU_NORMAL_ITEM | MENU_SETTINGS_DEFAULT, ); $items['admin/config/content/formats/list'] = array( 'title' => 'List', Index: modules/forum/forum.module =================================================================== RCS file: /cvs/drupal/drupal/modules/forum/forum.module,v retrieving revision 1.524 diff -u -p -r1.524 forum.module --- modules/forum/forum.module 15 Oct 2009 12:44:36 -0000 1.524 +++ modules/forum/forum.module 17 Oct 2009 11:53:21 -0000 @@ -610,7 +610,7 @@ function forum_block_view_pre_render($el */ function forum_form($node, $form_state) { $type = node_type_get_type($node); - + if (!empty($node->nid)) { $forum_terms = $node->taxonomy_forums; // If editing, give option to leave shadows Index: modules/help/help.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/help/help.admin.inc,v retrieving revision 1.11 diff -u -p -r1.11 help.admin.inc --- modules/help/help.admin.inc 13 Oct 2009 05:26:57 -0000 1.11 +++ modules/help/help.admin.inc 17 Oct 2009 11:53:21 -0000 @@ -38,7 +38,11 @@ function help_page($name) { $admin_tasks = system_get_module_admin_tasks($name); if (!empty($admin_tasks)) { ksort($admin_tasks); - $output .= theme('item_list', array('items' => $admin_tasks, 'title' => t('@module administration pages', array('@module' => $module['name'])))); + $admin_links = array(); + foreach ($admin_tasks as $task) { + $admin_links[] = l($task['title'], $task['path'], $task['options']); + } + $output .= theme('item_list', array('items' => $admin_links, 'title' => t('@module administration pages', array('@module' => $module['name'])))); } } Index: modules/image/image.module =================================================================== RCS file: /cvs/drupal/drupal/modules/image/image.module,v retrieving revision 1.22 diff -u -p -r1.22 image.module --- modules/image/image.module 16 Oct 2009 00:52:46 -0000 1.22 +++ modules/image/image.module 17 Oct 2009 11:53:23 -0000 @@ -80,6 +80,7 @@ function image_menu() { 'page callback' => 'image_style_list', 'access arguments' => array('administer image styles'), 'file' => 'image.admin.inc', + 'type' => MENU_NORMAL_ITEM | MENU_SETTINGS_DEFAULT, ); $items['admin/config/media/image-styles/list'] = array( 'title' => 'List', Index: modules/locale/locale.module =================================================================== RCS file: /cvs/drupal/drupal/modules/locale/locale.module,v retrieving revision 1.265 diff -u -p -r1.265 locale.module --- modules/locale/locale.module 16 Oct 2009 23:48:37 -0000 1.265 +++ modules/locale/locale.module 17 Oct 2009 11:53:25 -0000 @@ -93,6 +93,12 @@ function locale_help($path, $arg) { * Implement hook_menu(). */ function locale_menu() { + // Define main settings page. + $items['admin/config/regional'] = array( + 'title' => 'Regional and language', + 'description' => 'Regional settings, localization and translation.', + 'type' => MENU_SETTINGS_DEFAULT, + ); // Manage languages $items['admin/config/regional/language'] = array( 'title' => 'Languages', Index: modules/menu/menu.module =================================================================== RCS file: /cvs/drupal/drupal/modules/menu/menu.module,v retrieving revision 1.212 diff -u -p -r1.212 menu.module --- modules/menu/menu.module 17 Oct 2009 05:50:28 -0000 1.212 +++ modules/menu/menu.module 17 Oct 2009 11:53:26 -0000 @@ -80,7 +80,7 @@ function menu_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('menu_configure'), 'access arguments' => array('administer menu'), - 'type' => MENU_LOCAL_TASK, + 'type' => MENU_LOCAL_TASK | MENU_SETTINGS_DEFAULT, 'weight' => 5, 'file' => 'menu.admin.inc', ); Index: modules/path/path.module =================================================================== RCS file: /cvs/drupal/drupal/modules/path/path.module,v retrieving revision 1.171 diff -u -p -r1.171 path.module --- modules/path/path.module 15 Oct 2009 17:53:34 -0000 1.171 +++ modules/path/path.module 17 Oct 2009 11:53:27 -0000 @@ -39,6 +39,7 @@ function path_menu() { 'page callback' => 'path_admin_overview', 'access arguments' => array('administer url aliases'), 'file' => 'path.admin.inc', + 'type' => MENU_NORMAL_ITEM | MENU_SETTINGS_DEFAULT, ); $items['admin/config/search/path/edit/%path'] = array( 'title' => 'Edit alias', Index: modules/profile/profile.module =================================================================== RCS file: /cvs/drupal/drupal/modules/profile/profile.module,v retrieving revision 1.279 diff -u -p -r1.279 profile.module --- modules/profile/profile.module 10 Oct 2009 21:39:03 -0000 1.279 +++ modules/profile/profile.module 17 Oct 2009 11:53:29 -0000 @@ -90,6 +90,7 @@ function profile_menu() { 'page arguments' => array('profile_admin_overview'), 'access arguments' => array('administer users'), 'file' => 'profile.admin.inc', + 'type' => MENU_NORMAL_ITEM | MENU_SETTINGS_DEFAULT, ); $items['admin/config/people/profile/add'] = array( 'title' => 'Add field', Index: modules/search/search.module =================================================================== RCS file: /cvs/drupal/drupal/modules/search/search.module,v retrieving revision 1.319 diff -u -p -r1.319 search.module --- modules/search/search.module 9 Oct 2009 01:00:02 -0000 1.319 +++ modules/search/search.module 17 Oct 2009 11:53:29 -0000 @@ -195,7 +195,7 @@ function search_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('search_admin_settings'), 'access arguments' => array('administer search'), - 'type' => MENU_NORMAL_ITEM, + 'type' => MENU_NORMAL_ITEM | MENU_SETTINGS_DEFAULT, 'file' => 'search.admin.inc', ); $items['admin/config/search/settings/reindex'] = array( Index: modules/simpletest/simpletest.module =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/simpletest.module,v retrieving revision 1.77 diff -u -p -r1.77 simpletest.module --- modules/simpletest/simpletest.module 9 Oct 2009 01:00:03 -0000 1.77 +++ modules/simpletest/simpletest.module 17 Oct 2009 11:53:30 -0000 @@ -42,7 +42,7 @@ function simpletest_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('simpletest_settings_form'), 'access arguments' => array('administer unit tests'), - 'type' => MENU_LOCAL_TASK, + 'type' => MENU_LOCAL_TASK | MENU_SETTINGS_DEFAULT, 'file' => 'simpletest.pages.inc', ); $items['admin/config/development/testing/results/%'] = array( Index: modules/statistics/statistics.module =================================================================== RCS file: /cvs/drupal/drupal/modules/statistics/statistics.module,v retrieving revision 1.320 diff -u -p -r1.320 statistics.module --- modules/statistics/statistics.module 5 Sep 2009 13:49:28 -0000 1.320 +++ modules/statistics/statistics.module 17 Oct 2009 11:53:31 -0000 @@ -171,6 +171,7 @@ function statistics_menu() { 'page arguments' => array('statistics_settings_form'), 'access arguments' => array('administer statistics'), 'file' => 'statistics.admin.inc', + 'type' => MENU_NORMAL_ITEM | MENU_SETTINGS_DEFAULT, ); $items['user/%user/track/navigation'] = array( 'title' => 'Track page visits', Index: modules/system/system.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v retrieving revision 1.215 diff -u -p -r1.215 system.admin.inc --- modules/system/system.admin.inc 16 Oct 2009 19:20:34 -0000 1.215 +++ modules/system/system.admin.inc 17 Oct 2009 11:53:35 -0000 @@ -159,16 +159,24 @@ function system_admin_by_module() { // Only display a section if there are any available tasks. if (count($admin_tasks)) { + $admin_links = array(); // Check for help links. if ($help_arg && module_invoke($module, 'help', "admin/help#$module", $help_arg)) { - $admin_tasks[100] = l(t('Get help'), "admin/help/$module"); + $admin_tasks[100] = array( + 'title' => t('Get help'), + 'path' => "admin/help/$module", + 'options' => array('attributes' => array('class' => 'module-help-link')), + ); } // Sort. ksort($admin_tasks); - $menu_items[$info['name']] = array($info['description'], $admin_tasks); + foreach ($admin_tasks as $task) { + $admin_links[] = l($task['title'], $task['path'], $task['options']); + } + $menu_items[$info['name']] = array($info['description'], $admin_links); } } return theme('system_admin_by_module', array('menu_items' => $menu_items)); @@ -726,13 +734,31 @@ function system_modules($form, $form_sta } } } + $extra['links'] = array(); + $links = array(); + // Only get links to permission and default settings. + $admin_tasks = system_get_module_admin_tasks($module->name, FALSE); + foreach ($admin_tasks as $key => $task) { + // Build a link. + $task['options']['attributes']['title'] = isset($task['desription']) ? $task['desription'] : $task['title']; + // Link includes html. + $task['options']['html'] = TRUE; + if (!empty($task['options']['attributes']['class'])) { + $links[] = l('' . $task['title'] . '', $task['path'], $task['options']); + } + } // Generate link for module's help page, if there is one. if ($help_arg && $module->status && in_array($filename, module_implements('help'))) { if (module_invoke($filename, 'help', "admin/help#$filename", $help_arg)) { // Module has a help page. - $extra['help'] = theme('more_help_link', array('url' => url("admin/help/$filename"))); + $links[] = l('' . t('More help') . '', "admin/help/$filename", array('attributes' => array('class' => 'module-help-link', 'title' => t('More help')), 'html' => TRUE)); } } + $links = array_reverse($links, TRUE); + + if (count($links)) { + $extra['links'] = theme('item_list', array('items' => $links)); + } // Mark dependents disabled so the user cannot remove required modules. $dependents = array(); // If this module is required by other modules, list those, and then make it @@ -763,6 +789,7 @@ function system_modules($form, $form_sta t('Name'), t('Version'), t('Description'), + t('Operations'), ), ); } @@ -793,7 +820,7 @@ function _system_modules_build_row($info 'required_by' => array(), 'disabled' => FALSE, 'enabled' => FALSE, - 'help' => '', + 'extra' => array(), ); $form = array( '#tree' => TRUE, @@ -852,10 +879,10 @@ function _system_modules_build_row($info $form['description']['#markup'] .= theme('system_modules_incompatible', array('message' => $status_long)); } - // Show a "more help" link for modules that have them. - if ($extra['help']) { - $form['help'] = array( - '#markup' => $extra['help'], + // Show a set of useful links for modules that have them. + if (count($extra['links'])) { + $form['links'] = array( + '#markup' => $extra['links'], ); } return $form; @@ -2318,14 +2345,8 @@ function theme_system_modules_fieldset($ } $row[] = $label . '>' . drupal_render($module['name']) . ''; $row[] = drupal_render($module['version']); - $description = ''; - // If we have help, it becomes the first part - // of the description - with CSS, it is float: right'd. - if (isset($module['help'])) { - $description = '
' . drupal_render($module['help']) . '
'; - } // Add the description, along with any modules it requires. - $description .= drupal_render($module['description']); + $description = drupal_render($module['description']); if ($module['#requires']) { $description .= '
' . t('Requires: !module-list', array('!module-list' => implode(', ', $module['#requires']))) . '
'; } @@ -2333,6 +2354,8 @@ function theme_system_modules_fieldset($ $description .= '
' . t('Required by: !module-list', array('!module-list' => implode(', ', $module['#required_by']))) . '
'; } $row[] = array('data' => $description, 'class' => array('description')); + // Display links (such as help or permissions) in its own column. + $row[] = array('data' => drupal_render($module['links']), 'class' => array('operations')); $rows[] = $row; } Index: modules/system/system.css =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.css,v retrieving revision 1.63 diff -u -p -r1.63 system.css --- modules/system/system.css 21 Sep 2009 08:52:41 -0000 1.63 +++ modules/system/system.css 17 Oct 2009 11:53:36 -0000 @@ -159,10 +159,21 @@ tr.merge-up, tr.merge-up td, tr.merge-up .more-help-link { text-align: right; /* LTR */ } -.more-help-link a { +.more-help-link a, a.module-help-link { padding: 1px 0 1px 20px; /* LTR */ background: url(../../misc/help.png) 0 50% no-repeat; /* LTR */ } +a.module-help-link, a.module-permissions-link, a.module-settings-link { + padding: 1px 0 1px 26px; /* LTR */ + display: block; + height: 16px; +} +a.module-permissions-link { + background: url(../../misc/permissions.png) 0 50% no-repeat; /* LTR */ +} +a.module-settings-link { + background: url(../../misc/settings.png) 0 50% no-repeat; /* LTR */ +} .more-link { text-align: right; /* LTR */ } @@ -170,6 +181,17 @@ tr.merge-up, tr.merge-up td, tr.merge-up margin-left: 1em; /* LTR */ float: right; /* LTR */ } +td.operations { + clear: both; + width: 85px; +} +.operations .item-list ul li { + float: right; + margin: 0 0 0 ; +} +.operations .item-list ul li.last { + margin-left: 0; +} .nowrap { white-space: nowrap; } Index: modules/system/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.module,v retrieving revision 1.820 diff -u -p -r1.820 system.module --- modules/system/system.module 17 Oct 2009 05:50:29 -0000 1.820 +++ modules/system/system.module 17 Oct 2009 11:54:18 -0000 @@ -2551,13 +2551,20 @@ function system_admin_compact_page($mode * * @param $module * Module name. + * @param $all_tasks + * If TRUE return all task links provided by this module. + * If this is set to FALSE only links to permission and links marked as + * MENU_SETTINGS_DEFAULT are returned. * @return * An array of task links. */ -function system_get_module_admin_tasks($module) { +function system_get_module_admin_tasks($module, $all_tasks = TRUE) { $items = &drupal_static(__FUNCTION__, array()); + $admin_access = user_access('administer permissions'); + $admin_tasks = array(); + $admin_task_count = 0; - if (empty($items)) { + if (!$all_tasks || empty($items)) { $result = db_query(" SELECT m.load_functions, m.to_arg_functions, m.access_callback, m.access_arguments, m.page_callback, m.page_arguments, m.delivery_callback, m.title, m.title_callback, m.title_arguments, m.theme_callback, m.theme_arguments, m.type, ml.* FROM {menu_links} ml INNER JOIN {menu_router} m ON ml.router_path = m.path WHERE ml.link_path LIKE 'admin/%' AND hidden >= 0 AND module = 'system' AND m.number_parts > 2", array(), array('fetch' => PDO::FETCH_ASSOC)); @@ -2569,19 +2576,35 @@ function system_get_module_admin_tasks($ } } - $admin_access = user_access('administer permissions'); - $admin_tasks = array(); - $admin_task_count = 0; // Check for permissions. if (in_array($module, module_implements('permission')) && $admin_access) { - $admin_tasks[-1] = l(t('Configure permissions'), 'admin/config/people/permissions', array('fragment' => 'module-' . $module)); + $admin_tasks[-1] = array( + 'title' => t('Configure permissions'), + 'path' => 'admin/config/people/permissions', + 'options' => array('fragment' => 'module-' . $module, 'attributes' => array('class' => 'module-permissions-link')), + ); } // Check for menu items that are admin links. if (in_array($module, module_implements('menu')) && $menu = module_invoke($module, 'menu')) { - foreach (array_keys($menu) as $path) { - if (isset($items[$path])) { - $admin_tasks[$items[$path]['title'] . $admin_task_count ++] = l($items[$path]['title'], $path); + foreach ($menu as $path => $item) { + if ($all_tasks && isset($items[$path])) { + $class = (strpos($path, 'admin/config') !== FALSE) ? 'module-settings-link' : ''; + $admin_tasks[$items[$path]['title'] . $admin_task_count ++] = array( + 'title' => $items[$path]['title'], + 'path' => $path, + 'options' => array('attributes' => array('class' => $class)), + ); + } + elseif ($all_tasks == FALSE) { + if (isset($item['type']) && (($item['type'] & MENU_SETTINGS_DEFAULT) == MENU_SETTINGS_DEFAULT)) { + $admin_tasks[$item['title'] . $admin_task_count ++] = array( + 'title' => $item['title'], + 'description' => isset($item['description']) ? $item['description'] : '', + 'path' => $path, + 'options' => array('attributes' => array('class' => 'module-settings-link')), + ); + } } } } Index: modules/update/update.module =================================================================== RCS file: /cvs/drupal/drupal/modules/update/update.module,v retrieving revision 1.50 diff -u -p -r1.50 update.module --- modules/update/update.module 15 Oct 2009 21:19:31 -0000 1.50 +++ modules/update/update.module 17 Oct 2009 11:54:20 -0000 @@ -161,7 +161,7 @@ function update_menu() { 'page arguments' => array('update_settings'), 'access arguments' => array('administer site configuration'), 'file' => 'update.settings.inc', - 'type' => MENU_LOCAL_TASK, + 'type' => MENU_LOCAL_TASK | MENU_SETTINGS_DEFAULT, 'weight' => 50, ); $items['admin/reports/updates/check'] = array( Index: modules/upload/upload.module =================================================================== RCS file: /cvs/drupal/drupal/modules/upload/upload.module,v retrieving revision 1.264 diff -u -p -r1.264 upload.module --- modules/upload/upload.module 13 Oct 2009 21:16:44 -0000 1.264 +++ modules/upload/upload.module 17 Oct 2009 11:54:21 -0000 @@ -98,7 +98,7 @@ function upload_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('upload_admin_settings'), 'access arguments' => array('administer site configuration'), - 'type' => MENU_NORMAL_ITEM, + 'type' => MENU_NORMAL_ITEM | MENU_SETTINGS_DEFAULT, 'file' => 'upload.admin.inc', ); return $items; Index: modules/user/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.module,v retrieving revision 1.1067 diff -u -p -r1.1067 user.module --- modules/user/user.module 16 Oct 2009 15:54:33 -0000 1.1067 +++ modules/user/user.module 17 Oct 2009 11:54:26 -0000 @@ -1420,6 +1420,7 @@ function user_menu() { 'access arguments' => array('access administration pages'), 'file' => 'system.admin.inc', 'file path' => drupal_get_path('module', 'system'), + 'type' => MENU_NORMAL_ITEM | MENU_SETTINGS_DEFAULT, ); $items['admin/config/people/accounts'] = array( 'title' => 'Account settings', Index: themes/seven/style.css =================================================================== RCS file: /cvs/drupal/drupal/themes/seven/style.css,v retrieving revision 1.19 diff -u -p -r1.19 style.css --- themes/seven/style.css 17 Oct 2009 01:15:40 -0000 1.19 +++ themes/seven/style.css 17 Oct 2009 11:54:26 -0000 @@ -430,6 +430,10 @@ table tr.selected td { border-color: #eeb; } +#system-modules table td { + vertical-align: baseline; +} + /** * Forms. */