summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-12-03 20:21:50 +0000
committerDries Buytaert <dries@buytaert.net>2009-12-03 20:21:50 +0000
commitca8416e03637b99cf5846e6e3116ce4d2fcee5a0 (patch)
treec3017e25fa39d3f6caa46bc23fa2e7dd011412f3 /includes
parentd1a2de607e23da467c1366aca04ac5f61328a37a (diff)
downloadbrdo-ca8416e03637b99cf5846e6e3116ce4d2fcee5a0.tar.gz
brdo-ca8416e03637b99cf5846e6e3116ce4d2fcee5a0.tar.bz2
- Patch #542658 by sun: follow-up on move action 'tabs' out of local tasks.
Diffstat (limited to 'includes')
-rw-r--r--includes/menu.inc20
1 files changed, 19 insertions, 1 deletions
diff --git a/includes/menu.inc b/includes/menu.inc
index 934160684..09fe503c4 100644
--- a/includes/menu.inc
+++ b/includes/menu.inc
@@ -1446,7 +1446,20 @@ function theme_menu_local_task($variables) {
*/
function theme_menu_local_action($variables) {
$link = $variables['element']['#link'];
- return '<li>' . l($link['title'], $link['href'], $link['localized_options']) . "</li>\n";
+
+ $output = '<li>';
+ if (isset($link['href'])) {
+ $output .= l($link['title'], $link['href'], isset($link['localized_options']) ? $link['localized_options'] : array());
+ }
+ elseif (!empty($link['localized_options']['html'])) {
+ $output .= $link['title'];
+ }
+ else {
+ $output .= check_plain($link['title']);
+ }
+ $output .= "</li>\n";
+
+ return $output;
}
/**
@@ -1798,6 +1811,11 @@ function menu_local_tasks($level = 0) {
'root_path' => $root_path,
);
}
+ // @todo If there are no tabs, then there still can be actions; for example,
+ // when added via hook_menu_local_tasks_alter().
+ elseif (!empty($data['actions']['output'])) {
+ return array('actions' => $data['actions']) + $empty;
+ }
return $empty;
}