You are here

function template_preprocess_admin_toolbar in Admin 6.2

Same name and namespace in other branches
  1. 7.2 theme/theme.inc \template_preprocess_admin_toolbar()

Preprocessor for theme('admin_toolbar').

File

theme/theme.inc, line 6

Code

function template_preprocess_admin_toolbar(&$vars) {

  // Set the active block.
  $active = admin_get_settings('active_tab') ? admin_get_settings('active_tab') : key($vars['blocks']);
  if (!empty($vars['blocks'])) {
    $vars['tabs'] = array();
    foreach ($vars['blocks'] as $bid => $block) {
      $vars['tabs'][$bid] = array(
        'title' => $block->subject,
        'attributes' => array(
          'id' => 'admin-tab-' . $bid,
        ),
      );
      if ($bid == $active) {
        $vars['blocks'][$bid]->class = 'admin-active';
        $vars['tabs'][$bid]['active'] = TRUE;
      }
    }
  }
}