From 11cc3f9f5b2551322e6c51a453291e7ecf5d364d Mon Sep 17 00:00:00 2001 From: cash Date: Sun, 13 Feb 2011 19:01:29 +0000 Subject: user settings library is now user_settings.php git-svn-id: http://code.elgg.org/elgg/trunk@8203 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/user_settings.php | 89 ++++++++++++++++++++++++++++++++++++++++++++ engine/lib/usersettings.php | 89 -------------------------------------------- engine/start.php | 2 +- 3 files changed, 90 insertions(+), 90 deletions(-) create mode 100644 engine/lib/user_settings.php delete mode 100644 engine/lib/usersettings.php (limited to 'engine') diff --git a/engine/lib/user_settings.php b/engine/lib/user_settings.php new file mode 100644 index 000000000..f74c01975 --- /dev/null +++ b/engine/lib/user_settings.php @@ -0,0 +1,89 @@ + '1_account', + 'title' => elgg_echo('usersettings:user:opt:linktext'), + 'url' => "pg/settings/user/{$user->username}", + ); + elgg_register_menu_item('page', $params); + $params = array( + 'name' => '1_plugins', + 'title' => elgg_echo('usersettings:plugins:opt:linktext'), + 'url' => "pg/settings/plugins/{$user->username}", + ); + elgg_register_menu_item('page', $params); + $params = array( + 'name' => '1_statistics', + 'title' => elgg_echo('usersettings:statistics:opt:linktext'), + 'url' => "pg/settings/statistics/{$user->username}", + ); + elgg_register_menu_item('page', $params); + } +} + +/** + * Page handler for user settings + * + * @param array $page Pages array + * + * @return void + */ +function usersettings_page_handler($page) { + global $CONFIG; + + if (!isset($page[0])) { + $page[0] = 'user'; + } + + switch ($page[0]) { + case 'statistics': + $path = $CONFIG->path . "pages/settings/statistics.php"; + break; + case 'plugins': + $path = $CONFIG->path . "pages/settings/tools.php"; + break; + case 'user': + default: + $path = $CONFIG->path . "pages/settings/account.php"; + break; + } + + if ($page[1]) { + $user = get_user_by_username($page[1]); + elgg_set_page_owner_guid($user->guid); + } else { + elgg_set_page_owner_guid(elgg_get_logged_in_user_guid()); + } + + require($path); +} + +/** + * Initialise the admin page. + * + * @return void + */ +function usersettings_init() { + // Page handler + register_page_handler('settings', 'usersettings_page_handler'); +} + +/// Register init function +elgg_register_event_handler('init', 'system', 'usersettings_init'); +elgg_register_event_handler('pagesetup', 'system', 'usersettings_pagesetup'); diff --git a/engine/lib/usersettings.php b/engine/lib/usersettings.php deleted file mode 100644 index f74c01975..000000000 --- a/engine/lib/usersettings.php +++ /dev/null @@ -1,89 +0,0 @@ - '1_account', - 'title' => elgg_echo('usersettings:user:opt:linktext'), - 'url' => "pg/settings/user/{$user->username}", - ); - elgg_register_menu_item('page', $params); - $params = array( - 'name' => '1_plugins', - 'title' => elgg_echo('usersettings:plugins:opt:linktext'), - 'url' => "pg/settings/plugins/{$user->username}", - ); - elgg_register_menu_item('page', $params); - $params = array( - 'name' => '1_statistics', - 'title' => elgg_echo('usersettings:statistics:opt:linktext'), - 'url' => "pg/settings/statistics/{$user->username}", - ); - elgg_register_menu_item('page', $params); - } -} - -/** - * Page handler for user settings - * - * @param array $page Pages array - * - * @return void - */ -function usersettings_page_handler($page) { - global $CONFIG; - - if (!isset($page[0])) { - $page[0] = 'user'; - } - - switch ($page[0]) { - case 'statistics': - $path = $CONFIG->path . "pages/settings/statistics.php"; - break; - case 'plugins': - $path = $CONFIG->path . "pages/settings/tools.php"; - break; - case 'user': - default: - $path = $CONFIG->path . "pages/settings/account.php"; - break; - } - - if ($page[1]) { - $user = get_user_by_username($page[1]); - elgg_set_page_owner_guid($user->guid); - } else { - elgg_set_page_owner_guid(elgg_get_logged_in_user_guid()); - } - - require($path); -} - -/** - * Initialise the admin page. - * - * @return void - */ -function usersettings_init() { - // Page handler - register_page_handler('settings', 'usersettings_page_handler'); -} - -/// Register init function -elgg_register_event_handler('init', 'system', 'usersettings_init'); -elgg_register_event_handler('pagesetup', 'system', 'usersettings_pagesetup'); diff --git a/engine/start.php b/engine/start.php index 916464c26..c65c6dd03 100644 --- a/engine/start.php +++ b/engine/start.php @@ -99,7 +99,7 @@ $lib_files = array( 'metastrings.php', 'navigation.php', 'notification.php', 'objects.php', 'opendd.php', 'pagehandler.php', 'pageowner.php', 'pam.php', 'plugins.php', 'private_settings.php', 'relationships.php', 'river.php', 'sites.php', - 'statistics.php', 'tags.php', 'usersettings.php', 'users.php', + 'statistics.php', 'tags.php', 'user_settings.php', 'users.php', 'version.php', 'web_services.php', 'widgets.php', 'xml.php', 'xml-rpc.php', //backwards compatibility -- cgit v1.2.3