From 24fa2b9166f50aa7e0dbb49fb58fb379d3445d96 Mon Sep 17 00:00:00 2001 From: cash Date: Sun, 13 Mar 2011 21:40:44 +0000 Subject: Fixes #3116 old method of getting site menu works again git-svn-id: http://code.elgg.org/elgg/trunk@8696 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/deprecated-1.8.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'engine/lib/deprecated-1.8.php') diff --git a/engine/lib/deprecated-1.8.php b/engine/lib/deprecated-1.8.php index 8aaf003dc..2f082c08b 100644 --- a/engine/lib/deprecated-1.8.php +++ b/engine/lib/deprecated-1.8.php @@ -335,6 +335,23 @@ function get_register($register_name) { elgg_deprecated_notice("get_register() has been deprecated", 1.8); global $CONFIG; + if ($register_name == 'menu') { + // backward compatible code for site menu + $menu = $CONFIG->menus['site']; + $builder = new ElggMenuBuilder($menu); + $menu_items = $builder->getMenu('text'); + $menu_items = $menu_items['default']; + + $menu = array(); + foreach ($menu_items as $item) { + $subregister = new stdClass; + $subregister->name = $item->getText(); + $subregister->value = $item->getHref(); + $menu[$subregister->name] = $subregister; + } + return $menu; + } + if (isset($CONFIG->registers[$register_name])) { return $CONFIG->registers[$register_name]; } -- cgit v1.2.3