From 0ad7f6660c247e1eead0e651f4da73db762e2d2a Mon Sep 17 00:00:00 2001 From: marcus Date: Wed, 16 Jul 2008 09:10:34 +0000 Subject: Closes #152 and as a bonus you get a river notification for icon upload as well. Aren't I nice? git-svn-id: https://code.elgg.org/elgg/trunk@1433 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/profile/actions/edit.php | 6 +++++- mod/profile/actions/iconupload.php | 4 +++- mod/profile/languages/en.php | 3 ++- .../views/default/river/ElggUser/profileiconupdate.php | 12 ++++++++++++ mod/profile/views/default/river/ElggUser/profileupdate.php | 12 ++++++++++++ mod/profile/views/default/river/ElggUser/update.php | 12 ------------ 6 files changed, 34 insertions(+), 15 deletions(-) create mode 100644 mod/profile/views/default/river/ElggUser/profileiconupdate.php create mode 100644 mod/profile/views/default/river/ElggUser/profileupdate.php delete mode 100644 mod/profile/views/default/river/ElggUser/update.php (limited to 'mod/profile') diff --git a/mod/profile/actions/edit.php b/mod/profile/actions/edit.php index 7a74535cd..fad257cf5 100644 --- a/mod/profile/actions/edit.php +++ b/mod/profile/actions/edit.php @@ -37,7 +37,11 @@ $user->$shortname = $value; } $user->save(); - + + // Notify of profile update + trigger_elgg_event('profileupdate',$user->type,$user); + + system_message(elgg_echo("profile:saved")); // Forward to the user's profile diff --git a/mod/profile/actions/iconupload.php b/mod/profile/actions/iconupload.php index 967e58d70..e4185809a 100644 --- a/mod/profile/actions/iconupload.php +++ b/mod/profile/actions/iconupload.php @@ -56,7 +56,9 @@ $_SESSION['user']->icontime = time(); - system_message(elgg_echo("profile:icon:uploaded")); + system_message(elgg_echo("profile:icon:uploaded")); + + trigger_elgg_event('profileiconupdate',$_SESSION['user']->type,$_SESSION['user']); } else { system_message(elgg_echo("profile:icon:notfound")); diff --git a/mod/profile/languages/en.php b/mod/profile/languages/en.php index be70f4243..2cec031a0 100644 --- a/mod/profile/languages/en.php +++ b/mod/profile/languages/en.php @@ -43,7 +43,8 @@ 'profile:mobile' => "Mobile phone", 'profile:website' => "Website", - 'profile:river:update' => "%s updated their profile", + 'profile:river:update' => "%s updated their profile", + 'profile:river:iconupdate' => "%s updated their profile icon", /** * Status messages diff --git a/mod/profile/views/default/river/ElggUser/profileiconupdate.php b/mod/profile/views/default/river/ElggUser/profileiconupdate.php new file mode 100644 index 000000000..ce511c40c --- /dev/null +++ b/mod/profile/views/default/river/ElggUser/profileiconupdate.php @@ -0,0 +1,12 @@ +getSubject(); + + $url = "getURL()}\">{$performed_by->name}"; + $string = sprintf(elgg_echo("profile:river:iconupdate"),$url); + +?> + + \ No newline at end of file diff --git a/mod/profile/views/default/river/ElggUser/profileupdate.php b/mod/profile/views/default/river/ElggUser/profileupdate.php new file mode 100644 index 000000000..36f775991 --- /dev/null +++ b/mod/profile/views/default/river/ElggUser/profileupdate.php @@ -0,0 +1,12 @@ +getSubject(); + + $url = "getURL()}\">{$performed_by->name}"; + $string = sprintf(elgg_echo("profile:river:update"),$url); + +?> + + \ No newline at end of file diff --git a/mod/profile/views/default/river/ElggUser/update.php b/mod/profile/views/default/river/ElggUser/update.php deleted file mode 100644 index 36f775991..000000000 --- a/mod/profile/views/default/river/ElggUser/update.php +++ /dev/null @@ -1,12 +0,0 @@ -getSubject(); - - $url = "getURL()}\">{$performed_by->name}"; - $string = sprintf(elgg_echo("profile:river:update"),$url); - -?> - - \ No newline at end of file -- cgit v1.2.3