aboutsummaryrefslogtreecommitdiff
path: root/actions/ajax_upload_complete.php
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2010-10-30 14:49:14 +0000
committerCash Costello <cash.costello@gmail.com>2010-10-30 14:49:14 +0000
commit94e82c781a9bc5a171193523cac50ea83e69dcfd (patch)
tree97413da12890bd9f89229a7a2bb3e0ae9cf3e7da /actions/ajax_upload_complete.php
parent621e0a079c4f9410356c49a39bdd68c098e3bc96 (diff)
downloadelgg-94e82c781a9bc5a171193523cac50ea83e69dcfd.tar.gz
elgg-94e82c781a9bc5a171193523cac50ea83e69dcfd.tar.bz2
handling new album in ajax upload code now
Diffstat (limited to 'actions/ajax_upload_complete.php')
-rw-r--r--actions/ajax_upload_complete.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/actions/ajax_upload_complete.php b/actions/ajax_upload_complete.php
new file mode 100644
index 000000000..4fc96061e
--- /dev/null
+++ b/actions/ajax_upload_complete.php
@@ -0,0 +1,24 @@
+<?php
+/**
+ * A batch is complete so check if this is first upload to album
+ *
+ */
+
+$album_guid = (int) get_input('album_guid');
+
+$album = get_entity($album_guid);
+if (!$album) {
+ exit;
+}
+
+if ($album->new_album == TP_NEW_ALBUM) {
+ $album->new_album = TP_OLD_ALBUM;
+
+ // 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);
+
+ add_to_river('river/object/album/create', 'create', $album->owner_guid, $album->guid);
+}
+
+exit; \ No newline at end of file