diff options
author | Brett Profitt <brett.profitt@gmail.com> | 2012-02-13 15:39:45 -0800 |
---|---|---|
committer | Brett Profitt <brett.profitt@gmail.com> | 2012-02-13 15:40:52 -0800 |
commit | 894ea6758f3f99c49807df99ef4bbd95f74273dc (patch) | |
tree | 90f4166d6cd605eb4d7e95d63682732a1c5476a5 /actions | |
parent | 67d855d73499f36f15331e1ff18cccd13aa8aa74 (diff) | |
download | elgg-894ea6758f3f99c49807df99ef4bbd95f74273dc.tar.gz elgg-894ea6758f3f99c49807df99ef4bbd95f74273dc.tar.bz2 |
Fixes #11. Added notifications back.
Diffstat (limited to 'actions')
-rw-r--r-- | actions/photos/image/upload.php | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/actions/photos/image/upload.php b/actions/photos/image/upload.php index 3a1970367..29df59b63 100644 --- a/actions/photos/image/upload.php +++ b/actions/photos/image/upload.php @@ -7,7 +7,6 @@ */ elgg_load_library('tidypics:upload'); - $img_river_view = elgg_get_plugin_setting('img_river_view', 'tidypics'); $guid = (int) get_input('guid'); @@ -86,17 +85,35 @@ if (count($uploaded_images)) { $album->prependImageList($uploaded_images); + // "added images to album" river if ($img_river_view == "batch" && $album->new_album == false) { add_to_river('river/object/tidypics_batch/create', 'create', $batch->getObjectOwnerGUID(), $batch->getGUID()); } + // "created album" river if ($album->new_album) { $album->new_album = false; + $album->first_upload = true; + add_to_river('river/object/album/create', 'create', $album->getOwnerGUID(), $album->getGUID()); - // we throw the notification manually here so users are not told about the new album until there - // is at least a few photos in it - object_notifications('create', 'object', $album); + // "created album" notifications + // we throw the notification manually here so users are not told about the new album until + // there are at least a few photos in it + if ($album->shouldNotify()) { + object_notifications('create', 'object', $album); + $album->last_notified = time(); + } + } else { + // "added image to album" notifications + if ($album->first_upload) { + $album->first_upload = false; + } + + if ($album->shouldNotify()) { + object_notifications('create', 'object', $album); + $album->last_notified = time(); + } } } |