1 |
87dbc3bf
|
Benjamin Luce
|
<?php
|
2 |
|
|
|
3 |
|
|
|
4 |
|
|
|
5 |
|
|
|
6 |
|
|
|
7 |
|
|
|
8 |
|
|
|
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 |
|
|
|
17 |
|
|
$active = '<span class="element-invisible">' . t('(active tab)') . '</span>';
|
18 |
|
|
|
19 |
|
|
|
20 |
|
|
|
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 |
|
|
} |