You are here

function theme_toolbar_toggle in Drupal 7

Formats an element used to toggle the toolbar drawer's visibility.

Parameters

$variables: An associative array containing:

  • collapsed: A boolean value representing the toolbar drawer's visibility.
  • attributes: An associative array of HTML attributes.

Return value

An HTML string representing the element for toggling.

1 theme call to theme_toolbar_toggle()
toolbar_view in modules/toolbar/toolbar.module
Builds the admin menu as a structured array ready for drupal_render().

File

modules/toolbar/toolbar.module, line 91
Administration toolbar for quick access to top level administration items.

Code

function theme_toolbar_toggle($variables) {
  if ($variables['collapsed']) {
    $toggle_text = t('Show shortcuts');
  }
  else {
    $toggle_text = t('Hide shortcuts');
    $variables['attributes']['class'][] = 'toggle-active';
  }
  return l($toggle_text, 'toolbar/toggle', array(
    'query' => drupal_get_destination(),
    'attributes' => array(
      'title' => $toggle_text,
    ) + $variables['attributes'],
  ));
}