You are here

function environment_indicator_toolbar in Environment Indicator 8.2

Same name and namespace in other branches
  1. 8.3 environment_indicator.module \environment_indicator_toolbar()
  2. 4.x environment_indicator.module \environment_indicator_toolbar()

Implements hook_toolbar().

File

./environment_indicator.module, line 182
Module implementation file.

Code

function environment_indicator_toolbar() {
  $environment = environment_indicator_get_active();
  $menu = _environment_indicator_switcher_menu();
  $items['environment_indicator'] = array(
    // Include the toolbar_tab_wrapper to style the link like a toolbar tab.
    // Exclude the theme wrapper if custom styling is desired.
    '#type' => 'toolbar_item',
    'tab' => array(
      '#type' => 'link',
      '#theme' => 'user_message_toolbar_tab',
      '#theme_wrappers' => array(),
      '#title' => t('@name', array(
        '@name' => $environment['name'],
      )),
      '#href' => '',
      '#options' => array(
        'attributes' => array(
          'title' => t('Environments'),
          'class' => array(
            'toolbar-icon',
            'toolbar-icon-environment',
          ),
        ),
      ),
    ),
    'tray' => $menu,
    '#weight' => 125,
  );
  return $items;
}