aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2009-03-28 18:54:18 +0000
committerCash Costello <cash.costello@gmail.com>2009-03-28 18:54:18 +0000
commita4a8fe024a3160509bdf41d095531d5647f98c51 (patch)
treef6abf9231b13ac71bf48d6f8e1820ceb01aa9a44
parent51bdec218af83488cd15a05c8d731e67fdd22264 (diff)
downloadelgg-a4a8fe024a3160509bdf41d095531d5647f98c51.tar.gz
elgg-a4a8fe024a3160509bdf41d095531d5647f98c51.tar.bz2
moved river create new album event to first upload so people don't see the new album in activity before any photos have been uploaded
-rw-r--r--actions/addalbum.php6
-rw-r--r--actions/upload.php10
2 files changed, 12 insertions, 4 deletions
diff --git a/actions/addalbum.php b/actions/addalbum.php
index b9954f1c6..3e7a12e87 100644
--- a/actions/addalbum.php
+++ b/actions/addalbum.php
@@ -52,9 +52,9 @@
$album->tags = $tagarray;
}
- // add to river (check to make sure we're running > Elgg 1.5 first)
- if (function_exists('add_to_river'))
- add_to_river('river/object/album/create', 'create', $album->owner_guid, $album->guid);
+ // we catch the adding images to new albums in the upload action and throw a river new album event
+ $album->new_album = 1;
+
// Success message
system_message(elgg_echo("album:created"));
diff --git a/actions/upload.php b/actions/upload.php
index 896cce8e7..b506cde5b 100644
--- a/actions/upload.php
+++ b/actions/upload.php
@@ -131,11 +131,19 @@
foreach($not_uploaded as $im_name){
$error .= ' [' . $im_name . '] ';
}
- $error .= ' ' . elgg_echo("image:notimage");
+ $error .= ' ' . elgg_echo("image:notimage");
register_error($error);
} //end of upload check
if (count($uploaded_images)>0) {
+ // successful upload so check if this is a new album and throw river event if so
+ $album = get_entity($container_guid);
+ if ($album->new_album == 1) {
+ if (function_exists('add_to_river'))
+ add_to_river('river/object/album/create', 'create', $album->owner_guid, $album->guid);
+ $album->new_album = 0;
+ }
+
forward($CONFIG->wwwroot . 'mod/tidypics/edit_multi.php?files=' . implode('-', $uploaded_images)); //forward to multi-image edit page
} else {
forward(get_input('forward_url', $_SERVER['HTTP_REFERER'])); //upload failed, so forward to previous page