aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/elgglib.php
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-16 22:37:00 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-16 22:37:00 +0000
commit8203c8bd6c099146591ad3391fee3c40578e2e6d (patch)
tree12a21bca24ba039e5aff2cfaa37b905f43a18937 /engine/lib/elgglib.php
parent0eb11397722ff6dcf9edfa22933993160f12ca1c (diff)
downloadelgg-8203c8bd6c099146591ad3391fee3c40578e2e6d.tar.gz
elgg-8203c8bd6c099146591ad3391fee3c40578e2e6d.tar.bz2
Registers contexts for each menu item. Refs #32
git-svn-id: https://code.elgg.org/elgg/trunk@938 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/elgglib.php')
-rw-r--r--engine/lib/elgglib.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 1279b8906..1c4d02138 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -449,7 +449,18 @@
* @param array $menu_children Optionally, an array of submenu items
* @return true|false Depending on success
*/
- function add_menu($menu_name, $menu_url, $menu_children = array()) {
+ function add_menu($menu_name, $menu_url, $menu_children = array(), $context = "") {
+ global $CONFIG;
+ if (!isset($CONFIG->menucontexts)) {
+ $CONFIG->menucontexts = array();
+ }
+ if (empty($menu)) {
+ get_plugin_name();
+ }
+ if (empty($context)) {
+ $context = get_plugin_name();
+ }
+ $CONFIG->menucontexts[] = $context;
return add_to_register('menu',$menu_name,$menu_url, $menu_children);
}