Index: includes/menu.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/menu.inc,v retrieving revision 1.360 diff -u -p -r1.360 menu.inc --- includes/menu.inc 8 Nov 2009 12:30:35 -0000 1.360 +++ includes/menu.inc 9 Nov 2009 17:21:18 -0000 @@ -3126,7 +3126,13 @@ function _menu_router_build($callbacks) $file_path = $item['file path'] ? $item['file path'] : drupal_get_path('module', $item['module']); $item['include file'] = $file_path . '/' . $item['file']; } + // Build module to settings page relationship variable. + if (isset($item['settings']) && !empty($item['module'])) { + $system_settings_paths[$item['module']] = $item['path']; + } } + // Store system settings paths variable. + variable_set('system_settings_paths', $system_settings_paths); // Sort the masks so they are in order of descending fit. $masks = array_keys($masks); Index: modules/forum/forum.module =================================================================== RCS file: /cvs/drupal/drupal/modules/forum/forum.module,v retrieving revision 1.532 diff -u -p -r1.532 forum.module --- modules/forum/forum.module 8 Nov 2009 19:11:56 -0000 1.532 +++ modules/forum/forum.module 9 Nov 2009 17:18:25 -0000 @@ -77,6 +77,7 @@ function forum_menu() { $items['admin/structure/forum'] = array( 'title' => 'Forums', 'description' => 'Control forums and their hierarchy and change forum settings.', + 'settings' => TRUE, 'page callback' => 'drupal_get_form', 'page arguments' => array('forum_overview'), 'access arguments' => array('administer forums'), Index: modules/system/system.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v retrieving revision 1.220 diff -u -p -r1.220 system.admin.inc --- modules/system/system.admin.inc 8 Nov 2009 13:23:41 -0000 1.220 +++ modules/system/system.admin.inc 9 Nov 2009 17:36:22 -0000 @@ -691,6 +691,18 @@ function system_modules($form, $form_sta // Used when checking if module implements a help page. $help_arg = module_exists('help') ? drupal_help_arg() : FALSE; + // Retrieve module settings paths relationships. + $settings_paths = variable_get('system_settings_paths', array()); + $query = db_select('menu_links', 'ml') + $query->join('menu_router', 'm', 'ml.router_path = m.path'); + $settings_links = $query + ->fields('ml') + ->fields('m') + ->condition('module', 'system') + ->condition('ml.router_path', $settings_paths, 'IN') + ->execute() + ->fetchAllKeyed('router_path'); + // Iterate through each of the modules. foreach ($files as $filename => $module) { $extra = array(); @@ -725,6 +737,18 @@ function system_modules($form, $form_sta $extra['help'] = theme('more_help_link', array('url' => url("admin/help/$filename"))); } } + // Generate settings link for module's settings page, if there is one. + if (isset($settings_paths[$filename]) && isset($settings_links[$settings_paths[$filename]])) { + $settings_link = _menu_link_translate($settings_links[$settings_paths[$filename]]); + if ($settings_link['access']) { + $extra['settings'] = array( + '#type' => 'link', + '#title' => $settings_link['title'], + '#href' => $settings_link['path'], + '#options' => $settings_link['localized_options'], + ); + } + } // 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