From d3efed2f847ced2ecfaa536856f6a0acc4cddbfc Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 4 Aug 2008 17:08:31 +0000 Subject: User settings git-svn-id: https://code.elgg.org/elgg/trunk@1689 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/users.php | 28 ++++++--- engine/lib/usersettings.php | 21 +++++-- languages/en.php | 63 ++++++++++++++++++- mod/profile/languages/en.php | 70 ---------------------- mod/profile/start.php | 3 - settings/index.php | 15 ++--- settings/plugins/index.php | 22 ------- settings/statistics/index.php | 3 +- settings/user/index.php | 3 +- .../notifications/settings/usersettings.php | 14 ++++- views/default/page_elements/elgg_topbar.php | 2 +- views/default/user/settings/email.php | 7 ++- views/default/user/settings/language.php | 2 +- views/default/user/settings/name.php | 7 ++- views/default/user/settings/password.php | 11 +++- views/default/usersettings/form.php | 3 + views/default/usersettings/statistics.php | 3 - .../usersettings/statistics_opt/numentities.php | 24 ++++---- .../default/usersettings/statistics_opt/online.php | 12 ++-- 19 files changed, 157 insertions(+), 156 deletions(-) delete mode 100644 mod/profile/languages/en.php delete mode 100644 settings/plugins/index.php diff --git a/engine/lib/users.php b/engine/lib/users.php index 70879f9c0..ec247337a 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -1113,19 +1113,15 @@ } /** - * Users initialisation function, which establishes the page handler + * Sets up user-related menu items * */ - function users_init() { + function users_pagesetup() { // Load config global $CONFIG; - - // Set up menu for logged in users - if (isloggedin()) - add_menu(elgg_echo('friends'), $CONFIG->wwwroot . "pg/friends/" . $_SESSION['user']->username); - - //add submenu options + + //add submenu options if (get_context() == "friends" || get_context() == "friendsof" || get_context() == "collections") { @@ -1133,6 +1129,21 @@ add_submenu_item(elgg_echo('friends:of'),$CONFIG->wwwroot."pg/friendsof/" . page_owner_entity()->username); } + } + + /** + * Users initialisation function, which establishes the page handler + * + */ + function users_init() { + + // Load config + global $CONFIG; + + // Set up menu for logged in users + if (isloggedin()) + add_menu(elgg_echo('friends'), $CONFIG->wwwroot . "pg/friends/" . $_SESSION['user']->username); + register_page_handler('friends','friends_page_handler'); register_page_handler('friendsof','friends_of_page_handler'); register_page_handler('collections','collections_page_handler'); @@ -1210,5 +1221,6 @@ //register actions ************************************************************* register_elgg_event_handler('init','system','users_init',0); + register_elgg_event_handler('pagesetup','system','users_pagesetup',0); ?> \ No newline at end of file diff --git a/engine/lib/usersettings.php b/engine/lib/usersettings.php index 487ea9230..433d41fb7 100644 --- a/engine/lib/usersettings.php +++ b/engine/lib/usersettings.php @@ -32,20 +32,29 @@ { return extend_view($view, $new_settings_view, $priority); } - + + function usersettings_pagesetup() { + + // Get config + global $CONFIG; + + // Menu options + if (get_context() == "settings") { + add_submenu_item(elgg_echo('usersettings:user:opt:linktext'),$CONFIG->wwwroot . "pg/settings/user?username=" . $_SESSION['user']->username); + add_submenu_item(elgg_echo('profile:editicon'), $CONFIG->wwwroot . 'mod/profile/editicon.php'); + add_submenu_item(elgg_echo('usersettings:statistics:opt:linktext'),$CONFIG->wwwroot . "pg/settings/statistics?username=" . $_SESSION['user']->username); + } + } + /** * Initialise the admin page. */ function usersettings_init() { - // Add plugin main menu option (last) - extend_elgg_settings_page('usersettings/main_opt/statistics', 'usersettings/main'); - extend_elgg_settings_page('usersettings/main_opt/user', 'usersettings/main'); - extend_elgg_settings_page('usersettings/main_opt/plugins', 'usersettings/main', 999); // Always last } /// Register init function - register_elgg_event_handler('init','system','usersettings_init'); + register_elgg_event_handler('pagesetup','system','usersettings_pagesetup'); ?> \ No newline at end of file diff --git a/languages/en.php b/languages/en.php index b0f77eb49..8a30ff4ff 100644 --- a/languages/en.php +++ b/languages/en.php @@ -170,11 +170,68 @@ 'dashboard' => "Dashboard", 'dashboard:nowidgets' => "Your dashboard is your gateway into the site. Click 'Customise Layout' to add widgets to keep track of content and your life within the system.", + /** + * Groups + */ + + 'item:group' => "Groups", + /** * Profile */ 'profile' => "Profile", + 'user' => "User", + + /** + * Profile menu items and titles + */ + + 'profile:yours' => "Your profile", + 'profile:user' => "%s's profile", + + 'profile:edit' => "Edit profile", + 'profile:editicon' => "Upload a new profile picture", + 'profile:profilepictureinstructions' => "The profile picture is the image that's displayed on your profile page.
You can change it as often as you'd like. (File formats accepted: GIF, JPG or PNG)", + 'profile:icon' => "Profile picture", + 'profile:createicon' => "Create your avatar", + 'profile:currentavatar' => "Current avatar", + 'profile:createicon:header' => "Profile picture", + 'profile:profilepicturecroppingtool' => "Profile picture cropping tool", + 'profile:createicon:instructions' => "Click and drag a square below to match how you want your picture cropped. A preview of your cropped picture will appear in the box on the right. When you are happy with the preview, click 'Create your avatar'. This cropped image will be used throughout the site as your avatar. ", + + 'profile:editdetails' => "Edit details", + 'profile:editicon' => "Edit profile icon", + + 'profile:aboutme' => "About me", + 'profile:description' => "About me", + 'profile:briefdescription' => "Brief description", + 'profile:location' => "Location", + 'profile:skills' => "Skills", + 'profile:interests' => "Interests", + 'profile:contactemail' => "Contact email", + 'profile:phone' => "Telephone", + 'profile:mobile' => "Mobile phone", + 'profile:website' => "Website", + + 'profile:river:update' => "%s updated their profile", + 'profile:river:iconupdate' => "%s updated their profile icon", + + /** + * Profile status messages + */ + + 'profile:saved' => "Your profile was successfully saved.", + 'profile:icon:uploaded' => "Your profile picture was successfully uploaded.", + + /** + * Profile error messages + */ + + 'profile:noaccess' => "You do not have permission to edit this profile.", + 'profile:notfound' => "Sorry; we could not find the specified profile.", + 'profile:cantedit' => "Sorry; you do not have permission to edit this profile.", + 'profile:icon:notfound' => "Sorry; there was a problem uploading your profile picture.", /** * Friends @@ -382,13 +439,12 @@ 'usersettings:description' => "The user settings panel allows you to control all your personal settings, from user management to how plugins behave. Choose an option below to get started.", 'usersettings:statistics' => "Your statistics", - 'usersettings:statistics:description' => "This panel will allow you to view statistics about you.", 'usersettings:statistics:opt:description' => "View statistical information about users and objects on your site.", - 'usersettings:statistics:opt:linktext' => "View statistics...", + 'usersettings:statistics:opt:linktext' => "Account statistics", 'usersettings:user' => "Your settings", 'usersettings:user:opt:description' => "This allows you to control user settings.", - 'usersettings:user:opt:linktext' => "Configure your user settings...", + 'usersettings:user:opt:linktext' => "Change your settings", 'usersettings:plugins' => "Tools", 'usersettings:plugins:opt:description' => "Configure settings for your active tools.", @@ -467,6 +523,7 @@ 'widgets' => "Widgets", 'widget' => "Widget", + 'item:object:widget' => "Widgets", 'layout:customise' => "Customise layout", 'widgets:gallery' => "Widget gallery", 'widgets:leftcolumn' => "Left widgets", diff --git a/mod/profile/languages/en.php b/mod/profile/languages/en.php deleted file mode 100644 index c11d0169a..000000000 --- a/mod/profile/languages/en.php +++ /dev/null @@ -1,70 +0,0 @@ - - * @copyright Curverider Ltd 2008 - * @link http://elgg.com/ - */ - - $english = array( - - /** - * Menu items and titles - */ - - 'profile' => "Profile", - 'profile:yours' => "Your profile", - 'profile:user' => "%s's profile", - - 'profile:edit' => "Edit profile", - 'profile:editicon' => "Upload a new profile picture", - 'profile:profilepictureinstructions' => "The profile picture is the image that's displayed on your profile page.
You can change it as often as you'd like. (File formats accepted: GIF, JPG or PNG)", - 'profile:icon' => "Profile picture", - 'profile:createicon' => "Create your avatar", - 'profile:currentavatar' => "Current avatar", - 'profile:createicon:header' => "Profile picture", - 'profile:profilepicturecroppingtool' => "Profile picture cropping tool", - 'profile:createicon:instructions' => "Click and drag a square below to match how you want your picture cropped. A preview of your cropped picture will appear in the box on the right. When you are happy with the preview, click 'Create your avatar'. This cropped image will be used throughout the site as your avatar. ", - - 'profile:editdetails' => "Edit details", - 'profile:editicon' => "Edit profile icon", - - 'profile:aboutme' => "About me", - 'profile:description' => "About me", - 'profile:briefdescription' => "Brief description", - 'profile:location' => "Location", - 'profile:skills' => "Skills", - 'profile:interests' => "Interests", - 'profile:contactemail' => "Contact email", - 'profile:phone' => "Telephone", - 'profile:mobile' => "Mobile phone", - 'profile:website' => "Website", - - 'profile:river:update' => "%s updated their profile", - 'profile:river:iconupdate' => "%s updated their profile icon", - - /** - * Status messages - */ - - 'profile:saved' => "Your profile was successfully saved.", - 'profile:icon:uploaded' => "Your profile picture was successfully uploaded.", - - /** - * Error messages - */ - - 'profile:noaccess' => "You do not have permission to edit this profile.", - 'profile:notfound' => "Sorry; we could not find the specified profile.", - 'profile:cantedit' => "Sorry; you do not have permission to edit this profile.", - 'profile:icon:notfound' => "Sorry; there was a problem uploading your profile picture.", - - ); - - add_translation("en",$english); - -?> \ No newline at end of file diff --git a/mod/profile/start.php b/mod/profile/start.php index 4f967f59c..e8e8b57dd 100644 --- a/mod/profile/start.php +++ b/mod/profile/start.php @@ -19,9 +19,6 @@ // Get config global $CONFIG; - // Load the language file - register_translations($CONFIG->pluginspath . "profile/languages/"); - // Register a URL handler for users - this means that profile_url() // will dictate the URL for all ElggUser objects register_entity_url_handler('profile_url','user','all'); diff --git a/settings/index.php b/settings/index.php index 47cf9caba..5906ca842 100644 --- a/settings/index.php +++ b/settings/index.php @@ -11,16 +11,9 @@ */ // Get the Elgg framework - require_once(dirname(dirname(__FILE__)) . "/engine/start.php"); - - // Make sure only valid users can see this - gatekeeper(); - - - - /// Default settings - + require_once(dirname(dirname(__FILE__)) . "/engine/start.php"); + + // Forward to the user settings + forward('pg/settings/user'); - // Display main admin menu - page_draw(elgg_echo("admin"),elgg_view_layout("one_column", elgg_view("usersettings/main"))); ?> \ No newline at end of file diff --git a/settings/plugins/index.php b/settings/plugins/index.php deleted file mode 100644 index d45fbd334..000000000 --- a/settings/plugins/index.php +++ /dev/null @@ -1,22 +0,0 @@ - get_installed_plugins())))); -?> \ No newline at end of file diff --git a/settings/statistics/index.php b/settings/statistics/index.php index 303838a81..52546956d 100644 --- a/settings/statistics/index.php +++ b/settings/statistics/index.php @@ -15,8 +15,7 @@ // Make sure only valid admin users can see this gatekeeper(); - // Display main admin menu - page_draw(elgg_echo("usersettings:statistics"),elgg_view_layout("one_column",elgg_view("usersettings/statistics"))); + page_draw(elgg_echo("usersettings:statistics"),elgg_view_layout('two_column_left_sidebar','',elgg_view_title(elgg_echo("usersettings:statistics")) . elgg_view("usersettings/statistics"))); ?> \ No newline at end of file diff --git a/settings/user/index.php b/settings/user/index.php index 99701a83d..b86181308 100644 --- a/settings/user/index.php +++ b/settings/user/index.php @@ -20,7 +20,6 @@ // Display main admin menu page_draw( elgg_echo("usersettings:user"), - elgg_view_layout("one_column", - elgg_view("usersettings/form")) + elgg_view_layout("two_column_left_sidebar", '', elgg_view_title(elgg_echo('usersettings:user')) . elgg_view("usersettings/form")) ); ?> \ No newline at end of file diff --git a/views/default/notifications/settings/usersettings.php b/views/default/notifications/settings/usersettings.php index edbaf5584..2792ccd4a 100644 --- a/views/default/notifications/settings/usersettings.php +++ b/views/default/notifications/settings/usersettings.php @@ -26,9 +26,17 @@ : - - $k) echo "checked=\"yes\" "; ?>/>
- $k) echo "checked=\"yes\" "; ?>/> + +k) { + $val = "yes"; + } else { + $val = "no"; + } + echo elgg_view('input/radio',array('internalname' => "method[{$k}]", 'options' => array('yes','no'), 'value' => $val)); + +?> - +

- : + : + 'email', 'value' => $user->email)); + + ?>

\ No newline at end of file diff --git a/views/default/user/settings/language.php b/views/default/user/settings/language.php index 0d478ac95..0dbe66b26 100644 --- a/views/default/user/settings/language.php +++ b/views/default/user/settings/language.php @@ -18,7 +18,7 @@

- : : language; if ($user->language) diff --git a/views/default/user/settings/name.php b/views/default/user/settings/name.php index da0ded99a..0faac2428 100644 --- a/views/default/user/settings/name.php +++ b/views/default/user/settings/name.php @@ -16,7 +16,12 @@ ?>

- : + : + 'name', 'value' => $user->name)); + + ?>

\ No newline at end of file diff --git a/views/default/user/settings/password.php b/views/default/user/settings/password.php index b40a131e6..b180609c6 100644 --- a/views/default/user/settings/password.php +++ b/views/default/user/settings/password.php @@ -14,10 +14,15 @@ if ($user) { ?> -

+

- : - : + : + 'password')); + ?>
+ : 'password2')); + ?>

\ No newline at end of file diff --git a/views/default/usersettings/form.php b/views/default/usersettings/form.php index c6f2f4968..e245a0da1 100644 --- a/views/default/usersettings/form.php +++ b/views/default/usersettings/form.php @@ -1,9 +1,12 @@
+ +
+

diff --git a/views/default/usersettings/statistics.php b/views/default/usersettings/statistics.php index 8ab6712c6..a130e730e 100644 --- a/views/default/usersettings/statistics.php +++ b/views/default/usersettings/statistics.php @@ -10,7 +10,4 @@ * @link http://elgg.org/ */ - global $CONFIG; - - echo "

" . autop(elgg_echo("usersettings:statistics:description")) . "

"; ?> \ No newline at end of file diff --git a/views/default/usersettings/statistics_opt/numentities.php b/views/default/usersettings/statistics_opt/numentities.php index 4fe218048..c6d634f62 100644 --- a/views/default/usersettings/statistics_opt/numentities.php +++ b/views/default/usersettings/statistics_opt/numentities.php @@ -17,27 +17,31 @@ if ($entity_stats) { ?> -
-

+
+

$entry) { - echo "
"; foreach ($entry as $a => $b) { - if ($a == "__base__") - $a=$k; - else - $a = "$k $a"; + if ($a == "__base__") { + $a = elgg_echo("item:{$k}"); + if (empty($a)) + $a = $k; + } else { + $a = elgg_echo("item:{$k}:{$a}"); + if (empty($a)) { + $a = "$k $a"; + } + } echo <<< END - - + + END; } - echo "
$a :$b{$a}:{$b}
"; } ?> diff --git a/views/default/usersettings/statistics_opt/online.php b/views/default/usersettings/statistics_opt/online.php index 6a4cb9c1b..4f4a07015 100644 --- a/views/default/usersettings/statistics_opt/online.php +++ b/views/default/usersettings/statistics_opt/online.php @@ -18,13 +18,13 @@ $logged_in=$log[0]->time_created; ?> -
-

+
+

- - - - + + + +
name; ?>
email; ?>
time_created); ?>
name; ?>
email; ?>
time_created); ?>
\ No newline at end of file -- cgit v1.2.3