diff --git modules/block/block.info modules/block/block.info index ea3abf8..b70a657 100644 --- modules/block/block.info +++ modules/block/block.info @@ -2,6 +2,7 @@ name = Block description = Controls the visual building blocks a page is constructed with. Blocks are boxes of content rendered into an area, or region, of a web page. +settings_path = admin/structure/block package = Core version = VERSION core = 7.x diff --git modules/comment/comment.info modules/comment/comment.info index 278980a..c3512f7 100644 --- modules/comment/comment.info +++ modules/comment/comment.info @@ -2,6 +2,7 @@ name = Comment description = Allows users to comment on and discuss published content. +settings_path = admin/content/comment package = Core version = VERSION core = 7.x diff --git modules/contact/contact.info modules/contact/contact.info index 3686e7d..c8b3a48 100644 --- modules/contact/contact.info +++ modules/contact/contact.info @@ -1,6 +1,7 @@ ; $Id: contact.info,v 1.9 2009-06-08 09:23:51 dries Exp $ name = Contact description = Enables the use of both personal and site-wide contact forms. +settings_path = admin/structure/contact package = Core version = VERSION core = 7.x diff --git modules/menu/menu.info modules/menu/menu.info index 806facb..eead692 100644 --- modules/menu/menu.info +++ modules/menu/menu.info @@ -1,6 +1,7 @@ ; $Id: menu.info,v 1.9 2009-06-08 09:23:52 dries Exp $ name = Menu description = Allows administrators to customize the site navigation menu. +settings_path = admin/structure/menu/settings package = Core version = VERSION core = 7.x diff --git modules/node/node.info modules/node/node.info index 6a690d2..c64f888 100644 --- modules/node/node.info +++ modules/node/node.info @@ -1,6 +1,7 @@ ; $Id: node.info,v 1.12 2009-08-19 20:19:36 dries Exp $ name = Node description = Allows content to be submitted to the site and displayed on pages. +settings_path = admin/structure/types package = Core version = VERSION core = 7.x diff --git modules/path/path.info modules/path/path.info index 4503734..0028624 100644 --- modules/path/path.info +++ modules/path/path.info @@ -1,6 +1,7 @@ ; $Id: path.info,v 1.8 2009-06-08 09:23:53 dries Exp $ name = Path description = Allows users to rename URLs. +settings_path = admin/config/search/path package = Core version = VERSION core = 7.x diff --git modules/search/search.info modules/search/search.info index 4e2ae59..5a593b0 100644 --- modules/search/search.info +++ modules/search/search.info @@ -1,6 +1,7 @@ ; $Id: search.info,v 1.10 2009-08-29 10:46:41 dries Exp $ name = Search description = Enables site-wide keyword searching. +settings_path = admin/config/search/settings package = Core version = VERSION core = 7.x diff --git modules/shortcut/shortcut.info modules/shortcut/shortcut.info index 2176bdc..e5e053e 100644 --- modules/shortcut/shortcut.info +++ modules/shortcut/shortcut.info @@ -1,6 +1,7 @@ ; $Id: shortcut.info,v 1.1 2009-10-17 00:51:52 dries Exp $ name = Shortcut description = Allows users to manage customizable lists of shortcut links. +settings_path = admin/config/system/shortcut package = Core version = VERSION core = 7.x diff --git modules/system/system.admin.inc modules/system/system.admin.inc index 3d722f2..52eb390 100644 --- modules/system/system.admin.inc +++ modules/system/system.admin.inc @@ -697,8 +697,8 @@ function system_modules($form, $form_state = array()) { $form['modules'] = array('#tree' => TRUE); // Used when checking if module implements a help page. - $help_arg = module_exists('help') ? drupal_help_arg() : FALSE; - + $help_enabled = module_exists('help'); + $admin_permissions = user_access('administer permissions'); // Iterate through each of the modules. foreach ($files as $filename => $module) { $extra = array(); @@ -726,12 +726,11 @@ function system_modules($form, $form_state = array()) { } } } - // 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"))); - } + $extra['links'] = ''; + // Get links to permissions, settings, and help. + $links = _system_modules_operations_links($module, $admin_permissions, $help_enabled); + if (count($links)) { + $extra['links'] = theme('item_list', array('items' => $links)); } // Mark dependents disabled so the user cannot remove required modules. $dependents = array(); @@ -763,6 +762,7 @@ function system_modules($form, $form_state = array()) { t('Name'), t('Version'), t('Description'), + t('Operations'), ), ); } @@ -777,6 +777,51 @@ function system_modules($form, $form_state = array()) { } /** + * Build set of links for the Operations column on the modules page. + */ +function _system_modules_operations_links($module, $admin_permissions, $help_enabled) { + $links = array(); + if (!$module->status) { + // Non-enabled modules have no links. + return $links; + } + $tasks = array(); + // Generate link for module's help page, if there is one. + if ($help_enabled && in_array($module->name, module_implements('help'))) { + if (module_invoke($module->name, 'help', "admin/help#" . $module->name, drupal_help_arg())) { + // Module has a help page. + $tasks[] = array( + 'title' => t('More help'), + 'href' => 'admin/help/' . $module->name, + 'options' => array('attributes' => array('class' => 'module-help-link')), + ); + } + } + if (!empty($module->info['settings_path'])) { + // We always display the link even if it's a 403 so the user knows to + // configure permissions. + $tasks[] = array( + 'title' => t('Configure settings'), + 'href' => $module->info['settings_path'], + 'options' => array('attributes' => array('class' => 'module-settings-link'), 'html' => TRUE), + ); + } + if ($admin_permissions && in_array($module->name, module_implements('permission'))) { + $tasks[] = array( + 'title' => t('Configure permissions'), + 'href' => 'admin/config/people/permissions', + 'options' => array('fragment' => 'module-' . $module->name, 'attributes' => array('class' => 'module-permissions-link')), + ); + } + foreach ($tasks as $task) { + $task['options']['html'] = TRUE; + $task['options']['attributes']['title'] = $task['title']; + $links[] = l('' . $task['title'] . '', $task['href'], $task['options']); + } + return $links; +} + +/** * Array sorting callback; sorts modules or themes by their name. */ function system_sort_modules_by_info_name($a, $b) { @@ -793,7 +838,7 @@ function _system_modules_build_row($info, $extra) { 'required_by' => array(), 'disabled' => FALSE, 'enabled' => FALSE, - 'help' => '', + 'links' => '', ); $form = array( '#tree' => TRUE, @@ -852,12 +897,10 @@ function _system_modules_build_row($info, $extra) { $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. + $form['links'] = array( + '#markup' => $extra['links'], + ); return $form; } @@ -2318,14 +2361,8 @@ function theme_system_modules_fieldset($variables) { } $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 +2370,8 @@ function theme_system_modules_fieldset($variables) { $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; } diff --git modules/system/system.css modules/system/system.css index 6d1281a..64e6436 100644 --- modules/system/system.css +++ modules/system/system.css @@ -159,10 +159,21 @@ tr.merge-up, tr.merge-up td, tr.merge-up th { .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 th { 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; } diff --git modules/system/system.module modules/system/system.module index 41f5808..bcedf31 100644 --- modules/system/system.module +++ modules/system/system.module @@ -2078,6 +2078,7 @@ function _system_rebuild_module_data() { 'php' => DRUPAL_MINIMUM_PHP, 'files' => array(), 'bootstrap' => 0, + 'settings_path' => '', ); // Read info files for each module. diff --git modules/taxonomy/taxonomy.info modules/taxonomy/taxonomy.info index 41c857f..f97b6aa 100644 --- modules/taxonomy/taxonomy.info +++ modules/taxonomy/taxonomy.info @@ -1,6 +1,7 @@ ; $Id: taxonomy.info,v 1.10 2009-08-19 20:19:37 dries Exp $ name = Taxonomy description = Enables the categorization of content. +settings_path = admin/structure/taxonomy package = Core version = VERSION core = 7.x diff --git modules/update/update.info modules/update/update.info index a034139..6fcea25 100644 --- modules/update/update.info +++ modules/update/update.info @@ -1,6 +1,7 @@ ; $Id: update.info,v 1.8 2009-10-16 21:02:23 dries Exp $ name = Update manager description = Checks for available updates, and can securely install or update modules and themes via a web interface. +settings_path = admin/reports/updates/settings version = VERSION package = Core core = 7.x