function shortcut_toolbar

Implements hook_toolbar().

File

drupal/core/modules/shortcut/shortcut.module, line 718
Allows users to manage customizable lists of shortcut links.

Code

function shortcut_toolbar() {
  $links = shortcut_renderable_links();
  $links['#attached'] = array(
    'css' => array(
      drupal_get_path('module', 'shortcut') . '/shortcut.base.css',
      drupal_get_path('module', 'shortcut') . '/shortcut.theme.css',
    ),
  );
  $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(
          'class' => array(
            'edit-shortcuts',
          ),
        ),
      ),
    );
  }
  $links_tray = array(
    '#heading' => t('User-defined shortcuts'),
    'shortcuts' => $links,
    'configure' => $configure_link,
  );
  $items['shortcuts'] = array(
    'tab' => array(
      'title' => t('Shortcuts'),
      'href' => 'admin/config/user-interface/shortcut',
      'html' => FALSE,
      'attributes' => array(
        'title' => t('Shortcuts'),
        'class' => array(
          'icon',
          'icon-shortcut',
        ),
      ),
    ),
    'tray' => $links_tray,
    'weight' => -10,
  );
  return $items;
}