aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/navigation.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-29 13:36:33 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-29 13:36:33 +0000
commit6412a94c3c21ce163c68546e33bdeb9c8650e9f9 (patch)
treed361d0c268a8b6342f8f522b499e9aac5121359b /engine/lib/navigation.php
parent8f7a86ebae5f6fd3f64f976a83cfc6712e083c2a (diff)
downloadelgg-6412a94c3c21ce163c68546e33bdeb9c8650e9f9.tar.gz
elgg-6412a94c3c21ce163c68546e33bdeb9c8650e9f9.tar.bz2
page menu using the new menu system - admin menu updated
git-svn-id: http://code.elgg.org/elgg/trunk@7738 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/navigation.php')
-rw-r--r--engine/lib/navigation.php42
1 files changed, 28 insertions, 14 deletions
diff --git a/engine/lib/navigation.php b/engine/lib/navigation.php
index ed19976cd..773e6f25b 100644
--- a/engine/lib/navigation.php
+++ b/engine/lib/navigation.php
@@ -88,20 +88,6 @@ function elgg_unregister_menu_item($menu_name, $item_name) {
function add_submenu_item($label, $link, $group = 'default', $onclick = false, $selected = NULL) {
elgg_deprecated_notice('add_submenu_item was deprecated by elgg_add_submenu_item', 1.8);
- $item = array(
- 'text' => $label,
- 'href' => $link,
- 'selected' => $selected
- );
-
- if (!$group) {
- $group = 'default';
- }
-
- if ($onclick) {
- $js = "onclick=\"javascript:return confirm('" . elgg_echo('deleteconfirm') . "')\"";
- $item['vars'] = array('js' => $js);
- }
// submenu items were added in the page setup hook usually by checking
// the context. We'll pass in the current context here, which will
// emulate that effect.
@@ -112,7 +98,35 @@ function add_submenu_item($label, $link, $group = 'default', $onclick = false, $
if ($context == 'main') {
$context = 'all';
}
+
+ $item = array(
+ 'name' => $label,
+ 'title' => $label,
+ 'url' => $link,
+ 'context' => $context,
+ 'section' => $group,
+ );
+
+ if ($selected) {
+ $item['selected'] = true;
+ }
+
+ if ($onclick) {
+ $js = "onclick=\"javascript:return confirm('" . elgg_echo('deleteconfirm') . "')\"";
+ $item['vars'] = array('js' => $js);
+ }
+
+ return elgg_register_menu_item('page', $item);
+/*
+ $item = array(
+ 'text' => $label,
+ 'href' => $link,
+ 'selected' => $selected
+ );
+
return elgg_add_submenu_item($item, $context, $group);
+ *
+ */
}
/**