From c3f0a32b2bc8d055bfce97e20079cb7840746cd5 Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 30 Oct 2010 20:30:16 +0000 Subject: pulled navigation functions out of elgglib.php git-svn-id: http://code.elgg.org/elgg/trunk@7136 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/elgglib.php | 554 +++------------------------------------------- engine/lib/navigation.php | 502 +++++++++++++++++++++++++++++++++++++++++ engine/start.php | 22 +- install/ElggInstaller.php | 3 +- 4 files changed, 545 insertions(+), 536 deletions(-) create mode 100644 engine/lib/navigation.php diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 2f9acf060..ff7886561 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -140,326 +140,6 @@ function current_page_url() { return $page; } -/** - * Deprecated by elgg_add_submenu_item() - * - * @see elgg_add_submenu_item() - * @deprecated 1.8 - * - * @param string $label The label - * @param string $link The link - * @param string $group The group to store item in - * @param boolean $onclick Add a confirmation when clicked? - * @param boolean $selected Is menu item selected - * - * @return bool - */ -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. - // if context == 'main' (default) it probably means they always wanted - // the menu item to show up everywhere. - $context = get_context(); - - if ($context == 'main') { - $context = 'all'; - } - return elgg_add_submenu_item($item, $context, $group); -} - -/** - * Add an entry to the submenu. - * - * @param array $item The item as: - * - * array( - * 'title' => 'Text to display', - * 'url' => 'URL of the link', - * 'id' => 'entry_unique_id' //used by children items to identify parents - * 'parent_id' => 'id_of_parent', - * 'selected' => BOOL // Is this item selected? (If NULL or unset will attempt to guess) - * 'vars' => array() // Array of vars to pass to the navigation/submenu_item view - * ) - * - * - * @param string $context Context in which to display this menu item. 'all' - * will make it show up all the time. Use sparingly. - * @param string $group Group for the item. Each submenu group has its own