aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/lib/users.php28
-rw-r--r--engine/lib/usersettings.php21
-rw-r--r--languages/en.php63
-rw-r--r--mod/profile/languages/en.php70
-rw-r--r--mod/profile/start.php3
-rw-r--r--settings/index.php15
-rw-r--r--settings/plugins/index.php22
-rw-r--r--settings/statistics/index.php3
-rw-r--r--settings/user/index.php3
-rw-r--r--views/default/notifications/settings/usersettings.php14
-rw-r--r--views/default/page_elements/elgg_topbar.php2
-rw-r--r--views/default/user/settings/email.php7
-rw-r--r--views/default/user/settings/language.php2
-rw-r--r--views/default/user/settings/name.php7
-rw-r--r--views/default/user/settings/password.php11
-rw-r--r--views/default/usersettings/form.php3
-rw-r--r--views/default/usersettings/statistics.php3
-rw-r--r--views/default/usersettings/statistics_opt/numentities.php24
-rw-r--r--views/default/usersettings/statistics_opt/online.php12
19 files changed, 157 insertions, 156 deletions
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
@@ -171,10 +171,67 @@
'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. <br /> 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 @@
-<?php
-
- /**
- * Elgg profile plugin language pack
- *
- * @package ElggProfile
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Ben Werdmuller <ben@curverider.co.uk>
- * @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. <br /> 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 @@
-<?php
- /**
- * Elgg user settings functions.
- *
- * @package Elgg
- * @subpackage Core
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Marcus Povey
- * @copyright Curverider Ltd 2008
- * @link http://elgg.org/
- */
-
- // Get the Elgg framework
- require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
-
- // Make sure only valid admin users can see this
- gatekeeper();
-
-
- // Display main admin menu
- page_draw(elgg_echo("usersettings:plugins"),elgg_view_layout("one_column",elgg_view("usersettings/plugins", array('installed_plugins' => 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 @@
<tr>
<td><?php echo $k; ?>: </td>
- <td>
- <input type="radio" name="method[<?php echo $k; ?>]" value="yes" <?php if ($notification_settings->$k) echo "checked=\"yes\" "; ?>/><?php echo elgg_echo("option:yes"); ?><br />
- <input type="radio" name="method[<?php echo $k; ?>]" value="no" <?php if (!$notification_settings->$k) echo "checked=\"yes\" "; ?>/><?php echo elgg_echo("option:no"); ?>
+ <td>
+<?php
+
+ if ($notification_settings->k) {
+ $val = "yes";
+ } else {
+ $val = "no";
+ }
+ echo elgg_view('input/radio',array('internalname' => "method[{$k}]", 'options' => array('yes','no'), 'value' => $val));
+
+?>
</td>
</tr>
<?php
diff --git a/views/default/page_elements/elgg_topbar.php b/views/default/page_elements/elgg_topbar.php
index 7fb88c8ff..d830e7d76 100644
--- a/views/default/page_elements/elgg_topbar.php
+++ b/views/default/page_elements/elgg_topbar.php
@@ -45,7 +45,7 @@
echo elgg_view('elgg_topbar/extend', $vars);
?>
- <a href="<?php echo $vars['url']; ?>settings/" class="usersettings"><?php echo elgg_echo('settings'); ?></a>
+ <a href="<?php echo $vars['url']; ?>pg/settings/" class="usersettings"><?php echo elgg_echo('settings'); ?></a>
<?php
diff --git a/views/default/user/settings/email.php b/views/default/user/settings/email.php
index 24fcc7a0d..6b14504c7 100644
--- a/views/default/user/settings/email.php
+++ b/views/default/user/settings/email.php
@@ -16,7 +16,12 @@
?>
<h2><?php echo elgg_echo('email:settings'); ?></h2>
<p>
- <?php echo elgg_echo('email:address:label'); ?> : <input type="text" name="email" value="<?php echo $user->email; ?>" />
+ <?php echo elgg_echo('email:address:label'); ?>:
+ <?php
+
+ echo elgg_view('input/email',array('internalname' => 'email', 'value' => $user->email));
+
+ ?>
</p>
<?php } ?> \ 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 @@
<h2><?php echo elgg_echo('user:set:language'); ?></h2>
<p>
- <?php echo elgg_echo('user:language:label'); ?> : <?php
+ <?php echo elgg_echo('user:language:label'); ?>: <?php
$value = $CONFIG->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 @@
?>
<h2><?php echo elgg_echo('user:set:name'); ?></h2>
<p>
- <?php echo elgg_echo('user:name:label'); ?> : <input type="text" name="name" value="<?php echo $user->name; ?>" />
+ <?php echo elgg_echo('user:name:label'); ?>:
+ <?php
+
+ echo elgg_view('input/text',array('internalname' => 'name', 'value' => $user->name));
+
+ ?>
</p>
<?php } ?> \ 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) {
?>
- <h2><?php echo elgg_echo('user:set:password'); ?></h2>
+ <h3><?php echo elgg_echo('user:set:password'); ?></h3>
<p>
- <?php echo elgg_echo('user:password:label'); ?> : <input type="password" name="password" value="" />
- <?php echo elgg_echo('user:password2:label'); ?> : <input type="password" name="password2" value="" />
+ <?php echo elgg_echo('user:password:label'); ?>:
+ <?php
+ echo elgg_view('input/password',array('internalname' => 'password'));
+ ?><br />
+ <?php echo elgg_echo('user:password2:label'); ?>: <?php
+ echo elgg_view('input/password',array('internalname' => 'password2'));
+ ?>
</p>
<?php } ?> \ 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 @@
<form action="<?php echo $vars['url']; ?>action/usersettings/save" method="post" >
+
+ <div class="settings_form">
<?php
echo elgg_view("usersettings/user");
?>
+ </div>
<p>
<input type="submit" value="<?php echo elgg_echo('save'); ?>" />
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 "<p>" . autop(elgg_echo("usersettings:statistics:description")) . "</p>";
?> \ 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)
{
?>
-<div>
- <h2><?php echo elgg_echo('usersettings:statistics:label:numentities'); ?></h2>
+<div class="usersettings_statistics">
+ <h3><?php echo elgg_echo('usersettings:statistics:label:numentities'); ?></h3>
<table>
<?php
foreach ($entity_stats as $k => $entry)
{
- echo "<table>";
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
<tr>
- <td><b>$a :</b></td>
- <td>$b</td>
+ <td style="width: 250px"><b>{$a}:</b></td>
+ <td>{$b}</td>
</tr>
END;
}
- echo "</table>";
}
?>
</table>
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;
?>
-<div>
- <h2><?php echo elgg_echo('usersettings:statistics:yourdetails'); ?></h2>
+<div class="usersettings_statistics">
+ <h3><?php echo elgg_echo('usersettings:statistics:yourdetails'); ?></h3>
<table>
- <tr><td><?php echo elgg_echo('usersettings:statistics:label:name'); ?></td><td><?php echo $user->name; ?></td></tr>
- <tr><td><?php echo elgg_echo('usersettings:statistics:label:email'); ?></td><td><?php echo $user->email; ?></td></tr>
- <tr><td><?php echo elgg_echo('usersettings:statistics:label:membersince'); ?></td><td><?php echo date("r",$user->time_created); ?></td></tr>
- <tr><td><?php echo elgg_echo('usersettings:statistics:label:lastlogin'); ?></td><td><?php echo date("r",$logged_in); ?></td></tr>
+ <tr><td style="width: 250px"><?php echo elgg_echo('usersettings:statistics:label:name'); ?></td><td><?php echo $user->name; ?></td></tr>
+ <tr><td style="width: 250px"><?php echo elgg_echo('usersettings:statistics:label:email'); ?></td><td><?php echo $user->email; ?></td></tr>
+ <tr><td style="width: 250px"><?php echo elgg_echo('usersettings:statistics:label:membersince'); ?></td><td><?php echo date("r",$user->time_created); ?></td></tr>
+ <tr><td style="width: 250px"><?php echo elgg_echo('usersettings:statistics:label:lastlogin'); ?></td><td><?php echo date("r",$logged_in); ?></td></tr>
</table>
</div> \ No newline at end of file