? admin_page.patch ? cache.patch ? files ? modules/custom ? modules/devel ? sites/test.logrus.com Index: misc/drupal.css =================================================================== RCS file: /cvs/drupal/drupal/misc/drupal.css,v retrieving revision 1.151 diff -u -p -r1.151 drupal.css --- misc/drupal.css 30 Jun 2006 00:13:32 -0000 1.151 +++ misc/drupal.css 3 Jul 2006 22:55:49 -0000 @@ -674,3 +674,53 @@ html.js fieldset.collapsed legend a { display: block; padding: 1.5em 0 .5em; } + +/* +** formatting for administration page -- this should probably be its own file +*/ +div.admin-panel { + margin: 0px 0px 0px 0px; + padding: 5px 5px 15px 5px; +} + +div.admin-panel .desc { + margin: 0px 0px 3px; + padding: 2px 0 3px 0; + font-size: 10px; + line-height: 10px; + font-weight: normal; + text-align: left; + color: #999; + border-bottom: 1px solid #777777; +} + +div.admin-panel .body { + padding: 0 4px 2px 8px; + background-color: #f4f4f4; + line-height: 1.2em; +} + +div.admin-panel .head { + background-color: #6699CC; + color: #FFFFFF; + font-weight: bold; + font-size: 14px; + margin: 0px 0px 0px 0px; + padding: 4px 4px 4px 8px; +} + +div.admin { + padding-top: 15px; +} + +div.admin .left { + float: left; + width: 47%; + margin-left: 1em; +} +div.admin .right { + float: right; + width: 47%; + margin-right: 1em; +} + Index: modules/aggregator.module =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator.module,v retrieving revision 1.287 diff -u -p -r1.287 aggregator.module --- modules/aggregator.module 3 Jul 2006 08:04:33 -0000 1.287 +++ modules/aggregator.module 3 Jul 2006 22:55:51 -0000 @@ -1387,3 +1387,19 @@ function aggregator_filter_xss($value) { function _aggregator_items($count) { return format_plural($count, '1 item', '%count items'); } + +/** + * Implementation of hook_admin_info() + */ +function aggregator_admin_info($op) { + if ($op == 'content' && user_access('administer news feeds')) { + $items[] = array( + 'path' => 'admin/aggregator', + 'title' => t('aggregator'), + 'description' => t('Configure what outside content your site aggregates and makes available, how often it polls and how the content is categorized.'), + 'weight' => 0, + 'block' => 'content', + ); + return $items; + } +} Index: modules/block.module =================================================================== RCS file: /cvs/drupal/drupal/modules/block.module,v retrieving revision 1.210 diff -u -p -r1.210 block.module --- modules/block.module 2 Jul 2006 20:06:31 -0000 1.210 +++ modules/block.module 3 Jul 2006 22:55:51 -0000 @@ -691,3 +691,19 @@ function block_list($region) { } return $blocks[$region]; } + +/** + * Implementation of hook_admin_info() + */ +function block_admin_info($op) { + if ($op == 'content' && user_access('administer blocks')) { + $items[] = array( + 'path' => 'admin/block', + 'title' => t('blocks and regions'), + 'description' => t('Configure what block content appears in your site\'s sidebars and other regions.'), + 'weight' => -8, + 'block' => 'build_site', + ); + return $items; + } +} Index: modules/blogapi.module =================================================================== RCS file: /cvs/drupal/drupal/modules/blogapi.module,v retrieving revision 1.83 diff -u -p -r1.83 blogapi.module --- modules/blogapi.module 7 May 2006 00:08:36 -0000 1.83 +++ modules/blogapi.module 3 Jul 2006 22:55:52 -0000 @@ -735,3 +735,18 @@ function _blogapi_get_node_types() { return $types; } +/** + * Implementation of hook_admin_info() + */ +function blogapi_admin_info($op) { + if ($op == 'content' && user_access('administer site configuration')) { + $items[] = array( + 'path' => 'admin/settings/blogapi', + 'title' => t('blogapi settings'), + 'description' => t('Configure which content types external blog clients can use and what blog engine they use.'), + 'weight' => 0, + 'block' => 'config', + ); + return $items; + } +} Index: modules/book.module =================================================================== RCS file: /cvs/drupal/drupal/modules/book.module,v retrieving revision 1.371 diff -u -p -r1.371 book.module --- modules/book.module 3 Jul 2006 13:51:50 -0000 1.371 +++ modules/book.module 3 Jul 2006 22:55:53 -0000 @@ -1024,3 +1024,18 @@ function book_help($section) { } +/** + * Implementation of hook_admin_info() + */ +function book_admin_info($op) { + if ($op == 'content' && user_access('administer nodes')) { + $items[] = array( + 'path' => 'admin/node/book', + 'title' => t('books'), + 'description' => t('List books and control orphaned book pages.'), + 'weight' => 0, + 'block' => 'content', + ); + return $items; + } +} Index: modules/comment.module =================================================================== RCS file: /cvs/drupal/drupal/modules/comment.module,v retrieving revision 1.461 diff -u -p -r1.461 comment.module --- modules/comment.module 2 Jul 2006 20:24:17 -0000 1.461 +++ modules/comment.module 3 Jul 2006 22:55:55 -0000 @@ -1807,6 +1807,29 @@ function comment_invoke_comment(&$commen } /** + * Implementation of hook_admin_info() + */ +function comment_admin_info($op) { + if ($op == 'content' && user_access('administer comments')) { + $items[] = array( + 'path' => 'admin/comment', + 'title' => t('manage comments'), + 'description' => t('List site comments, comment moderation queue and edit comments.'), + 'weight' => -4, + 'block' => 'content', + ); + $items[] = array( + 'path' => 'admin/comment/configure', + 'title' => t('comment settings'), + 'description' => t('Configure global comment settings including threading style, comment display order, number of comments per page, whether users can control this, and more.'), + 'weight' => -10, + 'block' => 'content', + ); + return $items; + } +} + +/** * Generate vancode. * * Consists of a leading character indicating length, followed by N digits @@ -1831,3 +1854,4 @@ function int2vancode($i = 0) { function vancode2int($c = '00') { return base_convert(substr($c, 1), 36, 10); } + Index: modules/contact.module =================================================================== RCS file: /cvs/drupal/drupal/modules/contact.module,v retrieving revision 1.55 diff -u -p -r1.55 contact.module --- modules/contact.module 28 Jun 2006 21:47:03 -0000 1.55 +++ modules/contact.module 3 Jul 2006 22:55:55 -0000 @@ -559,3 +559,19 @@ function contact_mail_page_submit($form_ // Jump to home page rather than back to contact page to avoid contradictory messages if flood control has been activated. return(''); } + +/** + * Implementation of hook_admin_info() + */ +function contact_admin_info($op) { + if ($op == 'content' && user_access('administer site configuration')) { + $items[] = array( + 'path' => 'admin/contact', + 'title' => t('contact form'), + 'description' => t('Create a system contact form and set up categories for the form to use.'), + 'weight' => 0, + 'block' => 'build_site', + ); + return $items; + } +} Index: modules/drupal.module =================================================================== RCS file: /cvs/drupal/drupal/modules/drupal.module,v retrieving revision 1.122 diff -u -p -r1.122 drupal.module --- modules/drupal.module 5 Jun 2006 08:53:05 -0000 1.122 +++ modules/drupal.module 3 Jul 2006 22:55:56 -0000 @@ -391,3 +391,19 @@ function drupal_login($username, $passwo } } } + +/** + * Implementation of hook_admin_info() + */ +function drupal_admin_info($op) { + if ($op == 'content' && user_access('administer site configuration')) { + $items[] = array( + 'path' => 'admin/settings/drupal', + 'title' => t('drupal inter-site communication settings'), + 'description' => t('Allow your drupal installation to call home to drupal.org and/or use drupal.org logins to access your site.'), + 'weight' => 0, + 'block' => 'config', + ); + return $items; + } +} Index: modules/filter.module =================================================================== RCS file: /cvs/drupal/drupal/modules/filter.module,v retrieving revision 1.125 diff -u -p -r1.125 filter.module --- modules/filter.module 2 Jul 2006 20:06:31 -0000 1.125 +++ modules/filter.module 3 Jul 2006 22:55:57 -0000 @@ -1370,3 +1370,19 @@ function filter_xss_bad_protocol($string * @} End of "Standard filters". */ + +/** + * Implementation of hook_admin_info() + */ +function filter_admin_info($op) { + if ($op == 'content' && user_access('administer filters')) { + $items[] = array( + 'path' => 'admin/filters', + 'title' => t('input filtering'), + 'description' => t('Configure how content input by users is filtering, including allowed HTML tags, PHP code tags. Also allows enabling of module-provided filters.'), + 'weight' => 0, + 'block' => 'config', + ); + return $items; + } +} Index: modules/forum.module =================================================================== RCS file: /cvs/drupal/drupal/modules/forum.module,v retrieving revision 1.334 diff -u -p -r1.334 forum.module --- modules/forum.module 12 Jun 2006 03:44:54 -0000 1.334 +++ modules/forum.module 3 Jul 2006 22:55:58 -0000 @@ -1132,3 +1132,18 @@ function _forum_get_topic_order_sql($sor } +/** + * Implementation of hook_admin_info() + */ +function forum_admin_info($op) { + if ($op == 'content' && user_access('administer forums')) { + $items[] = array( + 'path' => 'admin/forum', + 'title' => t('forums'), + 'description' => t('Create forums and control forum behavior.'), + 'weight' => 0, + 'block' => 'content', + ); + return $items; + } +} Index: modules/locale.module =================================================================== RCS file: /cvs/drupal/drupal/modules/locale.module,v retrieving revision 1.136 diff -u -p -r1.136 locale.module --- modules/locale.module 7 May 2006 00:08:36 -0000 1.136 +++ modules/locale.module 3 Jul 2006 22:55:59 -0000 @@ -415,3 +415,19 @@ function locale_admin_string_delete($lid include_once './includes/locale.inc'; _locale_string_delete($lid); } + +/** + * Implementation of hook_admin_info() + */ +function locale_admin_info($op) { + if ($op == 'content' && user_access('administer locales')) { + $items[] = array( + 'path' => 'admin/locale', + 'title' => t('localization'), + 'description' => t('Configure site localization and UI translation.'), + 'weight' => 0, + 'block' => 'config', + ); + return $items; + } +} Index: modules/menu.module =================================================================== RCS file: /cvs/drupal/drupal/modules/menu.module,v retrieving revision 1.75 diff -u -p -r1.75 menu.module --- modules/menu.module 22 Jun 2006 09:50:57 -0000 1.75 +++ modules/menu.module 3 Jul 2006 22:56:00 -0000 @@ -761,3 +761,26 @@ function menu_parent_options($mid, $pid function menu_node_form_delete($node) { menu_delete_item(array('path' => 'node/'. $node->nid)); } + +/** + * Implementation of hook_admin_info() + */ +function menu_admin_info($op) { + if ($op == 'content' && user_access('administer menu')) { + $items[] = array( + 'path' => 'admin/menu', + 'title' => t('configure menu'), + 'description' => t('Control your site\'s navigation menu, create menu blocks, as well as rename and reorganize menu items.'), + 'weight' => -5, + 'block' => 'build_site', + ); + $items[] = array( + 'path' => 'admin/settings/menu', + 'title' => t('menu settings'), + 'description' => t('Configure primary menu (the horizontal menu on the top, usually) behavior, such as which menu block to use.'), + 'weight' => -5, + 'block' => 'build_site', + ); + return $items; + } +} Index: modules/node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node.module,v retrieving revision 1.652 diff -u -p -r1.652 node.module --- modules/node.module 3 Jul 2006 08:04:33 -0000 1.652 +++ modules/node.module 3 Jul 2006 22:56:02 -0000 @@ -2258,6 +2258,74 @@ function node_search_validate($form_id, } /** + * Implementation of hook_admin_info + */ +function node_admin_info($op) { + switch($op) { + case 'block': + $items['create_content'] = array( + 'title' => t('Content Creation'), + 'description' => t('This block contains tools to help you manage your site\'s content'), + 'position' => 'left', + 'weight' => -10, + ); + $items['content'] = array( + 'title' => t('Content Management'), + 'description' => t('This block contains tools to help you manage your site\'s content'), + 'position' => 'left', + 'weight' => -10, + ); + return $items; + case 'content': + if (user_access('administer nodes')) { + $items[] = array( + 'path' => 'admin/node', + 'title' => t('manage posts'), + 'description' => t('View and manage your site\'s content using filters'), + 'weight' => -5, + 'block' => 'content', + ); + $items[] = array( + 'path' => 'admin/settings/node', + 'title' => t('post settings'), + 'description' => t('Change behavior about posts such as teaser lengths, whether or not posts must be previewed before being submitted, and more'), + 'weight' => -10, + 'block' => 'content', + ); + $items[] = array( + 'path' => 'admin/settings/content-types', + 'title' => t('content type settings'), + 'description' => t('Change behavior about post behavior per content type, including default publication status, front page status, comment status, minimum word count and more.'), + 'weight' => -9, + 'block' => 'content', + ); + if (module_exist('search')) { + $items[] = array( + 'path' => 'admin/node/search', + 'title' => t('search posts'), + 'description' => t('Search your site\'s content'), + 'weight' => -4, + 'block' => 'content', + ); + } + foreach (node_get_types() as $type => $name) { + if (module_invoke(node_get_base($type), 'access', 'create', $type)) { + $items[] = array( + 'path' => "node/add/$type", + 'title' => $name, + 'description' => implode("\n", module_invoke_all('help', 'node/add#'. $type)), + 'weight' => 0, + 'block' => 'create_content' + ); + } + } + } + return $items; + } +} + + +/** * @defgroup node_access Node access rights * @{ * The node access system determines who can do what to which nodes. Index: modules/path.module =================================================================== RCS file: /cvs/drupal/drupal/modules/path.module,v retrieving revision 1.84 diff -u -p -r1.84 path.module --- modules/path.module 7 May 2006 00:08:36 -0000 1.84 +++ modules/path.module 3 Jul 2006 22:56:02 -0000 @@ -350,4 +350,19 @@ function path_form_submit() { } } +/** + * Implementation of hook_admin_info() + */ +function path_admin_info($op) { + if ($op == 'content' && user_access('administer url aliases')) { + $items[] = array( + 'path' => 'admin/path', + 'title' => t('url aliases'), + 'description' => t('Control how page URLs appear to users.'), + 'weight' => 0, + 'block' => 'build_site', + ); + return $items; + } +} Index: modules/profile.module =================================================================== RCS file: /cvs/drupal/drupal/modules/profile.module,v retrieving revision 1.157 diff -u -p -r1.157 profile.module --- modules/profile.module 2 Jul 2006 20:06:31 -0000 1.157 +++ modules/profile.module 3 Jul 2006 22:56:03 -0000 @@ -832,3 +832,19 @@ function profile_admin_settings_autocomp print drupal_to_js($matches); exit(); } + +/** + * Implementation of hook_admin_info() + */ +function profile_admin_info($op) { + if ($op == 'content' && user_access('administer users')) { + $items[] = array( + 'path' => 'admin/settings/profile', + 'title' => t('user profiles'), + 'description' => t('Add fields to your users that can be filled by them or by administrators.'), + 'weight' => 0, + 'block' => 'config', + ); + return $items; + } +} Index: modules/search.module =================================================================== RCS file: /cvs/drupal/drupal/modules/search.module,v retrieving revision 1.180 diff -u -p -r1.180 search.module --- modules/search.module 7 May 2006 04:39:31 -0000 1.180 +++ modules/search.module 3 Jul 2006 22:56:04 -0000 @@ -1263,3 +1263,19 @@ function theme_search_page($results, $ty return $output; } + +/** + * Implementation of hook_admin_info() + */ +function search_admin_info($op) { + if ($op == 'content' && user_access('administer search')) { + $items[] = array( + 'path' => 'admin/settings/search', + 'title' => t('search settings'), + 'description' => t('Configure relevance settings for search and other indexing options'), + 'weight' => 0, + 'block' => 'config', + ); + return $items; + } +} Index: modules/statistics.module =================================================================== RCS file: /cvs/drupal/drupal/modules/statistics.module,v retrieving revision 1.228 diff -u -p -r1.228 statistics.module --- modules/statistics.module 18 May 2006 14:58:57 -0000 1.228 +++ modules/statistics.module 3 Jul 2006 22:56:05 -0000 @@ -493,3 +493,46 @@ function statistics_nodeapi(&$node, $op, } +/** + * Implementation of hook_admin_info() + */ +function statistics_admin_info($op) { + if ($op == 'content' && user_access('access statistics')) { + $items[] = array( + 'path' => 'admin/logs/hits', + 'title' => t('recent hits'), + 'description' => t('View recent hits on the site.'), + 'weight' => 0, + 'block' => 'log', + ); + $items[] = array( + 'path' => 'admin/logs/pages', + 'title' => t('top pages'), + 'description' => t('View most hit pages on the site.'), + 'weight' => 0, + 'block' => 'log', + ); + $items[] = array( + 'path' => 'admin/logs/visitors', + 'title' => t('top visitors'), + 'description' => t('View which users visit the site most frequently.'), + 'weight' => 0, + 'block' => 'log', + ); + $items[] = array( + 'path' => 'admin/logs/referrers', + 'title' => t('top referrers'), + 'description' => t('View which sites refer traffic to your site.'), + 'weight' => 0, + 'block' => 'log', + ); + $items[] = array( + 'path' => 'admin/settings/statistics', + 'title' => t('statistics collection settings'), + 'description' => t('Enable access logging and control how long statistics information is retained.'), + 'weight' => -10, + 'block' => 'log', + ); + return $items; + } +} Index: modules/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system.module,v retrieving revision 1.329 diff -u -p -r1.329 system.module --- modules/system.module 27 Jun 2006 13:48:09 -0000 1.329 +++ modules/system.module 3 Jul 2006 22:56:07 -0000 @@ -31,7 +31,7 @@ function system_help($section) { case 'admin/modules#description': return t('Handles general site configuration for administrators.'); case 'admin': - return t('
Welcome to the administration section. Below are the most recent system events.
'); + return t('The administration section contains a control panel that allows you access to the entirety of the site\'s administration pages.
'); case 'admin/settings': return t('General configuration options for your site. Set up the name of the site, e-mail address used in mail-outs, clean URL options, caching, etc.
'); case 'admin/themes': @@ -103,7 +103,7 @@ function system_menu($may_cache) { $items[] = array('path' => 'admin', 'title' => t('administer'), 'access' => user_access('access administration pages'), - 'callback' => 'watchdog_overview', + 'callback' => 'system_administration_page', 'weight' => 9); // Themes: @@ -1273,3 +1273,261 @@ function confirm_form($form_id, $form, $ $form['actions']['cancel'] = array('#value' => l($no ? $no : t('Cancel'), $path)); return drupal_get_form($form_id, $form, 'confirm_form'); } + +/** + * Output the system administration page. This page uses the 'admin' hook + * to determine how to organize the system blocks. This creates a 2 + * column administration page that puts blocks in each column. + */ +function system_administration_page() { + $blocks = module_invoke_all('admin_info', 'block'); + +// $items = module_invoke_all('admin_info', 'content'); + foreach (module_implements('admin_info') as $module) { + $function = $module .'_admin_info'; + $items = $function('content'); + if (is_array($items)) { + foreach ($items as $item) { + if ($block = $item['block']) { + $blocks[$block]['items'][] = $item; + } + } + } + } + + foreach ($blocks as $id => $block) { + if ($block['items']) { + // first, sort the items + usort($block['items'], 'admin_item_sort'); + // then construct them and append to the content. + $blocks[$id]['content'] .= theme('admin_block_content', $block['items']); + } + } + + usort($blocks, 'admin_block_sort'); + return theme('admin_page', $blocks); +} + +/** + * Helper function to sort by weight, then title. + */ +function admin_item_sort($left, $right) { + if ($left['weight'] != $right['weight']) { + return $left['weight'] > $right['weight'] ? 1 : -1; + } + + return $left['title'] > $right['title'] ? 1 : -1; +} + +/** + * Helper function to sort by position, then weight, then title. + */ +function admin_block_sort($left, $right) { + if ($left['position'] != $right['position']) { + return $left['position'] > $right['position'] ? 1 : -1; + } + + if ($left['weight'] != $right['weight']) { + return $left['weight'] > $right['weight'] ? 1 : -1; + } + + return $left['title'] > $right['title'] ? 1 : -1; +} + +/** + * This function provides a form to control the settings of the + * administration page. + */ +function system_admin_page_settings() { + $themes = system_theme_data(); + ksort($themes); + $options[0] = t('System Default'); + foreach ($themes as $theme) { + $options[$theme->name] = $theme->name; + } + + $form['admin_theme'] = array( + '#type' => 'select', + '#options' => $options, + '#title' => t('Admin theme'), + '#description' => t('Choose which theme the administration pages should display in. If you choose "System Default" the administration pages theme will not be overridden.'), + '#default_value' => variable_get('admin_theme', 'bluemarine'), + ); + + $form['admin_expert_mode'] = array( + '#type' => 'checkbox', + '#title' => t('Expert mode'), + '#description' => t('Enable "expert mode" to compact the information on this page.'), + '#default_value' => variable_get('admin_expert_mode', FALSE), + ); + + $form['submit'] = array( + '#type' => 'submit', + '#value' => t('Submit'), + ); + return drupal_get_form('system_admin_page_form', $form); +} + +/** + * Function to submit the administration settings form. + */ +function system_admin_page_form_submit($formid, $form) { + variable_set('admin_theme', $form['admin_theme']); + variable_set('admin_expert_mode', $form['admin_expert_mode']); +} + +/** + * Implementation of hook_init. This hook will set the theme to the + * administrative theme if the user is looking at a page in the + * admin/* tree. + */ +function system_init() { + if (arg(0) == 'admin') { + global $custom_theme; + $custom_theme = variable_get('admin_theme', 'bluemarine'); + } +} + +/** + * Implementation of hook_administer_blocks + */ +function system_admin_info($op) { + switch ($op) { + case 'block': + $items['config'] = array( + 'title' => t('General Site Configuration'), + 'description' => t('This block contains some basic site configuration options'), + 'position' => 'right', + 'weight' => -10, + ); + $items['build_site'] = array( + 'title' => t('Site Building'), + 'description' => t('This block contains tools to help you build your site'), + 'position' => 'right', + 'weight' => -5, + ); + $items['admin_settings'] = array( + 'title' => t('Admin Settings'), + 'description' => t('This block contains settings for how your administrative pages should look'), + 'position' => 'left', + 'content' => system_admin_page_settings(), + 'weight' => 0, + ); + return $items; + case 'content': + if (user_access('administer site configuration')) { + $items[] = array( + 'path' => 'admin/settings', + 'title' => t('system settings'), + 'description' => t('Configure general system settings'), + 'weight' => -10, + 'block' => 'config', + ); + $items[] = array( + 'path' => 'admin/modules', + 'title' => t('system modules'), + 'description' => t('Configure system modules'), + 'weight' => -9, + 'block' => 'config', + ); + $items[] = array( + 'path' => 'admin/themes', + 'title' => t('site theme'), + 'description' => t('Change which theme your site uses or allows users to set.'), + 'weight' => -10, + 'block' => 'build_site', + ); + $items[] = array( + 'path' => 'admin/themes/settings', + 'title' => t('theme settings'), + 'description' => t('Change settings for your system\'s themes, such as the visibility of user pictures, author information and more.'), + 'weight' => -9, + 'block' => 'build_site', + ); + } + return $items; + } +} + +/** + * This themeable formats an administrative block for display. + * + * @param $block + * An array containing information about the block. It should + * include a 'title', a 'description' and a formatted 'content'. + * @themeable + */ +function theme_admin_block($block) { + // Don't display the block if it has no content to display. + if (!$block['content']) { + return; + } + + $output = <<< EOT +