theme_toolbar_toggle

Versions
mediamosa-21
theme_toolbar_toggle($variables)

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.

Code

modules/toolbar/toolbar.module, line 90

<?php
function theme_toolbar_toggle($variables) {
  if ($variables['collapsed']) {
    $toggle_text = t('Open the drawer');
    return '<a href="' . url('toolbar/toggle', array('query' => drupal_get_destination())) . '" title="' . $toggle_text . '"' .  drupal_attributes($variables['attributes']) . '>' . $toggle_text . '</a>';
  }
  else {
    $toggle_text = t('Close the drawer');
    $variables['attributes']['class'][] = 'toggle-active';
    return '<a href="' . url('toolbar/toggle', array('query' => drupal_get_destination())) . '" title="' . $toggle_text . '"' .  drupal_attributes($variables['attributes']) . '>' . $toggle_text . '</a>';
  }
}
?>