Commit 520d8e6e authored by Dries's avatar Dries

- Patch #615148 by casey: remove overlay-related cruft from toolbar module.

parent 336d35e2
...@@ -282,14 +282,13 @@ function toolbar_get_menu_tree() { ...@@ -282,14 +282,13 @@ function toolbar_get_menu_tree() {
/** /**
* Generate a links array from a menu tree array. * Generate a links array from a menu tree array.
* *
* Based on menu_navigation_links(). Adds in path based IDs, icon placeholders * Based on menu_navigation_links(). Adds path based IDs and icon placeholders
* and overlay classes for the links. * to the links.
*/ */
function toolbar_menu_navigation_links($tree) { function toolbar_menu_navigation_links($tree) {
$links = array(); $links = array();
foreach ($tree as $item) { foreach ($tree as $item) {
if (!$item['link']['hidden'] && $item['link']['access']) { if (!$item['link']['hidden'] && $item['link']['access']) {
$class = '';
// Make sure we have a path specific ID in place, so we can attach icons // Make sure we have a path specific ID in place, so we can attach icons
// and behaviors to the items. // and behaviors to the items.
$id = str_replace(array('/', '<', '>'), array('-', '', ''), $item['link']['href']); $id = str_replace(array('/', '<', '>'), array('-', '', ''), $item['link']['href']);
...@@ -298,8 +297,8 @@ function toolbar_menu_navigation_links($tree) { ...@@ -298,8 +297,8 @@ function toolbar_menu_navigation_links($tree) {
$link['href'] = $item['link']['href']; $link['href'] = $item['link']['href'];
// Add icon placeholder. // Add icon placeholder.
$link['title'] = '<span class="icon"></span>' . $item['link']['title']; $link['title'] = '<span class="icon"></span>' . $item['link']['title'];
// Add admin link ID and to-overlay class for the overlay. // Add admin link ID.
$link['attributes'] = array('id' => 'toolbar-link-' . $id, 'class' => array('to-overlay')); $link['attributes'] = array('id' => 'toolbar-link-' . $id);
if (!empty($item['link']['description'])) { if (!empty($item['link']['description'])) {
$link['title'] .= ' <span class="element-invisible">(' . $item['link']['description'] . ')</span>'; $link['title'] .= ' <span class="element-invisible">(' . $item['link']['description'] . ')</span>';
$link['attributes']['title'] = $item['link']['description']; $link['attributes']['title'] = $item['link']['description'];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment