? 540282-toolbar-accessibility_5.patch
? 540282-toolbar-accessibility_6.patch
? fieldsets-541568_v5.patch
? sites/default/files
? sites/default/private
? sites/default/settings.php
Index: index.php
===================================================================
RCS file: /cvs/drupal/drupal/index.php,v
retrieving revision 1.98
diff -u -p -r1.98 index.php
--- index.php	8 Feb 2009 20:27:51 -0000	1.98
+++ index.php	31 Aug 2009 19:28:22 -0000
@@ -41,3 +41,5 @@ elseif (isset($return)) {
 }
 
 drupal_page_footer();
+
+$this->debug('debug information');
Index: modules/toolbar/toolbar.css
===================================================================
RCS file: /cvs/drupal/drupal/modules/toolbar/toolbar.css,v
retrieving revision 1.2
diff -u -p -r1.2 toolbar.css
--- modules/toolbar/toolbar.css	29 Jul 2009 12:28:41 -0000	1.2
+++ modules/toolbar/toolbar.css	31 Aug 2009 19:28:23 -0000
@@ -84,7 +84,7 @@ div#toolbar div.toolbar-menu #toolbar-me
   left: 10px;
 }
 
-div#toolbar div.toolbar-menu span.toggle {
+div#toolbar div.toolbar-menu a.toggle {
   position: absolute;
   right: 10px;
   cursor: pointer;
@@ -95,7 +95,7 @@ div#toolbar div.toolbar-menu span.toggle
   height: 25px;
 }
 
-div#toolbar div.toolbar-menu span.toggle-active {
+div#toolbar div.toolbar-menu a.toggle-active {
   background-position:  -25px -60px;
 }
 
Index: modules/toolbar/toolbar.js
===================================================================
RCS file: /cvs/drupal/drupal/modules/toolbar/toolbar.js,v
retrieving revision 1.3
diff -u -p -r1.3 toolbar.js
--- modules/toolbar/toolbar.js	31 Aug 2009 16:48:37 -0000	1.3
+++ modules/toolbar/toolbar.js	31 Aug 2009 19:28:23 -0000
@@ -11,7 +11,7 @@ Drupal.behaviors.admin = {
     $('#toolbar', context).once('toolbar', Drupal.admin.toolbar.init);
 
     // Toggling of admin shortcuts visibility.
-    $('#toolbar span.toggle', context).once('toolbar-toggle').click(function() {
+    $('#toolbar a.toggle', context).once('toolbar-toggle').click(function() {
       Drupal.admin.toolbar.toggle();
       return false;
     });
@@ -45,7 +45,10 @@ Drupal.admin.toolbar.init = function() {
  */
 Drupal.admin.toolbar.collapse = function() {
   $('#toolbar div.toolbar-shortcuts').addClass('collapsed');
-  $('#toolbar span.toggle').removeClass('toggle-active');
+  $('#toolbar a.toggle')
+    .removeClass('toggle-active')
+    .attr('title', Drupal.t('Show toolbar shortcuts'))
+    .html(Drupal.t('Show toolbar shortcuts'));
   $('body').removeClass('toolbar-shortcuts');
   $.cookie(
     'Drupal.admin.toolbar.collapsed', 
@@ -59,7 +62,10 @@ Drupal.admin.toolbar.collapse = function
  */
 Drupal.admin.toolbar.expand = function() {
   $('#toolbar div.toolbar-shortcuts').removeClass('collapsed');
-  $('#toolbar span.toggle').addClass('toggle-active');
+  $('#toolbar a.toggle')
+    .addClass('toggle-active')
+    .attr('title', Drupal.t('Hide toolbar shortcuts'))
+    .html(Drupal.t('Hide toolbar shortcuts'));;
   $('body').addClass('toolbar-shortcuts');
   $.cookie(
     'Drupal.admin.toolbar.collapsed', 
@@ -72,7 +78,7 @@ Drupal.admin.toolbar.expand = function()
  * Toggle the admin toolbar.
  */
 Drupal.admin.toolbar.toggle = function() {
-  if ($('#toolbar div.toolbar-shortcuts').is('.collapsed')) {
+  if ($('#toolbar div.toolbar-shortcuts').hasClass('collapsed')) {
     Drupal.admin.toolbar.expand();
   }
   else {
Index: modules/toolbar/toolbar.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/toolbar/toolbar.module,v
retrieving revision 1.7
diff -u -p -r1.7 toolbar.module
--- modules/toolbar/toolbar.module	31 Aug 2009 16:46:32 -0000	1.7
+++ modules/toolbar/toolbar.module	31 Aug 2009 19:28:23 -0000
@@ -18,16 +18,78 @@ function toolbar_permission() {
   );
 }
 
+function toolbar_theme() {
+  return array(
+    'toolbar' => array(
+      'arguments' => array('toolbar' => array()),
+      'template' => 'toolbar',
+      'path' => drupal_get_path('module', 'toolbar'),
+    ),
+    'toolbar_toggle' => array(
+      'arguments' => array('collapsed' => NULL, 'attributes' => array()),
+    ),
+  );
+}
+
 /**
- * Implement hook_theme().
+ * Implement hook_menu().
  */
-function toolbar_theme($existing, $type, $theme, $path) {
-  $items['toolbar'] = array(
-    'arguments' => array('toolbar' => array()),
-    'template' => 'toolbar',
-    'path' => drupal_get_path('module', 'toolbar'),
-  );
-  return $items;
+function toolbar_menu() {
+  $items['toolbar/toggle'] = array(
+    'title' => 'Toggle shortcuts visibility',
+    'type' => MENU_CALLBACK,
+    'page callback' => 'toolbar_toggle_page',
+    'access arguments' => array('access toolbar'),
+   );
+   return $items;
+ }
+
+ /**
+ * Menu callback; toggles the visibility of the toolbar shortcuts.
+ */
+function toolbar_toggle_page() {
+  global $base_path;
+  // Toggle the value in the cookie.
+  setcookie('Drupal.admin.toolbar.collapsed', !_toolbar_is_collapsed(), NULL, $base_path);
+  // Redirect the user from where he used the toggle element.
+  drupal_goto();
+}
+
+/**
+ * Formats an element used to toggle the visibility of the shortcut links.
+ * 
+ * @param $element
+ *   An associative array containing the properties of the element.
+ *   Property used:
+ *     - #collapsed
+ *       A boolean value indicating the current state of the visibility of the
+ *       shortcut links.
+ * @return
+ *   An HTML string representing the element for toggling.
+ *
+ * @ingroup themable
+ */
+function theme_toolbar_toggle($collapsed, $attributes = array()) {
+  if ($collapsed) {
+    return '<a href="' . url('toolbar/toggle', array('query' => drupal_get_destination())) . '" title="' . t('Show toolbar shortcuts') . '"' .  drupal_attributes($attributes) . '>' . t('Show toolbar shortcuts') . '</a>';
+  }
+  else {
+    $attributes['class'][] = 'toggle-active';
+    return '<a href="' . url('toolbar/toggle', array('query' => drupal_get_destination())) . '" title="' . t('Hide toolbar shortcuts') . '"' .  drupal_attributes($attributes) . '>' . t('Hide toolbar shortcuts') . '</a>';
+  }
+}
+
+/**
+ * Determins if the shortcut links are currently collapsed, if they are not it
+ * means they are expanded.
+ * 
+ * @return
+ *   A boolean value indicating if the 
+ */
+function _toolbar_is_collapsed() {
+  // PHP converts dots into underscores in cookie names to avoid problems with
+  // its parser, so we use a converted cookie name.
+  return isset($_COOKIE['Drupal_admin_toolbar_collapsed']) ? $_COOKIE['Drupal_admin_toolbar_collapsed'] : 0;
 }
 
 /**
@@ -48,7 +110,10 @@ function toolbar_page_build(&$page) {
  */
 function toolbar_preprocess_page(&$vars) {
   if (user_access('access toolbar')) {
-    $vars['classes_array'][] = 'toolbar toolbar-shortcuts';
+    $vars['classes_array'][] = 'toolbar';
+    if (!_toolbar_is_collapsed()) {
+      $vars['classes_array'][] = 'toolbar-shortcuts';
+    }
   }
 }
 
@@ -96,12 +161,23 @@ function toolbar_build() {
   );
 
   // Add convenience shortcut links.
+  $shortcuts_menu = menu_load('admin_shortcuts');
   $shortcuts = menu_tree_all_data('admin_shortcuts');
   $shortcuts = toolbar_menu_navigation_links($shortcuts);
   $build['toolbar_shortcuts'] = array(
     '#theme' => 'links',
     '#links' => $shortcuts,
     '#attributes' => array('id' => 'toolbar-shortcuts'),
+    '#heading' => array('text' => $shortcuts_menu['title'], 'level' => 'h2', 'class' => 'element-invisible'),
+    '#prefix' => '<div class="toolbar-shortcuts clearfix' . (_toolbar_is_collapsed() ? ' collapsed' : '') . '">',
+    '#suffix' => '</div>',
+  );
+
+  // Add an anchor to be able to toggle the visibility of the shortcut links.
+  $build['toolbar_toggle'] = array(
+    '#theme' => 'toolbar_toggle',
+    '#collapsed' => _toolbar_is_collapsed(),
+    '#attributes' => array('class' => array('toggle')),
   );
 
   return $build;
Index: modules/toolbar/toolbar.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/toolbar/toolbar.tpl.php,v
retrieving revision 1.2
diff -u -p -r1.2 toolbar.tpl.php
--- modules/toolbar/toolbar.tpl.php	29 Jul 2009 12:28:41 -0000	1.2
+++ modules/toolbar/toolbar.tpl.php	31 Aug 2009 19:28:23 -0000
@@ -16,14 +16,12 @@
 ?>
 <div id="toolbar" class="clearfix">
   <div class="toolbar-menu clearfix">
-    <span class="toggle toggle-active"><?php print t('Show shortcuts'); ?></span>
+    <?php print render($toolbar['toolbar_toggle']); ?>
     <?php print render($toolbar['toolbar_menu']); ?>
     <?php print render($toolbar['toolbar_user']); ?>
   </div>
 
-  <div class="toolbar-shortcuts clearfix">
-    <?php print render($toolbar['toolbar_shortcuts']); ?>
-  </div>
+  <?php print render($toolbar['toolbar_shortcuts']); ?>
 
   <div class="shadow"></div>
 </div>
