diff options
Diffstat (limited to 'engine')
-rw-r--r-- | engine/lib/notification.php | 2 | ||||
-rw-r--r-- | engine/lib/statistics.php | 4 | ||||
-rw-r--r-- | engine/lib/users.php | 25 | ||||
-rw-r--r-- | engine/lib/usersettings.php | 35 |
4 files changed, 30 insertions, 36 deletions
diff --git a/engine/lib/notification.php b/engine/lib/notification.php index 5a96b9623..5b53a4a10 100644 --- a/engine/lib/notification.php +++ b/engine/lib/notification.php @@ -360,7 +360,7 @@ function notification_init() { register_notification_handler("email", "email_notify_handler"); // Add settings view to user settings & register action - extend_elgg_settings_page('usersettings/notifications', 'usersettings/user'); + elgg_extend_view('forms/account/settings', 'core/settings/account/notifications'); elgg_register_plugin_hook_handler('usersettings:save', 'user', 'notification_user_settings_save'); } diff --git a/engine/lib/statistics.php b/engine/lib/statistics.php index 085584317..578985fd0 100644 --- a/engine/lib/statistics.php +++ b/engine/lib/statistics.php @@ -110,8 +110,8 @@ function get_online_users() { * @return void */ function statistics_init() { - extend_elgg_settings_page('usersettings/statistics_opt/online', 'usersettings/statistics'); - extend_elgg_settings_page('usersettings/statistics_opt/numentities', 'usersettings/statistics'); + elgg_extend_view('core/settings/statistics', 'core/settings/statistics/online'); + elgg_extend_view('core/settings/statistics', 'core/settings/statistics/numentities'); } /// Register init function diff --git a/engine/lib/users.php b/engine/lib/users.php index 076f7b9f7..4e34586a3 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -1544,25 +1544,12 @@ function users_init() { elgg_register_widget_type('friends', elgg_echo("friends"), elgg_echo('friends:widget:description')); - // User name change - extend_elgg_settings_page('user/settings/name', 'usersettings/user', 1); - //elgg_register_action("user/name"); - - // User password change - extend_elgg_settings_page('user/settings/password', 'usersettings/user', 1); - //elgg_register_action("user/password"); - - // Add email settings - extend_elgg_settings_page('user/settings/email', 'usersettings/user', 1); - //elgg_register_action("email/save"); - - // Add language settings - extend_elgg_settings_page('user/settings/language', 'usersettings/user', 1); - - // Add default access settings - extend_elgg_settings_page('user/settings/default_access', 'usersettings/user', 1); - - //elgg_register_action("user/language"); + // extend the account settings form + elgg_extend_view('forms/account/settings', 'core/settings/account/name', 100); + elgg_extend_view('forms/account/settings', 'core/settings/account/password', 100); + elgg_extend_view('forms/account/settings', 'core/settings/account/email', 100); + elgg_extend_view('forms/account/settings', 'core/settings/account/language', 100); + elgg_extend_view('forms/account/settings', 'core/settings/account/default_access', 100); // Register the user type register_entity_type('user', ''); diff --git a/engine/lib/usersettings.php b/engine/lib/usersettings.php index 1696dd1cd..7192ea0fa 100644 --- a/engine/lib/usersettings.php +++ b/engine/lib/usersettings.php @@ -26,9 +26,12 @@ * @param int $priority Optional priority to govern the appearance in the list. * * @return bool + * @deprecated 1.8 Extend oone of the views in core/settings */ function extend_elgg_settings_page($new_settings_view, $view = 'usersettings/main', $priority = 500) { + // see views: /core/settings + elgg_deprecated_notice("extend_elgg_settings_page has been deprecated. Extend on of the settings views instead", 1.8); return elgg_extend_view($view, $new_settings_view, $priority); } @@ -66,24 +69,28 @@ function usersettings_pagesetup() { function usersettings_page_handler($page) { global $CONFIG; - $path = $CONFIG->path . "pages/settings/index.php"; + if (!isset($page[0])) { + $page[0] = 'user'; + } - if ($page[0]) { - switch ($page[0]) { - 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; - } + 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]) { - set_input('username', $page[1]); + $user = get_user_by_username($page[1]); + elgg_set_page_owner_guid($user->guid); + } else { + elgg_set_page_owner_guid(get_loggedin_userid()); } require($path); |