aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/admin.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-26 23:47:07 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-26 23:47:07 +0000
commit299ce66ecea22ffbfc84cdf5ea8d91af3e290db1 (patch)
treeed95d4533d6c44c1dfe76c928686eb1e10506668 /engine/lib/admin.php
parent09acb61949e1051fc25e8fcf5936068415281802 (diff)
downloadelgg-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/admin.php')
-rw-r--r--engine/lib/admin.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/engine/lib/admin.php b/engine/lib/admin.php
index be01a150c..b4a55877c 100644
--- a/engine/lib/admin.php
+++ b/engine/lib/admin.php
@@ -115,6 +115,8 @@ function elgg_admin_notice_exists($id) {
*
* The text of the menu item is obtained from elgg_echo(admin:$parent_id:$menu_id)
*
+ * This function handles registering the parent if it has not been registered.
+ *
* @param string $menu_id The Unique ID of section
* @param string $parent_id If a child section, the parent section id.
* @param int $weight The menu item weight
@@ -124,6 +126,11 @@ function elgg_admin_notice_exists($id) {
*/
function elgg_add_admin_menu_item($menu_id, $parent_id = NULL, $weight = 100) {
+ // make sure parent is registered
+ if ($parent_id && !elgg_is_menu_item_registered('page', $parent_id)) {
+ elgg_add_admin_menu_item($parent_id);
+ }
+
// in the admin section parents never have links
if ($parent_id) {
$href = "pg/admin/$parent_id/$menu_id";
@@ -199,9 +206,6 @@ function admin_init() {
elgg_add_admin_menu_item('simple', 'plugins', 10);
elgg_add_admin_menu_item('advanced', 'plugins', 20);
- // utilities
- elgg_add_admin_menu_item('utilities', null, 70);
-
// dashboard
elgg_register_menu_item('page', array(
'name' => 'dashboard',