Index: modules/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system.module,v
retrieving revision 1.234
diff -u -r1.234 system.module
--- modules/system.module 13 Sep 2005 19:12:19 -0000 1.234
+++ modules/system.module 16 Sep 2005 14:26:28 -0000
@@ -67,11 +67,17 @@
'access' => TRUE,
'type' => MENU_CALLBACK);
+ // Admin control panel
+ $items[] = array('path' => 'admin/controlpanel',
+ 'callback' => 'system_admin_controlpanel',
+ 'access' => TRUE,
+ 'type' => MENU_CALLBACK);
+
$access = user_access('administer site configuration');
$items[] = array('path' => 'admin', 'title' => t('administer'),
'access' => user_access('access administration pages'),
- 'callback' => 'watchdog_overview',
+ 'callback' => '_system_adminpage',
'weight' => 9);
// Themes:
@@ -167,6 +173,10 @@
}
}
+function _system_adminpage () {
+ drupal_goto($path = variable_get('site_adminpage', 'admin/controlpanel'), $query = NULL, $fragment = NULL);
+}
+
function _system_zonelist() {
$timestamp = time();
$zonelist = array(-11, -10, -9.5, -9, -8, -7, -6, -5, -4, -3.5, -3, -2, -1, 0, 1, 2, 3, 3.5, 4, 5, 5.5, 5.75, 6, 6.5, 7, 8, 9, 9.5, 10, 10.5, 11, 11.5, 12, 12.75, 13, 14);
@@ -187,6 +197,7 @@
$group .= form_textarea(t('Footer message'), 'site_footer', variable_get('site_footer', ''), 60, 5, t('This text will be displayed at the bottom of each page. Useful for adding a copyright notice to your pages.'));
$group .= form_textfield(t('Anonymous user'), 'anonymous', variable_get('anonymous', 'Anonymous'), 60, 70, t('The name used to indicate anonymous users.'));
$group .= form_textfield(t('Default front page'), 'site_frontpage', variable_get('site_frontpage', 'node'), 60, 70, t('The home page displays content from this relative URL. If you are not using clean URLs, specify the part after "?q=". If unsure, specify "node".'));
+ $group .= form_textfield(t('Default admin front page'), 'site_adminpage', variable_get('site_adminpage', 'admin/controlpanel'), 60, 70, t('The admin home page displays content from this relative URL. If you are not using clean URLs, specify the part after "?q=". If unsure, specify "admin/controlpanel".'));
// We check for clean URL support using an image on the client side.
$group .= form_radios(t('Clean URLs'), 'clean_url', variable_get('clean_url', 0), array(t('Disabled'), t('Enabled')), t('This option makes Drupal emit clean URLs (i.e. without ?q=
in the URL). You\'ll need ModRewrite
support for this to work. See the .htaccess
file in Drupal\'s top-level directory for more information.'));
@@ -425,6 +436,47 @@
}
/**
+ * Menu callback: admin control panel.
+ */
+function system_admin_controlpanel() {
+ $content = '';
+ $menu = menu_get_menu();
+ $menuvisible = $menu['visible'];
+
+ // find the key to the admin menu item
+ foreach ($menuvisible as $key => $row) {
+ foreach($row as $cell) {
+ if (!empty($cell) && ($cell == 'admin')) {
+ $pid = $key;
+ }
+ }
+ }
+
+ $content .= '