aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/handlers/page_handler.php2
-rw-r--r--engine/lib/admin.php69
-rw-r--r--engine/lib/widgets.php2
-rw-r--r--languages/en.php23
-rw-r--r--mod/developers/languages/en.php2
-rw-r--r--mod/developers/start.php5
-rw-r--r--mod/diagnostics/start.php2
-rw-r--r--mod/externalpages/start.php2
-rw-r--r--mod/logbrowser/start.php2
-rw-r--r--mod/reportedcontent/start.php3
-rw-r--r--mod/uservalidationbyemail/start.php2
-rw-r--r--views/default/admin/settings/advanced.php (renamed from views/default/admin/site/advanced.php)0
-rw-r--r--views/default/admin/settings/basic.php (renamed from views/default/admin/site/basic.php)0
-rw-r--r--views/default/admin/settings/default_widgets.php (renamed from views/default/admin/appearance/default_widgets.php)8
-rw-r--r--views/default/admin/settings/menu_items.php (renamed from views/default/admin/appearance/menu_items.php)0
-rw-r--r--views/default/admin/settings/profile_fields.php (renamed from views/default/admin/appearance/profile_fields.php)2
-rw-r--r--views/default/admin/settings/profile_fields/list.php (renamed from views/default/admin/appearance/profile_fields/list.php)0
-rw-r--r--views/default/admin/sidebar.php15
-rw-r--r--views/default/css/admin.php16
-rw-r--r--views/default/js/admin.php3
20 files changed, 89 insertions, 69 deletions
diff --git a/engine/handlers/page_handler.php b/engine/handlers/page_handler.php
index bfdb0cee3..7b1b95459 100644
--- a/engine/handlers/page_handler.php
+++ b/engine/handlers/page_handler.php
@@ -32,7 +32,9 @@ require_once(dirname(dirname(__FILE__)) . "/start.php");
$url = current_page_url();
$new_url = preg_replace('#/pg/#', '/', $url);
+
if ($url !== $new_url) {
+ die('site');
header("HTTP/1.1 301 Moved Permanently");
header("Location: $new_url");
}
diff --git a/engine/lib/admin.php b/engine/lib/admin.php
index 7774f78e0..39ba07ad3 100644
--- a/engine/lib/admin.php
+++ b/engine/lib/admin.php
@@ -117,18 +117,20 @@ function elgg_admin_notice_exists($id) {
*
* This function handles registering the parent if it has not been registered.
*
+ * @param string $section The menu section to add to
* @param string $menu_id The Unique ID of section
- * @param string $parent_id If a child section, the parent section id.
- * @param int $priority The menu item priority
+ * @param string $parent_id If a child section, the parent section id
+ * @param int $priority The menu item priority
*
* @return bool
* @since 1.8.0
*/
-function elgg_register_admin_menu_item($menu_id, $parent_id = NULL, $priority = 100) {
+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('page', $parent_id)) {
- elgg_register_admin_menu_item($parent_id);
+ if ($parent_id && !elgg_is_menu_item_registered($menu_name, $parent_id)) {
+ elgg_register_admin_menu_item($section, $parent_id);
}
// in the admin section parents never have links
@@ -143,7 +145,7 @@ function elgg_register_admin_menu_item($menu_id, $parent_id = NULL, $priority =
$name = "$parent_id:$name";
}
- return elgg_register_menu_item('page', array(
+ return elgg_register_menu_item($menu_name, array(
'name' => $name,
'href' => $href,
'text' => elgg_echo("admin:$name"),
@@ -181,39 +183,38 @@ function admin_init() {
elgg_register_simplecache_view('js/admin');
- // statistics
- elgg_register_admin_menu_item('statistics', null, 60);
- elgg_register_admin_menu_item('overview', 'statistics');
-
- // site
- elgg_register_admin_menu_item('site', null, 20);
- elgg_register_admin_menu_item('basic', 'site', 10);
- elgg_register_admin_menu_item('advanced', 'site', 20);
-
- // appearance
- elgg_register_admin_menu_item('appearance', null, 30);
- elgg_register_admin_menu_item('menu_items', 'appearance', 10);
- elgg_register_admin_menu_item('profile_fields', 'appearance', 20);
-
- // users
- elgg_register_admin_menu_item('users', null, 40);
- elgg_register_admin_menu_item('add', 'users', 10);
- elgg_register_admin_menu_item('online', 'users', 20);
- elgg_register_admin_menu_item('newest', 'users', 30);
-
- // plugins
- elgg_register_admin_menu_item('plugins', null, 50);
- elgg_register_admin_menu_item('simple', 'plugins', 10);
- elgg_register_admin_menu_item('advanced', 'plugins', 20);
-
+ // administer
// dashboard
- elgg_register_menu_item('page', array(
+ elgg_register_menu_item('admin-administer', array(
'name' => 'dashboard',
'href' => 'admin/dashboard',
'text' => elgg_echo('admin:dashboard'),
'context' => 'admin',
'priority' => 10,
));
+ // statistics
+ elgg_register_admin_menu_item('administer', 'statistics', null, 20);
+ elgg_register_admin_menu_item('administer', 'overview', 'statistics');
+
+ // users
+ elgg_register_admin_menu_item('administer', 'users', null, 20);
+ elgg_register_admin_menu_item('administer', 'online', 'users', 10);
+ elgg_register_admin_menu_item('administer', 'newest', 'users', 20);
+ elgg_register_admin_menu_item('administer', 'add', 'users', 30);
+
+ // configure
+ // plugins
+ elgg_register_admin_menu_item('configure', 'plugins', null, 10);
+ elgg_register_admin_menu_item('configure', 'simple', 'plugins', 10);
+ elgg_register_admin_menu_item('configure', 'advanced', 'plugins', 20);
+
+ // settings
+ elgg_register_admin_menu_item('configure', 'basic', 'settings', 10);
+ elgg_register_admin_menu_item('configure', 'advanced', 'settings', 20);
+ elgg_register_admin_menu_item('configure', 'menu_items', 'settings', 30);
+ elgg_register_admin_menu_item('configure', 'profile_fields', 'settings', 40);
+ // default widgets is added via an event handler elgg_default_widgets_init() because it
+ // requires additional setup.
elgg_register_menu_item('topbar', array(
'name' => 'administration',
@@ -255,12 +256,12 @@ function elgg_admin_add_plugin_settings_menu() {
return FALSE;
}
- elgg_register_admin_menu_item('plugin_settings', null, 51);
+ elgg_register_admin_menu_item('configure', 'plugin_settings', null, 51);
foreach ($active_plugins as $plugin) {
$plugin_id = $plugin->getID();
if (elgg_view_exists("settings/$plugin_id/edit")) {
- elgg_register_menu_item('page', array(
+ elgg_register_menu_item('admin-configure', array(
'name' => $plugin_id,
'href' => "admin/plugin_settings/$plugin_id",
'text' => $plugin->manifest->getName(),
diff --git a/engine/lib/widgets.php b/engine/lib/widgets.php
index 53b4a3309..71f0c3ce9 100644
--- a/engine/lib/widgets.php
+++ b/engine/lib/widgets.php
@@ -288,7 +288,7 @@ function elgg_default_widgets_init() {
$CONFIG->default_widget_info = $default_widgets;
if ($default_widgets) {
- elgg_register_admin_menu_item('default_widgets', 'appearance', 30);
+ elgg_register_admin_menu_item('configure', 'default_widgets', 'settings');
// override permissions for creating widget on logged out / just created entities
elgg_register_plugin_hook_handler('container_permissions_check', 'object', 'elgg_default_widgets_permissions_override');
diff --git a/languages/en.php b/languages/en.php
index 2084137b3..290fa9dcf 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -372,7 +372,7 @@ $english = array(
'profile:twitter' => "Twitter username",
'profile:saved' => "Your profile was successfully saved.",
- 'admin:appearance:profile_fields' => 'Edit profile fields',
+ 'admin:settings:profile_fields' => 'Edit profile fields',
'profile:edit:default' => 'Edit profile fields',
'profile:label' => "Profile label",
'profile:type' => "Profile type",
@@ -511,6 +511,9 @@ $english = array(
/**
* Administration
*/
+ 'admin:administer' => 'Administer',
+ 'admin:configure' => 'Configure',
+ 'admin:develop' => 'Develop',
'admin:view_site' => 'View site',
'admin:loggedin' => 'Logged in as %s',
@@ -533,16 +536,16 @@ $english = array(
'admin:users' => "Users",
'admin:users:online' => 'Currently Online',
'admin:users:newest' => 'Newest',
- 'admin:users:add' => 'Add',
+ 'admin:users:add' => 'Add New User',
'admin:users:description' => "This admin panel allows you to control user settings for your site. Choose an option below to get started.",
'admin:users:adduser:label' => "Click here to add a new user...",
'admin:users:opt:linktext' => "Configure users...",
'admin:users:opt:description' => "Configure users and account information. ",
'admin:users:find' => 'Find',
- 'admin:site' => "Site",
- 'admin:site:basic' => 'Basic Settings',
- 'admin:site:advanced' => 'Advanced Settings',
+ 'admin:settings' => 'Settings',
+ 'admin:settings:basic' => 'Basic Settings',
+ 'admin:settings:advanced' => 'Advanced Settings',
'admin:site:description' => "This admin panel allows you to control global settings for your site. Choose an option below to get started.",
'admin:site:opt:linktext' => "Configure site...",
'admin:site:access:warning' => "Changing the access setting only affects the permissions on content created in the future.",
@@ -668,7 +671,7 @@ $english = array(
'admin:user:ban:yes' => "User banned.",
'admin:user:self:ban:no' => "You cannot ban yourself",
'admin:user:unban:no' => "Can not unban user",
- 'admin:user:unban:yes' => "User un-banned.",
+ 'admin:user:unban:yes' => "User unbanned.",
'admin:user:delete:no' => "Can not delete user",
'admin:user:delete:yes' => "The user %s has been deleted",
'admin:user:self:delete:no' => "You cannot delete yourself",
@@ -683,7 +686,7 @@ $english = array(
'admin:user:removeadmin:no' => "We could not remove administrator privileges from this user.",
'admin:user:self:removeadmin:no' => "You cannot remove your own administrator privileges.",
- 'admin:appearance:menu_items' => 'Menu Items',
+ 'admin:settings:menu_items' => 'Menu Items',
'admin:menu_items:configure' => 'Configure main menu items',
'admin:menu_items:description' => 'Select which menu items you want to show as featured links. Unused items will be added as "More" at the end of the list.',
'admin:menu_items:hide_toolbar_entries' => 'Remove links from tool bar menu?',
@@ -691,9 +694,9 @@ $english = array(
'admin:add_menu_item' => 'Add a custom menu item',
'admin:add_menu_item:description' => 'Fill out the Display name and URL to add custom items to your navigation menu.',
- 'admin:appearance:default_widgets' => 'Default Widgets',
- 'admin:appearance:default_widgets:unknown_type' => 'Unknown widget type',
- 'admin:appearance:default_widgets:instructions' => 'Add, remove, position, and configure default widgets for the selected widget page.'
+ 'admin:settings:default_widgets' => 'Default Widgets',
+ 'admin:default_widgets:unknown_type' => 'Unknown widget type',
+ 'admin:default_widgets:instructions' => 'Add, remove, position, and configure default widgets for the selected widget page.'
. ' These changes will apply only to new content on the site.',
/**
diff --git a/mod/developers/languages/en.php b/mod/developers/languages/en.php
index 7c9ec93d3..8bc1f596a 100644
--- a/mod/developers/languages/en.php
+++ b/mod/developers/languages/en.php
@@ -7,7 +7,7 @@
$english = array(
// menu
'admin:developers' => 'Developers',
- 'admin:developers:settings' => 'Settings',
+ 'admin:developers:settings' => 'Developer Settings',
'admin:developers:preview' => 'Theming Preview',
// settings
diff --git a/mod/developers/start.php b/mod/developers/start.php
index ff33f3e91..3c2f6bd5f 100644
--- a/mod/developers/start.php
+++ b/mod/developers/start.php
@@ -18,9 +18,8 @@ function developers_init() {
function developers_setup_menu() {
if (elgg_in_context('admin')) {
- elgg_register_admin_menu_item('developers');
- elgg_register_admin_menu_item('settings', 'developers');
- elgg_register_admin_menu_item('preview', 'developers');
+ elgg_register_admin_menu_item('develop', 'settings', 'developers');
+ elgg_register_admin_menu_item('develop', 'preview', 'developers');
}
}
diff --git a/mod/diagnostics/start.php b/mod/diagnostics/start.php
index 74c53e2f6..d310684ba 100644
--- a/mod/diagnostics/start.php
+++ b/mod/diagnostics/start.php
@@ -16,7 +16,7 @@ function diagnostics_init() {
elgg_register_page_handler('diagnostics','diagnostics_page_handler');
// Add admin menu item
- elgg_register_admin_menu_item('diagnostics', 'utilities');
+ elgg_register_admin_menu_item('develop', 'diagnostics', 'utilities');
// Register some actions
$file = elgg_get_plugins_path() . "diagnostics/actions/download.php";
diff --git a/mod/externalpages/start.php b/mod/externalpages/start.php
index 533d71104..9ec7c174e 100644
--- a/mod/externalpages/start.php
+++ b/mod/externalpages/start.php
@@ -11,7 +11,7 @@ function expages_init() {
elgg_register_page_handler('expages', 'expages_page_handler');
// add a menu item for the admin edit page
- elgg_register_admin_menu_item('expages', 'site');
+ elgg_register_admin_menu_item('configure', 'expages', 'site');
// add footer links
expages_setup_footer_menu();
diff --git a/mod/logbrowser/start.php b/mod/logbrowser/start.php
index 5b4e0541e..eedc9d8ad 100644
--- a/mod/logbrowser/start.php
+++ b/mod/logbrowser/start.php
@@ -14,7 +14,7 @@ function logbrowser_init() {
elgg_register_plugin_hook_handler('register', 'menu:user_hover', 'logbrowser_user_hover_menu');
- elgg_register_admin_menu_item('logbrowser', 'utilities');
+ elgg_register_admin_menu_item('administer', 'logbrowser', 'utilities');
}
/**
diff --git a/mod/reportedcontent/start.php b/mod/reportedcontent/start.php
index a7e3afe19..406624e50 100644
--- a/mod/reportedcontent/start.php
+++ b/mod/reportedcontent/start.php
@@ -37,7 +37,8 @@ function reportedcontent_init() {
elgg_register_plugin_hook_handler('register', 'menu:user_hover', 'reportedcontent_user_hover_menu');
// Add admin menu item
- elgg_register_admin_menu_item('reportedcontent', 'utilities');
+ // @todo Might want to move this to a 'feedback' section. something other than utils
+ elgg_register_admin_menu_item('administer', 'reportedcontent', 'utilities');
elgg_register_widget_type(
'reportedcontent',
diff --git a/mod/uservalidationbyemail/start.php b/mod/uservalidationbyemail/start.php
index 175905d1d..d3d0c3488 100644
--- a/mod/uservalidationbyemail/start.php
+++ b/mod/uservalidationbyemail/start.php
@@ -39,7 +39,7 @@ function uservalidationbyemail_init() {
elgg_register_plugin_hook_handler('public_pages', 'walled_garden', 'uservalidationbyemail_public_pages');
// admin interface to manually validate users
- elgg_register_admin_menu_item('unvalidated', 'users');
+ elgg_register_admin_menu_item('administer', 'unvalidated', 'users');
elgg_extend_view('js/elgg', 'uservalidationbyemail/js');
diff --git a/views/default/admin/site/advanced.php b/views/default/admin/settings/advanced.php
index 12e4303e7..12e4303e7 100644
--- a/views/default/admin/site/advanced.php
+++ b/views/default/admin/settings/advanced.php
diff --git a/views/default/admin/site/basic.php b/views/default/admin/settings/basic.php
index 3b8f4f183..3b8f4f183 100644
--- a/views/default/admin/site/basic.php
+++ b/views/default/admin/settings/basic.php
diff --git a/views/default/admin/appearance/default_widgets.php b/views/default/admin/settings/default_widgets.php
index 7462dfa7c..ce9f6a5c2 100644
--- a/views/default/admin/appearance/default_widgets.php
+++ b/views/default/admin/settings/default_widgets.php
@@ -18,7 +18,7 @@ if (!$widget_context && $list) {
$current_info = null;
$tabs = array();
foreach ($list as $info) {
- $url = "admin/appearance/default_widgets?widget_context={$info['widget_context']}";
+ $url = "admin/settings/default_widgets?widget_context={$info['widget_context']}";
$selected = false;
if ($widget_context == $info['widget_context']) {
$selected = true;
@@ -38,10 +38,10 @@ $tabs_vars = array(
echo elgg_view('navigation/tabs', $tabs_vars);
-echo elgg_view('output/longtext', array('value' => elgg_echo('admin:appearance:default_widgets:instructions')));
+echo elgg_view('output/longtext', array('value' => elgg_echo('admin:default_widgets:instructions')));
if (!$current_info) {
- $content = elgg_echo('admin:appearance:default_widgets:unknown_type');
+ $content = elgg_echo('admin:default_widgets:unknown_type');
} else {
// default widgets are owned and saved to the site.
elgg_set_page_owner_guid(elgg_get_config('site_guid'));
@@ -62,4 +62,4 @@ if (!$current_info) {
}
elgg_pop_context();
-echo $content; \ No newline at end of file
+echo $content;
diff --git a/views/default/admin/appearance/menu_items.php b/views/default/admin/settings/menu_items.php
index 4e35e032f..4e35e032f 100644
--- a/views/default/admin/appearance/menu_items.php
+++ b/views/default/admin/settings/menu_items.php
diff --git a/views/default/admin/appearance/profile_fields.php b/views/default/admin/settings/profile_fields.php
index 7077687cc..e9dc609e3 100644
--- a/views/default/admin/appearance/profile_fields.php
+++ b/views/default/admin/settings/profile_fields.php
@@ -4,7 +4,7 @@
*/
$add = elgg_view_form('profile/fields/add', array(), array());
-$list = elgg_view('admin/appearance/profile_fields/list');
+$list = elgg_view('admin/settings/profile_fields/list');
$reset = elgg_view_form('profile/fields/reset', array(), array());
$body = <<<__HTML
diff --git a/views/default/admin/appearance/profile_fields/list.php b/views/default/admin/settings/profile_fields/list.php
index 493129583..493129583 100644
--- a/views/default/admin/appearance/profile_fields/list.php
+++ b/views/default/admin/settings/profile_fields/list.php
diff --git a/views/default/admin/sidebar.php b/views/default/admin/sidebar.php
index b2c520705..a6c16c758 100644
--- a/views/default/admin/sidebar.php
+++ b/views/default/admin/sidebar.php
@@ -1,8 +1,17 @@
<?php
/**
- * Admin sidebar -- just outputs the page menu
+ * Admin sidebar -- just outputs the page menus
*/
+$sections = array('administer', 'configure', 'develop');
+$content = '';
-$content = elgg_view_menu('page', array('sort_by' => 'priority'));
+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;
+ }
+}
-echo elgg_view_module('main', '', $content); \ No newline at end of file
+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 1a8747f3a..3a3c8eb16 100644
--- a/views/default/css/admin.php
+++ b/views/default/css/admin.php
@@ -266,7 +266,8 @@ table.mceLayout {
/* ***************************************
SIDEBAR MENU
*************************************** */
-.elgg-menu-page a {
+.elgg-admin-sidebar-menu a {
+ border: 1px solid red;
display: block;
padding: 5px;
color: #333333;
@@ -279,31 +280,32 @@ table.mceLayout {
-moz-border-radius: 5px;
border-radius: 5px;
}
-.elgg-menu-page a:hover {
+
+.elgg-admin-sidebar-menu a:hover {
text-decoration: none;
background: black;
color: white;
border: 1px solid black;
}
-.elgg-menu-page li.elgg-state-selected > a {
+.elgg-admin-sidebar-menu li.elgg-state-selected > a {
background-color: #BBB;
}
-.elgg-menu-page .elgg-menu-closed:before {
+.elgg-admin-sidebar-menu .elgg-menu-closed:before {
content: "\25B8";
padding-right: 4px;
}
-.elgg-menu-page .elgg-menu-opened:before {
+.elgg-admin-sidebar-menu .elgg-menu-opened:before {
content: "\25BE";
padding-right: 4px;
}
-.elgg-menu-page .elgg-child-menu {
+.elgg-admin-sidebar-menu .elgg-child-menu {
display: none;
padding-left: 30px;
}
-.elgg-menu-page li.elgg-state-selected > ul {
+.elgg-admin-sidebar-menu li.elgg-state-selected > ul {
display: block;
}
diff --git a/views/default/js/admin.php b/views/default/js/admin.php
index 15c74d4de..d37dc7a81 100644
--- a/views/default/js/admin.php
+++ b/views/default/js/admin.php
@@ -16,6 +16,9 @@ elgg.admin.init = function () {
$(this).stop().slideUp('medium');
});
+ // semi-custom menus
+ $('.elgg-admin-sidebar-menu .elgg-menu-parent').live('click', elgg.ui.toggleMenu);
+
// plugin screenshot modal
$('.elgg-plugin-screenshot a').click(elgg.admin.displayPluginScreenshot);