aboutsummaryrefslogtreecommitdiff
path: root/mod/profile/actions/edit.php
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-28 10:36:35 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-28 10:36:35 +0000
commit8fbbdf8785a9640e20bd4b4c59a02fbb3cac8337 (patch)
tree0526f6550687817afc37d6372a122ab37e994abb /mod/profile/actions/edit.php
parent37d233139be3e345fc1d33f752c7c9c8cd4f6ff1 (diff)
downloadelgg-8fbbdf8785a9640e20bd4b4c59a02fbb3cac8337.tar.gz
elgg-8fbbdf8785a9640e20bd4b4c59a02fbb3cac8337.tar.bz2
The profile now has fields set in start.php. TODO: make those user editable, once we have the admin panel ...
git-svn-id: https://code.elgg.org/elgg/trunk@543 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/profile/actions/edit.php')
-rw-r--r--mod/profile/actions/edit.php22
1 files changed, 14 insertions, 8 deletions
diff --git a/mod/profile/actions/edit.php b/mod/profile/actions/edit.php
index 4bcecdb56..7ace0a22b 100644
--- a/mod/profile/actions/edit.php
+++ b/mod/profile/actions/edit.php
@@ -10,22 +10,28 @@
* @link http://elgg.com/
*/
+ // Load configuration
+ global $CONFIG;
+
// Get profile fields
- $aboutme = get_input('aboutme');
- $location = string_to_tag_array(get_input('location'));
- $skills = string_to_tag_array(get_input('skills'));
- $interests = string_to_tag_array(get_input('interests'));
+ $input = array();
+ foreach($CONFIG->profile as $shortname => $valuetype) {
+ $input[$shortname] = get_input($shortname);
+ if ($valuetype == 'tags')
+ $input[$shortname] = string_to_tag_array($input[$shortname]);
+ }
// Save stuff if we can, and forward to the user's profile
$user = $_SESSION['user'];
if ($user->canEdit()) {
// Save stuff
- $user->description = $aboutme;
+ if (sizeof($input) > 0)
+ foreach($input as $shortname => $value) {
+ $user->$shortname = $value;
+ }
$user->save();
- $user->location = $location;
- $user->skills = $skills;
- $user->interests = $interests;
+
system_message(elgg_echo("profile:saved"));
// Forward to the user's profile