aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/navigation.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-22 01:57:47 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-22 01:57:47 +0000
commitc7a2297071f81e121df0d8aa66ccdb70f8b7a989 (patch)
tree51d020718943a5225ab3f8233300f3e5dcacfdc9 /engine/lib/navigation.php
parent512586af6f4c57e42b2bd94b9171bfef4300d402 (diff)
downloadelgg-c7a2297071f81e121df0d8aa66ccdb70f8b7a989.tar.gz
elgg-c7a2297071f81e121df0d8aa66ccdb70f8b7a989.tar.bz2
deprecated add_menu() and made it compatible with 1.8
git-svn-id: http://code.elgg.org/elgg/trunk@7892 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/navigation.php')
-rw-r--r--engine/lib/navigation.php27
1 files changed, 9 insertions, 18 deletions
diff --git a/engine/lib/navigation.php b/engine/lib/navigation.php
index 773e6f25b..a6554fd99 100644
--- a/engine/lib/navigation.php
+++ b/engine/lib/navigation.php
@@ -484,29 +484,20 @@ function elgg_get_nav_items() {
*
* @param string $menu_name The name of the menu item
* @param string $menu_url The URL of the page
- * @param array $menu_children Optionally, an array of submenu items (not currently used)
- * @param string $context The context of the menu
+ * @param array $menu_children Optionally, an array of submenu items (not used)
+ * @param string $context (not used)
*
* @return true|false Depending on success
- * @todo Can be deprecated when the new menu system is introduced.
+ * @deprecated 1.8 use elgg_register_menu_item() for the menu 'site'
*/
function add_menu($menu_name, $menu_url, $menu_children = array(), $context = "") {
- global $CONFIG;
-
- if (!isset($CONFIG->menucontexts)) {
- $CONFIG->menucontexts = array();
- }
-
- if (empty($context)) {
- $context = get_plugin_name();
- }
-
- $value = new stdClass();
- $value->url = elgg_normalize_url($menu_url);
- $value->context = $context;
+ elgg_deprecated_notice('add_menu() deprecated by elgg_register_menu_item()', 1.8);
- $CONFIG->menucontexts[] = $context;
- return add_to_register('menu', $menu_name, $value, $menu_children);
+ return elgg_register_menu_item('site', array(
+ 'name' => $menu_name,
+ 'title' => $menu_name,
+ 'url' => $menu_url,
+ ));
}
/**