aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-13 21:40:44 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-13 21:40:44 +0000
commit24fa2b9166f50aa7e0dbb49fb58fb379d3445d96 (patch)
tree67e5524a6c468280f208ad4127f694dfbbfac744 /engine/lib
parentc59f246eea6f8cf37c5cf1e20ac3f75102b9c320 (diff)
downloadelgg-24fa2b9166f50aa7e0dbb49fb58fb379d3445d96.tar.gz
elgg-24fa2b9166f50aa7e0dbb49fb58fb379d3445d96.tar.bz2
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
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/deprecated-1.8.php17
1 files changed, 17 insertions, 0 deletions
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];
}