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 18 Sep 2005 12:39:18 -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,41 @@
}
}
+function _system_adminpage () {
+ drupal_goto($path = variable_get('site_adminpage', 'admin/controlpanel'), $query = NULL, $fragment = NULL);
+}
+
+/**
+ * Build the control panel items
+ */
+function _system_build_controlpanel($pid) {
+ $content = '';
+ $menu = menu_get_menu();
+ $menu_visible = $menu['visible'];
+
+ $content .= '
';
+ if (isset($menu_visible[$pid]) && $menu_visible[$pid]['children']) {
+ foreach ($menu_visible[$pid]['children'] as $mid) {
+ $content .= '
';
+ }
+ $content .= '
';
+ return $content;
+ }
+
+}
+
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 +228,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 +467,37 @@
}
/**
+ * Menu callback: admin control panel.
+ */
+function system_admin_controlpanel() {
+ $content = '';
+ $menu = menu_get_menu();
+ $menu_visible = $menu['visible'];
+
+ // find the key to the admin and settings menu item
+ foreach ($menu_visible as $key => $row) {
+ foreach($row as $cell) {
+ if (!empty($cell) && ($cell == 'admin')) {
+ $admin_mid = $key;
+ }
+ if (!empty($cell) && ($cell == 'settings')) {
+ $settings_mid = $key;
+ }
+ }
+ }
+
+ // Build admin control panel
+ $content .= '' . t('control panel') . '
';
+ $content .= _system_build_controlpanel($admin_mid);
+
+ // Build settings control panel
+ $group = _system_build_controlpanel($settings_mid);
+ $content .= form_group_collapsible(t('site configuration'), $group, TRUE);
+
+ return $content;
+}
+
+/**
* Returns an array of files objects of the given type from both the
* site-wide directory (i.e. modules/) and site-specific directory
* (i.e. sites/somesite/modules/). The returned array will be keyed
@@ -863,5 +936,3 @@
return form($form, 'post', null, array('enctype' => 'multipart/form-data'));
}
-
-
Index: misc/drupal.css
===================================================================
RCS file: /cvs/drupal/drupal/misc/drupal.css,v
retrieving revision 1.120
diff -u -r1.120 drupal.css
--- misc/drupal.css 7 Sep 2005 20:56:00 -0000 1.120
+++ misc/drupal.css 18 Sep 2005 12:41:08 -0000
@@ -628,4 +628,20 @@
* html.js fieldset.collapsible legend a {
display: block;
}
-
+.control-panel {
+ overflow: auto;
+ clear: both;
+}
+.control-panel-item {
+ float: left;
+ margin: 1em;
+ width: 60pt;
+ height: 60pt;
+}
+.control-panel-item div {
+ text-align: center;
+}
+.control-panel-item div img {
+ width: 48px;
+ height: 48px;
+}