diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-08-11 11:52:46 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-08-11 11:52:46 +0000 |
commit | 735e532bee7482fc55b91dd39b1e629dfd9e1957 (patch) | |
tree | a2e07bd3f3346a24fc769d76d46eda2bc6d2ada0 /modules/system/system.admin.inc | |
parent | ef5c041534a4d3afcb382cc8bec646e725ee61c9 (diff) | |
download | brdo-735e532bee7482fc55b91dd39b1e629dfd9e1957.tar.gz brdo-735e532bee7482fc55b91dd39b1e629dfd9e1957.tar.bz2 |
- Patch #508458 by catch, Gábor Hojtsy, yoroy: created 'Configuration and modules' section so we can start moving over configuration items. Let's see how this goes ...
Diffstat (limited to 'modules/system/system.admin.inc')
-rw-r--r-- | modules/system/system.admin.inc | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc index bc2aba4f9..a52545286 100644 --- a/modules/system/system.admin.inc +++ b/modules/system/system.admin.inc @@ -59,6 +59,51 @@ function system_main_admin_page($arg = NULL) { } } +/** + * Menu callback; Provide the administration overview page. + */ +function system_admin_config_page() { + // Check for status report errors. + if (system_status(TRUE) && user_access('administer site configuration')) { + drupal_set_message(t('One or more problems were detected with your Drupal installation. Check the <a href="@status">status report</a> for more information.', array('@status' => url('admin/reports/status'))), 'error'); + } + $blocks = array(); + if ($admin = db_query("SELECT menu_name, mlid FROM {menu_links} WHERE link_path = 'admin/config' AND module = 'system'")->fetchAssoc()) { + $result = db_query(" + SELECT m.*, ml.* + FROM {menu_links} ml + INNER JOIN {menu_router} m ON ml.router_path = m.path + 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']) { + continue; + } + // The link 'description' either derived from the hook_menu 'description' + // or entered by the user via menu module is saved as the title attribute. + if (!empty($item['localized_options']['attributes']['title'])) { + $item['description'] = $item['localized_options']['attributes']['title']; + } + $block = $item; + $block['content'] = ''; + if ($item['block_callback'] && function_exists($item['block_callback'])) { + $function = $item['block_callback']; + $block['content'] .= $function(); + } + $block['content'] .= theme('admin_block_content', system_admin_menu_block($item)); + // Prepare for sorting as in function _menu_tree_check_access(). + // The weight is offset so it is always positive, with a uniform 5-digits. + $blocks[(50000 + $item['weight']) . ' ' . $item['title'] . ' ' . $item['mlid']] = $block; + } + } + if ($blocks) { + ksort($blocks); + return theme('admin_page', $blocks); + } + else { + return t('You do not have any administrative items.'); + } +} /** * Provide a single block from the administration menu as a page. |