From e9e68300d568c39deb2eb4b1733fa01794a51d7a Mon Sep 17 00:00:00 2001 From: marcus Date: Tue, 10 Feb 2009 19:01:36 +0000 Subject: Cleaned up the admin directory using a pagehandler. git-svn-id: https://code.elgg.org/elgg/trunk@2713 36083f99-b078-4883-b0ff-0f9b5a30f544 --- admin/plugins.php | 30 ++++++++++++++++++++++++++++++ admin/plugins/index.php | 30 ------------------------------ admin/site.php | 26 ++++++++++++++++++++++++++ admin/site/index.php | 26 -------------------------- admin/statistics.php | 27 +++++++++++++++++++++++++++ admin/statistics/index.php | 27 --------------------------- admin/user.php | 45 +++++++++++++++++++++++++++++++++++++++++++++ admin/user/index.php | 45 --------------------------------------------- engine/lib/admin.php | 27 +++++++++++++++++++++++++++ 9 files changed, 155 insertions(+), 128 deletions(-) create mode 100644 admin/plugins.php delete mode 100644 admin/plugins/index.php create mode 100644 admin/site.php delete mode 100644 admin/site/index.php create mode 100644 admin/statistics.php delete mode 100644 admin/statistics/index.php create mode 100644 admin/user.php delete mode 100644 admin/user/index.php diff --git a/admin/plugins.php b/admin/plugins.php new file mode 100644 index 000000000..9d3b3218a --- /dev/null +++ b/admin/plugins.php @@ -0,0 +1,30 @@ + get_installed_plugins())))); + +?> \ No newline at end of file diff --git a/admin/plugins/index.php b/admin/plugins/index.php deleted file mode 100644 index 420e53990..000000000 --- a/admin/plugins/index.php +++ /dev/null @@ -1,30 +0,0 @@ - get_installed_plugins())))); - -?> \ No newline at end of file diff --git a/admin/site.php b/admin/site.php new file mode 100644 index 000000000..7803b4a39 --- /dev/null +++ b/admin/site.php @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/admin/site/index.php b/admin/site/index.php deleted file mode 100644 index 17edec1d2..000000000 --- a/admin/site/index.php +++ /dev/null @@ -1,26 +0,0 @@ - \ No newline at end of file diff --git a/admin/statistics.php b/admin/statistics.php new file mode 100644 index 000000000..fcc42bad5 --- /dev/null +++ b/admin/statistics.php @@ -0,0 +1,27 @@ + diff --git a/admin/statistics/index.php b/admin/statistics/index.php deleted file mode 100644 index 43393f5d6..000000000 --- a/admin/statistics/index.php +++ /dev/null @@ -1,27 +0,0 @@ - diff --git a/admin/user.php b/admin/user.php new file mode 100644 index 000000000..37160d2a7 --- /dev/null +++ b/admin/user.php @@ -0,0 +1,45 @@ + \ No newline at end of file diff --git a/admin/user/index.php b/admin/user/index.php deleted file mode 100644 index f6ec4990d..000000000 --- a/admin/user/index.php +++ /dev/null @@ -1,45 +0,0 @@ - \ No newline at end of file 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 -- cgit v1.2.3