diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-02-10 19:01:36 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-02-10 19:01:36 +0000 |
commit | e9e68300d568c39deb2eb4b1733fa01794a51d7a (patch) | |
tree | 61588f7e4796615b8d083f325bc1533f13612983 | |
parent | 8ba137ff38529caf789b1a61928473a3a9f2b820 (diff) | |
download | elgg-e9e68300d568c39deb2eb4b1733fa01794a51d7a.tar.gz elgg-e9e68300d568c39deb2eb4b1733fa01794a51d7a.tar.bz2 |
Cleaned up the admin directory using a pagehandler.
git-svn-id: https://code.elgg.org/elgg/trunk@2713 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | admin/plugins.php (renamed from admin/plugins/index.php) | 2 | ||||
-rw-r--r-- | admin/site.php (renamed from admin/site/index.php) | 2 | ||||
-rw-r--r-- | admin/statistics.php (renamed from admin/statistics/index.php) | 2 | ||||
-rw-r--r-- | admin/user.php (renamed from admin/user/index.php) | 2 | ||||
-rw-r--r-- | engine/lib/admin.php | 27 |
5 files changed, 31 insertions, 4 deletions
diff --git a/admin/plugins/index.php b/admin/plugins.php index 420e53990..9d3b3218a 100644 --- a/admin/plugins/index.php +++ b/admin/plugins.php @@ -13,7 +13,7 @@ */ // Get the Elgg framework - require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); + require_once(dirname(dirname(__FILE__)) . "/engine/start.php"); // Make sure only valid admin users can see this admin_gatekeeper(); diff --git a/admin/site/index.php b/admin/site.php index 17edec1d2..7803b4a39 100644 --- a/admin/site/index.php +++ b/admin/site.php @@ -12,7 +12,7 @@ */
// Get the Elgg framework
- require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
+ require_once(dirname(dirname(__FILE__)) . "/engine/start.php");
// Make sure only valid admin users can see this
admin_gatekeeper();
diff --git a/admin/statistics/index.php b/admin/statistics.php index 43393f5d6..fcc42bad5 100644 --- a/admin/statistics/index.php +++ b/admin/statistics.php @@ -13,7 +13,7 @@ */ // Get the Elgg framework - require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); + require_once(dirname(dirname(__FILE__)) . "/engine/start.php"); // Make sure only valid admin users can see this admin_gatekeeper(); diff --git a/admin/user/index.php b/admin/user.php index f6ec4990d..37160d2a7 100644 --- a/admin/user/index.php +++ b/admin/user.php @@ -12,7 +12,7 @@ */
// Get the Elgg framework
- require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
+ require_once(dirname(dirname(__FILE__)) . "/engine/start.php");
// Make sure only valid admin users can see this
admin_gatekeeper();
diff --git a/engine/lib/admin.php b/engine/lib/admin.php index ad40926c0..1c44d80a5 100644 --- a/engine/lib/admin.php +++ b/engine/lib/admin.php @@ -54,6 +54,9 @@ // Register some actions
register_action('admin/site/update_basic', false, "", true); // Register basic site admin action
+ // Page handler
+ register_page_handler('admin','admin_settings_page_handler');
+
if (isadminloggedin()) {
global $is_admin;
$is_admin = true;
@@ -74,6 +77,30 @@ }
}
+
+ function admin_settings_page_handler($page)
+ {
+ global $CONFIG;
+
+ $path = $CONFIG->path . "admin/index.php";
+
+ if ($page[0])
+ {
+ switch ($page[0])
+ {
+ case 'user' : $path = $CONFIG->path . "admin/user.php"; break;
+ case 'statistics' : $path = $CONFIG->path . "admin/statistics.php"; break;
+ case 'plugins' : $path = $CONFIG->path . "admin/plugins.php"; break;
+ case 'site' : $path = $CONFIG->path . "admin/site.php"; break;
+ }
+ }
+
+ if ($page[1])
+ set_input('username', $page[1]);
+
+ include($path);
+ }
+
/**
* Admin permissions system
|