diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-26 23:47:07 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-26 23:47:07 +0000 |
commit | 299ce66ecea22ffbfc84cdf5ea8d91af3e290db1 (patch) | |
tree | ed95d4533d6c44c1dfe76c928686eb1e10506668 /engine/lib/navigation.php | |
parent | 09acb61949e1051fc25e8fcf5936068415281802 (diff) | |
download | elgg-299ce66ecea22ffbfc84cdf5ea8d91af3e290db1.tar.gz elgg-299ce66ecea22ffbfc84cdf5ea8d91af3e290db1.tar.bz2 |
Fixes #2951 not registering utilities menu item by default but added code to automatically register a parent menu if not registered in admin menu registration function. We lose the ability to set a weight on utilities.
git-svn-id: http://code.elgg.org/elgg/trunk@8501 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/navigation.php')
-rw-r--r-- | engine/lib/navigation.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/engine/lib/navigation.php b/engine/lib/navigation.php index 2e6906945..4affc9c30 100644 --- a/engine/lib/navigation.php +++ b/engine/lib/navigation.php @@ -76,6 +76,31 @@ function elgg_unregister_menu_item($menu_name, $item_name) { } /** + * Check if a menu item has been registered + * + * @param string $menu_name The name of the menu + * @param string $item_name The unique identifier for this menu item + * + * @return bool + * @since 1.8.0 + */ +function elgg_is_menu_item_registered($menu_name, $item_name) { + global $CONFIG; + + if (!isset($CONFIG->menus[$menu_name])) { + return false; + } + + foreach ($CONFIG->menus[$menu_name] as $index => $menu_object) { + if ($menu_object->getName() == $item_name) { + return true; + } + } + + return false; +} + +/** * Adds a breadcrumb to the breadcrumbs stack. * * @param string $title The title to display |