shortcut_toolbar_pre_render
function shortcut_toolbar_pre_render
shortcut_toolbar_pre_render($toolbar)
Pre-render function for adding shortcuts to the toolbar drawer.
File
- modules/shortcut/shortcut.module, line 712
- Allows users to manage customizable lists of shortcut links.
Code
function shortcut_toolbar_pre_render($toolbar) { $links = shortcut_renderable_links(); $links['#attached'] = array('css' => array(drupal_get_path('module', 'shortcut') . '/shortcut.css')); $links['#prefix'] = '<div class="toolbar-shortcuts">'; $links['#suffix'] = '</div>'; $shortcut_set = shortcut_current_displayed_set(); $configure_link = NULL; if (shortcut_set_edit_access($shortcut_set)) { $configure_link = array( '#type' => 'link', '#title' => t('Edit shortcuts'), '#href' => 'admin/config/user-interface/shortcut/' . $shortcut_set->set_name, '#options' => array('attributes' => array('id' => 'edit-shortcuts')), ); } $drawer = array( 'shortcuts' => $links, 'configure' => $configure_link, ); $toolbar['toolbar_drawer'][] = $drawer; return $toolbar; }
© 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!shortcut!shortcut.module/function/shortcut_toolbar_pre_render/7.x