function theme_toolbar_toggle

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 96

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'],
    ));
}

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