Index: modules/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system.module,v retrieving revision 1.235 diff -u -r1.235 system.module --- modules/system.module 18 Sep 2005 10:37:57 -0000 1.235 +++ modules/system.module 20 Sep 2005 04:17:48 -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,74 @@ } } +function _system_adminpage () { + drupal_goto(variable_get('site_adminpage', 'admin/controlpanel'), NULL, 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 .= ''; + if (substr($menu_visible[$mid]['path'],6, 8) == 'settings') { + $file_name = 'misc/settings_' . substr($menu_visible[$mid]['path'],15) . '.png'; + } else { + $file_name = 'misc/' . substr($menu_visible[$mid]['path'],6) . '.png'; + } + if (file_exists($file_name)) { + $src = $file_name; + } else { + $src = 'misc/control_panel_default.png'; + } + $content .= '
'; + $content .= ''; + $content .= '
' . $menu_visible[$mid]['title']; + $content .= '
'; + $content .= '
'; + $content .= '
'; + } + $content .= '
'; + return $content; + } +} + +/** + * Menu callback: admin control panel. + */ +function system_admin_controlpanel() { + $content = ''; + $menu = menu_get_menu(); + $menu_visible = $menu['visible']; + + foreach ($menu_visible as $key => $row) { + foreach($row as $cell) { + if (!empty($cell) && ($cell == 'admin')) { + $admin_mid = $key; + } + if (!empty($cell) && ($cell == 'settings') && (empty($settings_mid))) { + $settings_mid = $key; + } + } + } + + $content .= '

' . t('control panel') . '

'; + $group .= _system_build_controlpanel($admin_mid); + $content .= form_group_collapsible(t('management'), $group, False); + + $group = _system_build_controlpanel($settings_mid); + $content .= form_group_collapsible(t('site configuration'), $group, TRUE); + + 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 +261,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.')); @@ -869,5 +944,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; +}