[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

/sites/all/modules/admin/toolbar/ -> theme.inc (source)

   1  <?php
   2  
   3  /**
   4   * Preprocessor for theme('admin_toolbar').
   5   */
   6  function admin_preprocess_admin_toolbar(&$vars) {
   7    $vars['collapsed'] = TRUE;
   8    foreach ($vars['tree'] as $depth => $menus) {
   9      foreach ($menus as $href => $links) {
  10        $class = ($depth > 0) ? 'collapsed' : '';
  11        if ($depth > 0 && admin_in_active_trail($href)) {
  12          $class = '';
  13          $vars['collapsed'] = FALSE;
  14        }
  15        $id = str_replace('/', '-', $href);
  16  
  17        // If we aren't on the top level menu, provide a way to get to the top level page.
  18        if ($depth > 0 && !empty($links)) {
  19          $links['view-all'] = array(
  20            'title' => t('View all'),
  21            'href' => $href,
  22          );
  23        }
  24        $vars["tree_{$depth}"][$id] = theme('links', $links, array('class' => "links clear-block $class", 'id' => "admin-toolbar-{$id}"));
  25      }
  26    }
  27  }
  28  
  29  /**
  30   * Theme function for contextual popups.
  31   */
  32  function admin_preprocess_admin_links(&$vars) {
  33    if (!empty($vars['links']) && is_array($vars['links'])) {
  34      $links = '';
  35      foreach ($vars['links'] as $link) {
  36        $links .= l($link['title'], $link['href'], $link);
  37      }
  38      $vars['links'] = $links;
  39    }
  40  }


Generated: Mon Jul 9 18:01:44 2012 Cross-referenced by PHPXref 0.7