Index: admin_menu.api.php =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/admin_menu/admin_menu.api.php,v retrieving revision 1.1 diff -u -p -r1.1 admin_menu.api.php --- admin_menu.api.php 18 Jul 2009 22:51:35 -0000 1.1 +++ admin_menu.api.php 19 Jul 2009 01:18:15 -0000 @@ -22,7 +22,8 @@ * menu, such as the icon menu or the logout link. You can add more items here * or play with the #weight attribute to customize them. * @see theme_admin_menu_links() - * @see admin_menu_adjust_items() + * @see admin_menu_links_icon() + * @see admin_menu_links_user() */ function hook_admin_menu_output_alter(&$content) { // Add new top-level item. Index: admin_menu.css =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/admin_menu/admin_menu.css,v retrieving revision 1.33 diff -u -p -r1.33 admin_menu.css --- admin_menu.css 22 Jun 2009 02:39:15 -0000 1.33 +++ admin_menu.css 19 Jul 2009 01:41:51 -0000 @@ -13,12 +13,15 @@ background: #101010 url(images/bkg.png) bottom left repeat-x; font-size: 9px; font-family: "lucida grande", tahoma, verdana, arial, sans-serif; - left: 0px; + left: 0; position: absolute; text-align: left; - top: 0px; + top: 0; width: 100%; } +#admin-menu-wrapper { + overflow: hidden; +} #admin-menu li.admin-menu-icon a { padding: 1px 8px 4px; } Index: admin_menu.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/admin_menu/admin_menu.inc,v retrieving revision 1.54 diff -u -p -r1.54 admin_menu.inc --- admin_menu.inc 18 Jul 2009 21:41:16 -0000 1.54 +++ admin_menu.inc 19 Jul 2009 01:17:12 -0000 @@ -7,15 +7,17 @@ */ /** - * Add default features to increase user experience. + * Build icon menu links; mostly containing maintenance helpers. * - * @return - * An array of links to be rendered around the menu tree. + * @see theme_admin_menu_links() */ -function admin_menu_adjust_items() { +function admin_menu_links_icon() { $destination = drupal_get_destination(); // Add icon containing special links. + $links = array( + '#weight' => -10, + ); $links['icon'] = array( '#title' => theme('admin_menu_icon'), '#attributes' => array('class' => array('admin-menu-icon')), @@ -103,6 +105,26 @@ function admin_menu_adjust_items() { ), ); + // Add Devel module links. + if (module_exists('devel')) { + // Add variable editor. + $links['icon']['devel-variables'] = array( + '#title' => t('Variable editor'), + '#weight' => 20, + '#access' => user_access('access devel information'), + '#href' => 'devel/variable', + ); + } + + return $links; +} + +/** + * Build user/action links; mostly account information and links. + * + * @see theme_admin_menu_links() + */ +function admin_menu_links_user() { // Add link to show current authenticated/anonymous users. $links['user-counter'] = array( '#title' => admin_menu_get_user_count(), @@ -126,13 +148,6 @@ function admin_menu_adjust_items() { // Add Devel module links. if (module_exists('devel')) { - // Add variable editor. - $links['icon']['devel-variables'] = array( - '#title' => t('Variable editor'), - '#weight' => 20, - '#access' => user_access('access devel information'), - '#href' => 'devel/variable', - ); // Add switch user links. foreach (module_invoke('devel', 'switch_user_list') as $link) { $links['account'][$link['title']] = array( Index: admin_menu.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/admin_menu/admin_menu.js,v retrieving revision 1.26 diff -u -p -r1.26 admin_menu.js --- admin_menu.js 11 Jul 2009 21:14:19 -0000 1.26 +++ admin_menu.js 19 Jul 2009 04:11:01 -0000 @@ -134,8 +134,8 @@ Drupal.admin.behaviors.positionFixed = f */ Drupal.admin.behaviors.pageTabs = function (context, settings, $adminMenu) { if (settings.admin_menu.tweak_tabs) { - $('ul.tabs.primary li', context).addClass('admin-menu-tab').appendTo('#admin-menu > ul'); - $('ul.tabs.secondary', context).appendTo('#admin-menu > ul > li.admin-menu-tab.active'); + $('ul.tabs.primary li', context).addClass('admin-menu-tab').appendTo('#admin-menu-wrapper > ul'); + $('ul.tabs.secondary', context).appendTo('#admin-menu-wrapper > ul > li.admin-menu-tab.active'); $('ul.tabs.primary', context).remove(); } }; Index: admin_menu.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/admin_menu/admin_menu.module,v retrieving revision 1.84 diff -u -p -r1.84 admin_menu.module --- admin_menu.module 18 Jul 2009 22:10:07 -0000 1.84 +++ admin_menu.module 19 Jul 2009 04:12:26 -0000 @@ -402,15 +402,15 @@ function admin_menu_output() { // not all) multi-domain setups (e.g. language-based sub-domains). $class_site = 'admin-menu-site' . drupal_strtolower(preg_replace('/[^a-zA-Z0-9-]/', '-', $GLOBALS['cookie_domain'])); // @todo Always output container to harden JS-less support. - $content['#prefix'] = '
'; + $content['#prefix'] = ''; // Add menu additions. module_load_include('inc', 'admin_menu'); - $content['links'] = array( - '#theme' => 'admin_menu_links', - ); - $content['links'] += admin_menu_adjust_items(); + $content['icon'] = admin_menu_links_icon(); + $content['icon']['#theme'] = 'admin_menu_links'; + $content['user'] = admin_menu_links_user(); + $content['user']['#theme'] = 'admin_menu_links'; // Add administration menu. // @todo How can we use #theme here? @@ -451,8 +451,10 @@ function admin_menu_output() { * - '#options': Optional alternative text for the link, passed to l(). * * The array key of each child element itself is passed as path for l(). + * @param $depth + * Current recursion level; internal use only. */ -function theme_admin_menu_links(&$elements) { +function theme_admin_menu_links(&$elements, $depth = 0) { $output = ''; foreach (element_children($elements, TRUE) as $path) { // Early-return nothing if user does not have access. @@ -464,9 +466,11 @@ function theme_admin_menu_links(&$elemen '#options' => array(), ); // Render children to determine whether this link is expandable. - $children = theme('admin_menu_links', $elements[$path]); + $children = theme('admin_menu_links', $elements[$path], $depth + 1); if (!empty($children)) { $elements[$path]['#attributes']['class'][] = 'expandable'; + // If there are children, we add the parent key as class by default. + // $elements[$path]['#attributes']['class'][] = $path; } if (isset($elements[$path]['#attributes']['class'])) { $elements[$path]['#attributes']['class'] = implode(' ', $elements[$path]['#attributes']['class']); @@ -477,18 +481,32 @@ function theme_admin_menu_links(&$elemen if (isset($elements[$path]['#href'])) { $output .= l($elements[$path]['#title'], $elements[$path]['#href'], $elements[$path]['#options']); } - elseif (!empty($element[$path]['#options']['html'])) { - $output .= $elements[$path]['#title']; - } - else { - $output .= check_plain($elements[$path]['#title']); + elseif (isset($elements[$path]['#title'])) { + if (!empty($elements[$path]['#options']['html'])) { + $title = $elements[$path]['#title']; + } + else { + $title = check_plain($elements[$path]['#title']); + } + if (!empty($elements[$path]['#options']['attributes'])) { + $output .= '' . $title . ''; + } + else { + $output .= $title; + } } $output .= $children; $output .= ''; } // @todo #attributes probably required for UL, but already used for LI. - return $output ? '