From 5d090b23cca3b0f831b29fe4dad2926f1b3b33fc Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 30 Sep 2010 23:04:47 +0000 Subject: Refs #2344 - moves settings pages into the pages directory git-svn-id: http://code.elgg.org/elgg/trunk@6986 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/usersettings.php | 16 +++++++++++----- pages/settings/index.php | 21 +++++++++++++++++++++ pages/settings/plugins.php | 24 ++++++++++++++++++++++++ pages/settings/statistics.php | 24 ++++++++++++++++++++++++ pages/settings/user.php | 24 ++++++++++++++++++++++++ settings/index.php | 24 ------------------------ settings/plugins.php | 26 -------------------------- settings/statistics.php | 27 --------------------------- settings/user.php | 27 --------------------------- 9 files changed, 104 insertions(+), 109 deletions(-) create mode 100644 pages/settings/index.php create mode 100644 pages/settings/plugins.php create mode 100644 pages/settings/statistics.php create mode 100644 pages/settings/user.php delete mode 100644 settings/index.php delete mode 100644 settings/plugins.php delete mode 100644 settings/statistics.php delete mode 100644 settings/user.php diff --git a/engine/lib/usersettings.php b/engine/lib/usersettings.php index baaf41562..e4416ab5e 100644 --- a/engine/lib/usersettings.php +++ b/engine/lib/usersettings.php @@ -46,13 +46,19 @@ function usersettings_pagesetup() { function usersettings_page_handler($page) { global $CONFIG; - $path = $CONFIG->path . "settings/index.php"; + $path = $CONFIG->path . "pages/settings/index.php"; if ($page[0]) { switch ($page[0]) { - case 'user' : $path = $CONFIG->path . "settings/user.php"; break; - case 'statistics' : $path = $CONFIG->path . "settings/statistics.php"; break; - case 'plugins' : $path = $CONFIG->path . "settings/plugins.php"; break; + case 'user': + $path = $CONFIG->path . "pages/settings/user.php"; + break; + case 'statistics': + $path = $CONFIG->path . "pages/settings/statistics.php"; + break; + case 'plugins': + $path = $CONFIG->path . "pages/settings/plugins.php"; + break; } } @@ -60,7 +66,7 @@ function usersettings_page_handler($page) { set_input('username', $page[1]); } - include($path); + require($path); } /** diff --git a/pages/settings/index.php b/pages/settings/index.php new file mode 100644 index 000000000..53b5a3490 --- /dev/null +++ b/pages/settings/index.php @@ -0,0 +1,21 @@ +canEdit())) { + set_page_owner(get_loggedin_userid()); +} + +// Forward to the user settings +forward('pg/settings/user/' . page_owner_entity()->username . "/"); \ No newline at end of file diff --git a/pages/settings/plugins.php b/pages/settings/plugins.php new file mode 100644 index 000000000..0ce633c6f --- /dev/null +++ b/pages/settings/plugins.php @@ -0,0 +1,24 @@ +canEdit())) { + set_page_owner(get_loggedin_userid()); +} + +$content = elgg_view_title(elgg_echo("usersettings:plugins")); +$content .= elgg_view("usersettings/plugins", array('installed_plugins' => get_installed_plugins())); + +$body = elgg_view_layout('one_column_with_sidebar', $content); + +page_draw(elgg_echo("usersettings:plugins"), $body); diff --git a/pages/settings/statistics.php b/pages/settings/statistics.php new file mode 100644 index 000000000..9f6fceed0 --- /dev/null +++ b/pages/settings/statistics.php @@ -0,0 +1,24 @@ +canEdit())) { + set_page_owner(get_loggedin_userid()); +} + +$content = elgg_view_title(elgg_echo("usersettings:statistics")); +$content .= elgg_view("usersettings/statistics"); + +$body = elgg_view_layout('one_column_with_sidebar', $content); + +page_draw(elgg_echo("usersettings:statistics"), $body); diff --git a/pages/settings/user.php b/pages/settings/user.php new file mode 100644 index 000000000..3bcd3e09e --- /dev/null +++ b/pages/settings/user.php @@ -0,0 +1,24 @@ +canEdit())) { + set_page_owner(get_loggedin_userid()); +} + +$content = elgg_view_title(elgg_echo('usersettings:user')); +$content .= elgg_view("usersettings/form"); + +$body = elgg_view_layout("one_column_with_sidebar", $content); + +page_draw(elgg_echo("usersettings:user"), $body); diff --git a/settings/index.php b/settings/index.php deleted file mode 100644 index a786a4e51..000000000 --- a/settings/index.php +++ /dev/null @@ -1,24 +0,0 @@ -canEdit())) { - set_page_owner(get_loggedin_userid()); -} - -// Forward to the user settings -forward('pg/settings/user/' . page_owner_entity()->username . "/"); \ No newline at end of file diff --git a/settings/plugins.php b/settings/plugins.php deleted file mode 100644 index 719634d52..000000000 --- a/settings/plugins.php +++ /dev/null @@ -1,26 +0,0 @@ -canEdit())) { - set_page_owner(get_loggedin_userid()); -} - -$content = elgg_view_title(elgg_echo("usersettings:plugins")); -$content .= elgg_view("usersettings/plugins", array('installed_plugins' => get_installed_plugins())); - -$body = elgg_view_layout('one_column_with_sidebar', $content); - -page_draw(elgg_echo("usersettings:plugins"), $body); diff --git a/settings/statistics.php b/settings/statistics.php deleted file mode 100644 index e0d2edbf5..000000000 --- a/settings/statistics.php +++ /dev/null @@ -1,27 +0,0 @@ -canEdit())) { - set_page_owner(get_loggedin_userid()); -} - -$content = elgg_view_title(elgg_echo("usersettings:statistics")); -$content .= elgg_view("usersettings/statistics"); - -$body = elgg_view_layout('one_column_with_sidebar', $content); - -page_draw(elgg_echo("usersettings:statistics"), $body); diff --git a/settings/user.php b/settings/user.php deleted file mode 100644 index 0d5b0e219..000000000 --- a/settings/user.php +++ /dev/null @@ -1,27 +0,0 @@ -canEdit())) { - set_page_owner(get_loggedin_userid()); -} - -$content = elgg_view_title(elgg_echo('usersettings:user')); -$content .= elgg_view("usersettings/form"); - -$body = elgg_view_layout("one_column_with_sidebar", $content); - -page_draw(elgg_echo("usersettings:user"), $body); -- cgit v1.2.3