Projet

Général

Profil

Paste
Télécharger (1016 octets) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / themes / bootstrap / theme / menu / menu-local-task.func.php @ 87dbc3bf

1
<?php
2
/**
3
 * @file
4
 * menu-local-task.func.php
5
 */
6

    
7
/**
8
 * Overrides theme_menu_local_task().
9
 */
10
function bootstrap_menu_local_task($variables) {
11
  $link = $variables['element']['#link'];
12
  $link_text = $link['title'];
13
  $classes = array();
14

    
15
  if (!empty($variables['element']['#active'])) {
16
    // Add text to indicate active tab for non-visual users.
17
    $active = '<span class="element-invisible">' . t('(active tab)') . '</span>';
18

    
19
    // If the link does not contain HTML already, check_plain() it now.
20
    // After we set 'html'=TRUE the link will not be sanitized by l().
21
    if (empty($link['localized_options']['html'])) {
22
      $link['title'] = check_plain($link['title']);
23
    }
24
    $link['localized_options']['html'] = TRUE;
25
    $link_text = t('!local-task-title!active', array('!local-task-title' => $link['title'], '!active' => $active));
26

    
27
    $classes[] = 'active';
28
  }
29

    
30
  return '<li class="' . implode(' ', $classes) . '">' . l($link_text, $link['href'], $link['localized_options']) . "</li>\n";
31
}