toolbar_menu_navigation_links
function toolbar_menu_navigation_links
toolbar_menu_navigation_links($tree)
Generates a links array from a menu tree array.
Based on menu_navigation_links(). Adds path based IDs and icon placeholders to the links.
Return value
An array of links as defined above.
File
- modules/toolbar/toolbar.module, line 307
- Administration toolbar for quick access to top level administration items.
Code
function toolbar_menu_navigation_links($tree) { $links = array(); foreach ($tree as $item) { if (!$item['link']['hidden'] && $item['link']['access']) { // Make sure we have a path specific ID in place, so we can attach icons // and behaviors to the items. $id = str_replace(array('/', '<', '>'), array('-', '', ''), $item['link']['href']); $link = $item['link']['localized_options']; $link['href'] = $item['link']['href']; // Add icon placeholder. $link['title'] = '<span class="icon"></span>' . check_plain($item['link']['title']); // Add admin link ID. $link['attributes'] = array('id' => 'toolbar-link-' . $id); if (!empty($item['link']['description'])) { $link['title'] .= ' <span class="element-invisible">(' . $item['link']['description'] . ')</span>'; $link['attributes']['title'] = $item['link']['description']; } $link['html'] = TRUE; $class = ' path-' . $id; if (toolbar_in_active_trail($item['link']['href'])) { $class .= ' active-trail'; } $links['menu-' . $item['link']['mlid'] . $class] = $link; } } return $links; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!toolbar!toolbar.module/function/toolbar_menu_navigation_links/7.x