aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-12 17:07:00 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-12 17:07:00 +0000
commit653517bf635ad6ecb65738b46b11b3056ccca983 (patch)
tree938724e544d32616bd4f42d496db901dd61182d5
parent92033ed233d2640a060990d27e6173d90a621b9b (diff)
downloadelgg-653517bf635ad6ecb65738b46b11b3056ccca983.tar.gz
elgg-653517bf635ad6ecb65738b46b11b3056ccca983.tar.bz2
Refs #2991. Using section for admin menu.
git-svn-id: http://code.elgg.org/elgg/trunk@8664 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/lib/admin.php12
-rw-r--r--languages/en.php6
-rw-r--r--views/default/admin/sidebar.php11
-rw-r--r--views/default/css/admin.php8
4 files changed, 19 insertions, 18 deletions
diff --git a/engine/lib/admin.php b/engine/lib/admin.php
index 39ba07ad3..bab2da64e 100644
--- a/engine/lib/admin.php
+++ b/engine/lib/admin.php
@@ -126,10 +126,9 @@ function elgg_admin_notice_exists($id) {
* @since 1.8.0
*/
function elgg_register_admin_menu_item($section, $menu_id, $parent_id = NULL, $priority = 100) {
- $menu_name = "admin-$section";
// make sure parent is registered
- if ($parent_id && !elgg_is_menu_item_registered($menu_name, $parent_id)) {
+ if ($parent_id && !elgg_is_menu_item_registered($menu_id, $parent_id)) {
elgg_register_admin_menu_item($section, $parent_id);
}
@@ -145,13 +144,14 @@ function elgg_register_admin_menu_item($section, $menu_id, $parent_id = NULL, $p
$name = "$parent_id:$name";
}
- return elgg_register_menu_item($menu_name, array(
+ return elgg_register_menu_item('page', array(
'name' => $name,
'href' => $href,
'text' => elgg_echo("admin:$name"),
'context' => 'admin',
'parent_name' => $parent_id,
'priority' => $priority,
+ 'section' => $section
));
}
@@ -185,12 +185,13 @@ function admin_init() {
// administer
// dashboard
- elgg_register_menu_item('admin-administer', array(
+ elgg_register_menu_item('page', array(
'name' => 'dashboard',
'href' => 'admin/dashboard',
'text' => elgg_echo('admin:dashboard'),
'context' => 'admin',
'priority' => 10,
+ 'section' => 'administer'
));
// statistics
elgg_register_admin_menu_item('administer', 'statistics', null, 20);
@@ -261,12 +262,13 @@ function elgg_admin_add_plugin_settings_menu() {
foreach ($active_plugins as $plugin) {
$plugin_id = $plugin->getID();
if (elgg_view_exists("settings/$plugin_id/edit")) {
- elgg_register_menu_item('admin-configure', array(
+ elgg_register_menu_item('page', array(
'name' => $plugin_id,
'href' => "admin/plugin_settings/$plugin_id",
'text' => $plugin->manifest->getName(),
'parent_name' => 'plugin_settings',
'context' => 'admin',
+ 'section' => 'configure',
));
}
}
diff --git a/languages/en.php b/languages/en.php
index 290fa9dcf..156a4d506 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -511,9 +511,9 @@ $english = array(
/**
* Administration
*/
- 'admin:administer' => 'Administer',
- 'admin:configure' => 'Configure',
- 'admin:develop' => 'Develop',
+ 'menu:page:header:administer' => 'Administer',
+ 'menu:page:header:configure' => 'Configure',
+ 'menu:page:header:develop' => 'Develop',
'admin:view_site' => 'View site',
'admin:loggedin' => 'Logged in as %s',
diff --git a/views/default/admin/sidebar.php b/views/default/admin/sidebar.php
index a6c16c758..100ce2af8 100644
--- a/views/default/admin/sidebar.php
+++ b/views/default/admin/sidebar.php
@@ -2,16 +2,7 @@
/**
* Admin sidebar -- just outputs the page menus
*/
-$sections = array('administer', 'configure', 'develop');
-$content = '';
-foreach ($sections as $section) {
- $section_content = elgg_view_menu("admin-$section", array('sort_by' => 'priority', 'class' => 'mbl mts'));
-
- if ($section_content) {
- $content .= '<h2>' . elgg_echo("admin:$section") . '</h2>';
- $content .= $section_content;
- }
-}
+$content = elgg_view_menu('page', array('sort_by' => 'priority', 'show_section_headers' => true));
echo elgg_view_module('main', '', $content, array('class' => 'elgg-admin-sidebar-menu')); \ No newline at end of file
diff --git a/views/default/css/admin.php b/views/default/css/admin.php
index 3a3c8eb16..37d53673a 100644
--- a/views/default/css/admin.php
+++ b/views/default/css/admin.php
@@ -309,6 +309,14 @@ table.mceLayout {
display: block;
}
+.elgg-admin-sidebar-menu h2 {
+ padding-bottom: 5px;
+}
+
+.elgg-admin-sidebar-menu ul {
+ padding-bottom: 15px;
+}
+
/* ***************************************
MODULES