Index: modules/admin/admin-links.tpl.php
===================================================================
RCS file: modules/admin/admin-links.tpl.php
diff -N modules/admin/admin-links.tpl.php
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ modules/admin/admin-links.tpl.php 8 Jun 2009 05:37:04 -0000
@@ -0,0 +1,26 @@
+
+
+
+
+
+
Index: modules/admin/admin-toolbar.tpl.php
===================================================================
RCS file: modules/admin/admin-toolbar.tpl.php
diff -N modules/admin/admin-toolbar.tpl.php
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ modules/admin/admin-toolbar.tpl.php 8 Jun 2009 05:37:04 -0000
@@ -0,0 +1,36 @@
+ 0 links should be collapsed.
+ * - $tree_0: Admin menu links at depth 0.
+ * - $tree_1: Admin menu links at depth 1.
+ *
+ * @see template_preprocess()
+ * @see template_preprocess_admin_toolbar()
+ */
+?>
+
Index: modules/admin/admin.info
===================================================================
RCS file: modules/admin/admin.info
diff -N modules/admin/admin.info
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ modules/admin/admin.info 8 Jun 2009 05:37:04 -0000
@@ -0,0 +1,7 @@
+; $Id$
+name = "Admin"
+description = "Drupal administration UI helpers. Includes: admin menu, contextual administration links, admin theme."
+package = "Administration"
+core = "7.x"
+version = "7.0-dev"
+files[] = "admin.module"
Index: modules/admin/admin.module
===================================================================
RCS file: modules/admin/admin.module
diff -N modules/admin/admin.module
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ modules/admin/admin.module 8 Jun 2009 05:37:05 -0000
@@ -0,0 +1,249 @@
+ array(
+ 'title' => t('Use admin menu'),
+ 'description' => t('Access the persistent administration menu at the top of each page.'),
+ ),
+ 'admin inline' => array(
+ 'title' => t('Use inline admin links'),
+ 'description' => t('Access inline administrative links on nodes, blocks, and other page components.'),
+ ),
+ );
+}
+
+/**
+ * Implementation of hook_theme().
+ */
+function admin_theme($cache, $type, $theme, $path) {
+ $items = array();
+ $items['admin_toolbar'] = array(
+ 'arguments' => array('tree' => array()),
+ 'template' => 'admin-toolbar',
+ 'path' => drupal_get_path('module', 'admin'),
+ 'file' => 'theme.inc',
+ );
+ $items['admin_links'] = array(
+ 'arguments' => array('admin_links' => array()),
+ 'template' => 'admin-links',
+ 'path' => drupal_get_path('module', 'admin'),
+ 'file' => 'theme.inc',
+ );
+ return $items;
+}
+
+/**
+ * Wrapper to check whether various admin features are accessible to the
+ * current user and compatible with the current theme.
+ */
+function admin_is_enabled($op = 'admin menu') {
+ if (user_access($op)) {
+ global $theme_info;
+ // If the theme does not specify some flag for this feature, assume it is compatible.
+ if (!isset($theme_info->info['admin'][$op]) || (isset($theme_info->info['admin'][$op]) && !empty($theme_info->info['admin'][$op]))) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+/**
+ * An implementation of hook_node_view().
+ */
+function admin_node_view(&$node, $teaser) {
+ if (admin_is_enabled('admin inline')) {
+ $links = array();
+ if (node_access('update', $node)) {
+ $links['node-edit'] = array(
+ 'title' => t('Edit'),
+ 'href' => "node/{$node->nid}/edit",
+ 'attributes' => array('class' => 'icon-edit'),
+ 'query' => array('destination' => $_GET['q']),
+ );
+ }
+ if (node_access('delete', $node)) {
+ $links['node-delete'] = array(
+ 'title' => t('Delete'),
+ 'href' => "node/{$node->nid}/delete",
+ 'attributes' => array('class' => 'icon-delete'),
+ 'query' => array('destination' => $_GET['q']),
+ );
+ }
+ $node->content['admin'] = array(
+ '#theme' => 'admin_links',
+ '#admin_links' => $links,
+ );
+ }
+}
+
+/**
+ * Implementation of hook_page_alter().
+ */
+function admin_page_alter(&$page) {
+ if (admin_is_enabled('admin menu')) {
+ $links = admin_menu_tree();
+ $page['admin']['admin_menu']['#tree'] = $links;
+ $page['admin']['admin_menu']['#theme'] = 'admin_toolbar';
+ }
+}
+
+/**
+ * Implementation of hook_preprocess_page().
+ */
+function admin_preprocess_page(&$vars) {
+ if (system_use_admin_theme()) {
+ $vars['primary_nav'] = admin_navigation_primary();
+ $vars['secondary_nav'] = admin_navigation_secondary();
+ }
+}
+
+/**
+ * Helper for returning a selectively flattened version of the admin menu.
+ */
+function admin_get_menu_tree($method = 'all', $reset = FALSE) {
+ $tree = ($method == 'all') ? menu_tree_all_data('management') : menu_tree_page_data('management');
+ foreach ($tree as $k => $item) {
+ if ($item['link']['link_path'] == 'admin' && !empty($item['below'])) {
+ unset($tree[$k]);
+ $tree = array_merge($tree, $item['below']);
+ }
+ }
+ return $tree;
+}
+
+/**
+ * Retrieve a hierarchy of links representing select portions of the
+ * 'admin' branch of the navigation menu.
+ */
+function admin_menu_tree() {
+ $links = array();
+ // Retrieve the admin menu from the database.
+ $tree = admin_get_menu_tree();
+ admin_menu_tree_links($tree, $links);
+
+ // Add user-specific links
+ global $user;
+ $user_links = array();
+ $user_links[] = array(
+ 'title' => t('Hello !username', array('!username' => $user->name)),
+ 'href' => 'user',
+ 'html' => TRUE
+ );
+ $user_links[] = array('title' => t('Logout'), 'href' => "logout");
+ $links[0]['user'] = $user_links;
+
+ return $links;
+}
+
+/**
+ * Generate a links array from a menu tree array.
+ */
+function admin_menu_navigation_links($tree, $admin_only = FALSE) {
+ $links = array();
+ foreach ($tree as $item) {
+ if (!$item['link']['hidden'] && (!$admin_only || !empty($item['link']['options']['admin']))) {
+ $class = '';
+ $id = str_replace('/', '-', $item['link']['href']);
+
+ $l = $item['link']['localized_options'];
+ $l['href'] = $item['link']['href'];
+ $l['title'] = "". $item['link']['title'];
+ $l['attributes'] = array('id' => 'admin-link-'. $id);
+ $l['html'] = TRUE;
+
+ $class = ' path-'. $id;
+ if (admin_in_active_trail($item['link']['href'])) {
+ $class .= ' active-trail';
+ }
+ // Keyed with the unique mlid to generate classes in theme_links().
+ $links['menu-'. $item['link']['mlid'] . $class] = $l;
+ }
+ }
+ return $links;
+}
+
+/**
+ * Build a hierarchy of $links arrays suitable for theme_links() from a
+ * menu tree.
+ */
+function admin_menu_tree_links($tree, &$links, $parent = 'admin', $depth = 0) {
+ // Create a single level of links.
+ $links[$depth][$parent] = array();
+ $l = admin_menu_navigation_links($tree, TRUE);
+ if (!empty($l)) {
+ $links[$depth][$parent] = $l;
+ }
+
+ // Recurse
+ foreach ($tree as $item) {
+ if (!$item['link']['hidden'] && !empty($item['link']['options']['admin'])) {
+ if (!empty($item['below'])) {
+ admin_menu_tree_links($item['below'], $links, $item['link']['href'], $depth + 1);
+ }
+ }
+ }
+}
+
+/**
+ * Checks whether an item is in the active trail. Useful when using
+ * a menu generated by menu_tree_all_data() which does not set the
+ * 'in_active_trail' flag on items.
+ */
+function admin_in_active_trail($path) {
+ $active_paths = &drupal_static(__FUNCTION__);
+
+ // Gather active paths
+ if (!isset($active_paths)) {
+ $active_paths = array();
+ $trail = menu_get_active_trail();
+ foreach ($trail as $item) {
+ if (!empty($item['href'])) {
+ $active_paths[] = $item['href'];
+ }
+ }
+ }
+ return in_array($path, $active_paths);
+}
+
+/**
+ * Generate the 1st level of navigation links under 'admin'.
+ */
+function admin_navigation_primary() {
+ $tree = admin_get_menu_tree();
+ return admin_menu_navigation_links($tree);
+}
+
+/**
+ * Generate the 2nd level of navigation links under 'admin/*'.
+ */
+function admin_navigation_secondary() {
+ $item = menu_get_item();
+
+ // Check that this is not a menu overview page.
+ // We don't want to duplicate UI components.
+ if ($item['page_callback'] !== 'system_admin_menu_block_page') {
+ $tree = admin_get_menu_tree('page');
+ foreach ($tree as $item) {
+ if (admin_in_active_trail($item['link']['href']) && !empty($item['below'])) {
+ return admin_menu_navigation_links($item['below']);
+ }
+ }
+ }
+ return NULL;
+}
Index: modules/admin/admin_toolbar.css
===================================================================
RCS file: modules/admin/admin_toolbar.css
diff -N modules/admin/admin_toolbar.css
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ modules/admin/admin_toolbar.css 8 Jun 2009 05:37:05 -0000
@@ -0,0 +1,278 @@
+/* $Id: admin_toolbar.css,v 1.1.2.1 2009/06/05 07:11:13 yhahn Exp $ */
+
+/**
+ * Aggressive resets so we can achieve a consistent look in
+ * hostile CSS environments.
+ */
+div.admin-links,
+div#admin-toolbar,
+div#admin-toolbar * {
+ margin:0px;
+ padding:0px;
+ border:0px;
+ outline:0px;
+ font-size:100%;
+ vertical-align:baseline;
+ line-height:inherit;
+ text-align:left;
+}
+
+/**
+ * Inline/contextual tools
+ */
+div.block,
+div.node,
+div.view,
+div.view-data-node-body { position:relative; }
+
+div.block div.view { position:static; }
+
+div.admin-inline { display:none; }
+
+div.admin-border {
+ opacity:.25;
+ position:absolute;
+ left:-10px;
+ right:-10px;
+ top:-10px;
+ bottom:-10px;
+ height:10px;
+ width:10px;
+ background:#666;
+ }
+
+ div.admin-border-top {
+ left:0px; right:0px;
+ width:auto;
+ bottom:auto;
+ }
+
+ div.admin-border-bottom {
+ left:0px; right:0px;
+ width:auto;
+ top:auto;
+ }
+
+ div.admin-border-left {
+ height:auto;
+ right:auto;
+
+ -moz-border-radius-topleft:5px;
+ -moz-border-radius-bottomleft:5px;
+ -webkit-border-top-left-radius:5px;
+ -webkit-border-bottom-left-radius-:5px;
+ }
+
+ div.admin-border-right {
+ height:auto;
+ left:auto;
+
+ -moz-border-radius-topright:5px;
+ -moz-border-radius-bottomright:5px;
+ -webkit-border-top-right-radius:5px;
+ -webkit-border-bottom-right-radius-:5px;
+ }
+
+div.admin-links {
+ -moz-border-radius-topleft:5px;
+ -moz-border-radius-topright:5px;
+ -webkit-border-top-left-radius:5px;
+ -webkit-border-top-right-radius:5px;
+
+ font:normal 11px/20px "Lucida Grande",Verdana,sans-serif !important;
+ background:#444 url(sprite.png) 0px -110px repeat-x !important;
+
+ position:absolute;
+ top:-25px;
+ right:0px;
+
+ z-index:100;
+ height:25px;
+ line-height:25px;
+ overflow:hidden;
+ }
+
+ div.view:hover div.node div.admin-inline,
+ div.block:hover div.node div.admin-inline { display:none; }
+
+ div.view:hover div.node:hover div.admin-inline,
+ div.block:hover div.node:hover div.admin-inline { display:block; }
+
+ div.view:hover div.admin-inline,
+ div.block:hover div.admin-inline,
+ div.node:hover div.admin-inline { display:block; }
+
+div.admin-links a,
+div.admin-links a:hover {
+ background-color:transparent !important;
+ background-image:url(sprite.png);
+ background-repeat:no-repeat;
+ background-position:25px 25px;
+
+ color:#fff !important;
+ text-transform:none !important;
+ font-weight:normal !important;
+ font-style:normal !important;
+ float:left !important;
+ padding:0px 10px 0px 25px;
+ line-height:25px !important;
+ }
+
+ div.admin-links a.icon-delete { background-position:-215px -135px; }
+ div.admin-links a.icon-edit { background-position:-215px -160px; }
+ div.admin-links a.icon-configure { background-position:-215px -185px; }
+
+/**
+ * Base styles
+ */
+div#admin-toolbar {
+ font:normal 11px/20px "Lucida Grande",Verdana,sans-serif;
+ background:url(sprite.png) 0px -20px repeat-x;
+ color:#ccc;
+ position:relative;
+ z-index:100;
+ }
+
+div#admin-toolbar .collapsed { display:none; }
+
+div#admin-toolbar div.shadow {
+ position:absolute;
+ left:0px;
+ right:0px;
+ bottom:-10px;
+ height:10px;
+
+ background:url(sprite.png) 0px -100px repeat-x;
+ }
+
+div#admin-toolbar a {
+ text-decoration:none;
+ color:#fff;
+ }
+
+div#admin-toolbar ul.links li,
+div#admin-toolbar ul.links li a { float:left; }
+
+/**
+ * First level menus
+ */
+div#admin-toolbar div.depth-0 {
+ overflow:hidden;
+ height:20px;
+ line-height:20px;
+ padding:5px 10px;
+ }
+
+div#admin-toolbar div.depth-0 #admin-toolbar-admin { float:left; }
+div#admin-toolbar div.depth-0 #admin-toolbar-user { float:right; }
+
+div#admin-toolbar div.depth-0 ul.links li a {
+ -moz-border-radius:10px;
+ -webkit-border-radius:10px;
+ padding:0px 10px;
+ }
+
+div#admin-toolbar div.depth-0 ul.links li a.active {
+ text-shadow:#333 0px 1px 0px;
+ background:url(sprite.png) 0px 0px repeat-x;
+ }
+
+/**
+ * Second level menus
+ */
+div#admin-toolbar div.depth-1 {
+ position:relative;
+ padding:0px 10px;
+ }
+
+div#admin-toolbar div.depth-1 span.close {
+ position:absolute;
+ top:10px;
+ right:10px;
+
+ cursor:pointer;
+ background:url(sprite.png) 0px -135px no-repeat;
+ text-indent:-9999px;
+ overflow:hidden;
+
+ width:15px;
+ height:15px;
+ }
+
+div#admin-toolbar div.depth-1 ul.links {
+ padding:5px 0px;
+ height:40px;
+ line-height:30px;
+ overflow:hidden;
+ float:left;
+ }
+
+div#admin-toolbar div.depth-1 ul.links li a {
+ -moz-border-radius:10px;
+ -webkit-border-radius:10px;
+ padding:5px 10px 5px 5px;
+ margin-right:5px;
+ }
+
+div#admin-toolbar div.depth-1 ul.links li a.active {
+ background-color:#333;
+ }
+
+div#admin-toolbar div.depth-1 span.icon {
+ float:left;
+
+ width:30px;
+ height:30px;
+ margin-right:5px;
+ }
+
+/**
+ * Icon classes
+ */
+ul.menu span.icon,
+ul.admin-list span.icon,
+ul.links span.icon { background:transparent url(icons.png) -30px 0px no-repeat; }
+
+div.depth-1 span.icon { background:transparent url(icons.png) 0px 0px no-repeat; }
+
+.path-admin-content-add span.icon { background-position:-60px 0px !important; }
+.path-admin-content-node span.icon { background-position:-90px 0px !important; }
+.path-admin-content-node-settings span.icon { background-position:0px -150px !important; }
+
+.path-admin-settings-actions span.icon { background-position:-180px -120px !important; }
+.path-admin-settings-file-system span.icon { background-position:-60px -60px !important; }
+.path-admin-settings-filter span.icon { background-position:-30px -60px !important; }
+.path-admin-settings-image-toolkit span.icon { background-position:-120px -60px !important;}
+.path-admin-settings-logging span.icon { background-position:-150px -60px !important; }
+.path-admin-settings-maintenance-mode span.icon { background-position:-90px -90px !important; }
+.path-admin-settings-performance span.icon { background-position:-30px -90px !important; }
+.path-admin-settings-regional-settings span.icon { background-position:0px -60px !important; }
+.path-admin-settings-search span.icon { background-position:-30px -30px !important; }
+.path-admin-settings-site-information span.icon { background-position:-60px -90px !important; }
+.path-admin-settings-updates span.icon { background-position:-150px -90px !important; }
+.path-admin-settings-uploads span.icon { background-position:-90px -60px !important; }
+
+.path-admin-build-block span.icon { background-position:-210px -90px !important; }
+.path-admin-build-menu span.icon { background-position:-150px 0px !important; }
+.path-admin-build-modules span.icon { background-position:-180px -90px !important; }
+.path-admin-build-themes span.icon { background-position:-120px -90px !important; }
+.path-admin-build-trigger span.icon { background-position:-180px -120px !important; }
+.path-admin-build-types span.icon { background-position:-120px -30px !important; }
+
+.path-admin-content-book span.icon { background-position:-180px 0px !important; }
+.path-admin-content-comment span.icon { background-position:-210px 0px !important; }
+.path-admin-content-taxonomy span.icon { background-position:-180px -30px !important; }
+.path-admin-content-rss-publishing span.icon { background-position:-150px -30px !important; }
+
+.path-admin-reports-access-denied span.icon { background-position:-90px -30px !important; }
+.path-admin-reports-page-not-found span.icon { background-position:-30px -150px !important; }
+.path-admin-reports-status span.icon { background-position:-60px -30px !important; }
+.path-admin-reports-updates span.icon { background-position:-150px -90px !important; }
+.path-admin-reports-dblog span.icon { background-position:-210px -120px !important; }
+.path-admin-reports-search span.icon { background-position:-30px -30px !important; }
+
+.path-admin-user-rules span.icon { background-position:0px -120px !important; }
+.path-admin-user-permissions span.icon { background-position:-30px -120px !important; }
+.path-admin-user-roles span.icon { background-position:-60px -120px !important; }
+.path-admin-user-user span.icon { background-position:-90px -120px !important; }
+.path-admin-user-settings span.icon { background-position:-150px -120px !important; }
Index: modules/admin/admin_toolbar.js
===================================================================
RCS file: modules/admin/admin_toolbar.js
diff -N modules/admin/admin_toolbar.js
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ modules/admin/admin_toolbar.js 8 Jun 2009 05:37:05 -0000
@@ -0,0 +1,56 @@
+// $Id: admin_toolbar.js,v 1.1.2.1 2009/06/07 04:14:41 yhahn Exp $
+(function ($) {
+
+Drupal.behaviors.admin = {
+ attach: function() {
+ Drupal.admin = Drupal.admin || {};
+ Drupal.admin.toolbar = Drupal.admin.toolbar || {};
+
+ Drupal.admin.toolbar.setActive = function(toolbar_id) {
+ // Show the right toolbar
+ $('#admin-toolbar .depth-1 ul.links').addClass('collapsed');
+ $(toolbar_id).removeClass('collapsed');
+ $('#admin-toolbar, #admin-toolbar .depth-1').removeClass('collapsed');
+
+ // Switch link active class to corresponding menu item
+ var link_id = toolbar_id.replace('admin-toolbar', 'admin-link');
+ $('#admin-toolbar .depth-0 ul.links a').removeClass('active');
+ $(link_id).addClass('active');
+ }
+
+ // Primary menus
+ $('#admin-toolbar .depth-0 ul.links a:not(.processed)').each(function() {
+ var target = $(this).attr('id');
+ if (target) {
+ target = '#'+ target.replace('admin-link', 'admin-toolbar');
+ if ($(target, '#admin-toolbar').size() > 0) {
+ // If this link is active show this toolbar on setup
+ if ($(this).parent().is('.active-trail')) {
+ Drupal.admin.toolbar.setActive(target);
+ }
+ // Add click handler
+ $(this).click(function() {
+ Drupal.admin.toolbar.setActive(target);
+ return false;
+ });
+ }
+ }
+ $(this).addClass('processed');
+ });
+
+ $('#admin-toolbar .depth-1 span.close:not(.processed)').each(function() {
+ $(this).click(function() {
+ $('#admin-toolbar .depth-1').addClass('collapsed');
+ return false;
+ });
+ $(this).addClass('processed');
+ });
+
+ // Secondary menus
+ $('#admin-toolbar .depth-1 ul.links:not(.processed)').each(function() {
+ $(this).addClass('processed');
+ });
+ }
+};
+
+})(jQuery);
Index: modules/admin/icons.png
===================================================================
RCS file: modules/admin/icons.png
diff -N modules/admin/icons.png
Binary files /dev/null and icons.png differ
Index: modules/admin/sprite.png
===================================================================
RCS file: modules/admin/sprite.png
diff -N modules/admin/sprite.png
Binary files /dev/null and sprite.png differ
Index: modules/admin/theme.inc
===================================================================
RCS file: modules/admin/theme.inc
diff -N modules/admin/theme.inc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ modules/admin/theme.inc 8 Jun 2009 05:37:06 -0000
@@ -0,0 +1,30 @@
+ $menus) {
+ foreach ($menus as $href => $links) {
+ $class = ($depth > 0) ? 'collapsed' : '';
+ if ($depth > 0 && admin_in_active_trail($href)) {
+ $class = '';
+ $vars['collapsed'] = FALSE;
+ }
+ $id = str_replace('/', '-', $href);
+ $vars["tree_{$depth}"][$id] = theme('links', $links, array('class' => "links clear-block $class", 'id' => "admin-toolbar-{$id}"));
+ }
+ }
+}
+
+/**
+ * Theme function for contextual popups.
+ */
+function template_preprocess_admin_links(&$vars) {
+ $links = '';
+ foreach ($vars['admin_links']['#admin_links'] as $link) {
+ $links .= l($link['title'], $link['href'], $link);
+ }
+ $vars['links'] = $links;
+}
Index: modules/block/block.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.module,v
retrieving revision 1.343
diff -u -p -r1.343 block.module
--- modules/block/block.module 8 Jun 2009 04:55:34 -0000 1.343
+++ modules/block/block.module 8 Jun 2009 05:37:07 -0000
@@ -125,6 +125,7 @@ function block_menu() {
'description' => 'Configure what block content appears in your site\'s sidebars and other regions.',
'page callback' => 'block_admin_display',
'access arguments' => array('administer blocks'),
+ 'options' => array('admin' => TRUE),
);
$items['admin/build/block/list'] = array(
'title' => 'List',
Index: modules/book/book.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/book/book.module,v
retrieving revision 1.495
diff -u -p -r1.495 book.module
--- modules/book/book.module 7 Jun 2009 02:32:57 -0000 1.495
+++ modules/book/book.module 8 Jun 2009 05:37:08 -0000
@@ -104,6 +104,7 @@ function book_menu() {
'description' => "Manage your site's book outlines.",
'page callback' => 'book_admin_overview',
'access arguments' => array('administer book outlines'),
+ 'options' => array('admin' => TRUE),
);
$items['admin/content/book/list'] = array(
'title' => 'List',
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.721
diff -u -p -r1.721 comment.module
--- modules/comment/comment.module 8 Jun 2009 05:12:15 -0000 1.721
+++ modules/comment/comment.module 8 Jun 2009 05:37:10 -0000
@@ -164,6 +164,7 @@ function comment_menu() {
'description' => 'List and edit site comments and the comment approval queue.',
'page callback' => 'comment_admin',
'access arguments' => array('administer comments'),
+ 'options' => array('admin' => TRUE),
);
// Tabs begin here.
$items['admin/content/comment/new'] = array(
Index: modules/dblog/dblog.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/dblog/dblog.module,v
retrieving revision 1.38
diff -u -p -r1.38 dblog.module
--- modules/dblog/dblog.module 27 May 2009 18:33:56 -0000 1.38
+++ modules/dblog/dblog.module 8 Jun 2009 05:37:10 -0000
@@ -48,6 +48,7 @@ function dblog_menu() {
'page callback' => 'dblog_overview',
'access arguments' => array('access site reports'),
'weight' => -1,
+ 'options' => array('admin' => TRUE),
);
$items['admin/reports/page-not-found'] = array(
'title' => "Top 'page not found' errors",
Index: modules/filter/filter.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v
retrieving revision 1.260
diff -u -p -r1.260 filter.module
--- modules/filter/filter.module 8 Jun 2009 04:51:45 -0000 1.260
+++ modules/filter/filter.module 8 Jun 2009 05:37:11 -0000
@@ -76,6 +76,7 @@ function filter_menu() {
'page callback' => 'drupal_get_form',
'page arguments' => array('filter_admin_overview'),
'access arguments' => array('administer filters'),
+ 'options' => array('admin' => TRUE),
);
$items['admin/settings/formats/list'] = array(
'title' => 'List',
Index: modules/menu/menu.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/menu/menu.module,v
retrieving revision 1.192
diff -u -p -r1.192 menu.module
--- modules/menu/menu.module 27 May 2009 18:33:58 -0000 1.192
+++ modules/menu/menu.module 8 Jun 2009 05:37:12 -0000
@@ -56,6 +56,7 @@ function menu_menu() {
'page callback' => 'menu_overview_page',
'access callback' => 'user_access',
'access arguments' => array('administer menu'),
+ 'options' => array('admin' => TRUE),
);
$items['admin/build/menu/list'] = array(
'title' => 'List menus',
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.1069
diff -u -p -r1.1069 node.module
--- modules/node/node.module 5 Jun 2009 21:56:07 -0000 1.1069
+++ modules/node/node.module 8 Jun 2009 05:37:15 -0000
@@ -1862,6 +1862,7 @@ function node_menu() {
'page callback' => 'drupal_get_form',
'page arguments' => array('node_admin_content'),
'access arguments' => array('administer nodes'),
+ 'options' => array('admin' => TRUE),
);
$items['admin/content/node/overview'] = array(
@@ -1885,6 +1886,7 @@ function node_menu() {
'description' => 'Manage posts by content type, including default status, front page promotion, comment settings, etc.',
'page callback' => 'node_overview_types',
'access arguments' => array('administer content types'),
+ 'options' => array('admin' => TRUE),
);
$items['admin/build/types/list'] = array(
'title' => 'List',
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.710
diff -u -p -r1.710 system.module
--- modules/system/system.module 8 Jun 2009 04:28:19 -0000 1.710
+++ modules/system/system.module 8 Jun 2009 05:37:18 -0000
@@ -510,6 +510,7 @@ function system_menu() {
'page callback' => 'system_admin_menu_block_page',
'access callback' => 'system_admin_menu_block_access',
'access arguments' => array('admin/content', 'access administration pages'),
+ 'options' => array('admin' => TRUE),
);
// Menu items that are basically just menu blocks.
@@ -521,6 +522,7 @@ function system_menu() {
'page callback' => 'system_settings_overview',
'access callback' => 'system_admin_menu_block_access',
'access arguments' => array('admin/settings', 'access administration pages'),
+ 'options' => array('admin' => TRUE),
);
$items['admin/build'] = array(
'title' => 'Site building',
@@ -530,6 +532,7 @@ function system_menu() {
'page callback' => 'system_admin_menu_block_page',
'access callback' => 'system_admin_menu_block_access',
'access arguments' => array('admin/build', 'access administration pages'),
+ 'options' => array('admin' => TRUE),
);
// Themes.
$items['admin/build/themes'] = array(
@@ -538,6 +541,7 @@ function system_menu() {
'page callback' => 'drupal_get_form',
'page arguments' => array('system_themes_form'),
'access arguments' => array('administer site configuration'),
+ 'options' => array('admin' => TRUE),
);
$items['admin/build/themes/select'] = array(
'title' => 'List',
@@ -575,6 +579,7 @@ function system_menu() {
'page callback' => 'drupal_get_form',
'page arguments' => array('system_modules'),
'access arguments' => array('administer site configuration'),
+ 'options' => array('admin' => TRUE),
);
$items['admin/build/modules/list'] = array(
'title' => 'List',
@@ -673,6 +678,7 @@ function system_menu() {
'page callback' => 'drupal_get_form',
'page arguments' => array('system_site_information_settings'),
'access arguments' => array('administer site configuration'),
+ 'options' => array('admin' => TRUE),
);
$items['admin/settings/logging'] = array(
'title' => 'Logging and errors',
@@ -680,6 +686,7 @@ function system_menu() {
'page callback' => 'drupal_get_form',
'page arguments' => array('system_logging_settings'),
'access arguments' => array('administer site configuration'),
+ 'options' => array('admin' => TRUE),
);
$items['admin/settings/logging/settings'] = array(
'title' => 'Settings',
@@ -693,6 +700,7 @@ function system_menu() {
'page callback' => 'drupal_get_form',
'page arguments' => array('system_performance_settings'),
'access arguments' => array('administer site configuration'),
+ 'options' => array('admin' => TRUE),
);
$items['admin/settings/file-system'] = array(
'title' => 'File system',
@@ -721,6 +729,7 @@ function system_menu() {
'page callback' => 'drupal_get_form',
'page arguments' => array('system_regional_settings'),
'access arguments' => array('administer site configuration'),
+ 'options' => array('admin' => TRUE),
);
$items['admin/settings/regional-settings/lookup'] = array(
'title' => 'Date and time lookup',
@@ -759,6 +768,7 @@ function system_menu() {
'access arguments' => array('admin/reports', 'access site reports'),
'weight' => 5,
'position' => 'left',
+ 'options' => array('admin' => TRUE),
);
$items['admin/reports/status'] = array(
'title' => 'Status report',
@@ -766,6 +776,7 @@ function system_menu() {
'page callback' => 'system_status',
'weight' => 10,
'access arguments' => array('administer site configuration'),
+ 'options' => array('admin' => TRUE),
);
$items['admin/reports/status/run-cron'] = array(
'title' => 'Run cron',
@@ -832,7 +843,7 @@ function system_admin_menu_block_access(
*/
function system_init() {
// Use the administrative theme if the user is looking at a page in the admin/* path.
- if (arg(0) == 'admin' || (variable_get('node_admin_theme', '0') && arg(0) == 'node' && (arg(1) == 'add' || arg(2) == 'edit'))) {
+ if (system_use_admin_theme()) {
global $custom_theme;
$custom_theme = variable_get('admin_theme', 0);
drupal_add_css(drupal_get_path('module', 'system') . '/admin.css');
@@ -1322,6 +1333,7 @@ function _system_get_theme_data() {
// Set defaults for theme info.
$defaults = array(
'regions' => array(
+ 'admin' => 'Admin tools',
'left' => 'Left sidebar',
'right' => 'Right sidebar',
'content' => 'Content',
@@ -1480,6 +1492,26 @@ function system_find_base_theme($themes,
}
/**
+ * Determine whether Drupal should use the admin theme for this page.
+ *
+ * @return
+ * Boolean TRUE if the admin theme should be used.
+ */
+function system_use_admin_theme() {
+ // Are we on an admin/* page?
+ if (arg(0) == 'admin') {
+ return TRUE;
+ }
+
+ // Should the admin theme be used on node add/edit pages?
+ if ((variable_get('node_admin_theme', '0') && arg(0) == 'node' && (arg(1) == 'add' || arg(2) == 'edit'))) {
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+/**
* Get a list of available regions from a specified theme.
*
* @param $theme_key
Index: modules/update/update.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/update/update.module,v
retrieving revision 1.37
diff -u -p -r1.37 update.module
--- modules/update/update.module 8 Jun 2009 05:00:11 -0000 1.37
+++ modules/update/update.module 8 Jun 2009 05:37:18 -0000
@@ -132,6 +132,7 @@ function update_menu() {
'page callback' => 'update_status',
'access arguments' => array('administer site configuration'),
'weight' => 10,
+ 'options' => array('admin' => TRUE),
);
$items['admin/settings/updates'] = array(
'title' => 'Updates',
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.1000
diff -u -p -r1.1000 user.module
--- modules/user/user.module 8 Jun 2009 05:00:11 -0000 1.1000
+++ modules/user/user.module 8 Jun 2009 05:37:22 -0000
@@ -1341,6 +1341,7 @@ function user_menu() {
'page callback' => 'system_admin_menu_block_page',
'access callback' => 'system_admin_menu_block_access',
'access arguments' => array('admin/user', 'access administration pages'),
+ 'options' => array('admin' => TRUE),
);
$items['admin/user/user'] = array(
'title' => 'Users',
@@ -1348,6 +1349,7 @@ function user_menu() {
'page callback' => 'user_admin',
'page arguments' => array('list'),
'access arguments' => array('administer users'),
+ 'options' => array('admin' => TRUE),
);
$items['admin/user/user/list'] = array(
'title' => 'List',
@@ -1366,6 +1368,7 @@ function user_menu() {
'page callback' => 'drupal_get_form',
'page arguments' => array('user_admin_settings'),
'access arguments' => array('administer users'),
+ 'options' => array('admin' => TRUE),
);
// Permission administration pages.
@@ -1375,6 +1378,7 @@ function user_menu() {
'page callback' => 'drupal_get_form',
'page arguments' => array('user_admin_perm'),
'access arguments' => array('administer permissions'),
+ 'options' => array('admin' => TRUE),
);
$items['admin/user/roles'] = array(
'title' => 'Roles',
@@ -1382,6 +1386,7 @@ function user_menu() {
'page callback' => 'drupal_get_form',
'page arguments' => array('user_admin_new_role'),
'access arguments' => array('administer permissions'),
+ 'options' => array('admin' => TRUE),
);
$items['admin/user/roles/edit'] = array(
'title' => 'Edit role',
Index: themes/garland/page.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/themes/garland/page.tpl.php,v
retrieving revision 1.27
diff -u -p -r1.27 page.tpl.php
--- themes/garland/page.tpl.php 28 May 2009 16:44:07 -0000 1.27
+++ themes/garland/page.tpl.php 8 Jun 2009 05:37:22 -0000
@@ -15,6 +15,8 @@
+
+