function shortcut_toolbar_pre_render

Pre-render function for adding shortcuts to the toolbar drawer.

1 string reference to 'shortcut_toolbar_pre_render'
shortcut_page_alter in modules/shortcut/shortcut.module
Implements hook_page_alter().

File

modules/shortcut/shortcut.module, line 712

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.