diff options
author | Sem <sembrestels@riseup.net> | 2012-07-29 04:13:33 +0200 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2012-07-29 04:13:33 +0200 |
commit | 7a9177c9df49d6fc02280df02d6e7f6d52531382 (patch) | |
tree | 518ecb9df491374faa1062fee2d32dca61ba74a3 /actions/photos/image/ajax_upload_complete.php | |
parent | f9e9c6cb5950ccf1d1d5396caa9dbb2803aacdad (diff) | |
parent | 24ff6662195222479b4d83d41fa89edc8a3c05d1 (diff) | |
download | elgg-7a9177c9df49d6fc02280df02d6e7f6d52531382.tar.gz elgg-7a9177c9df49d6fc02280df02d6e7f6d52531382.tar.bz2 |
Merge branch 'no-flash-uploader' of git://github.com/sembrestels/Tidypics
Diffstat (limited to 'actions/photos/image/ajax_upload_complete.php')
-rw-r--r-- | actions/photos/image/ajax_upload_complete.php | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/actions/photos/image/ajax_upload_complete.php b/actions/photos/image/ajax_upload_complete.php deleted file mode 100644 index 358a4fc6f..000000000 --- a/actions/photos/image/ajax_upload_complete.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php -/** - * A batch is complete so check if this is first upload to album - * - */ - -$batch = get_input('batch'); -$album_guid = (int) get_input('album_guid'); -$img_river_view = elgg_get_plugin_setting('img_river_view', 'tidypics'); - -$album = get_entity($album_guid); -if (!elgg_instanceof($album, 'object', 'album')) { - exit; -} - -$params = array( - 'type' => 'object', - 'subtype' => 'image', - 'metadata_names' => 'batch', - 'metadata_values' => $batch, - 'limit' => 0 -); - -$images = elgg_get_entities_from_metadata($params); -if ($images) { - // Create a new batch object to contain these photos - $batch = new ElggObject(); - $batch->subtype = "tidypics_batch"; - $batch->access_id = ACCESS_PUBLIC; - $batch->container_guid = $album->guid; - - if ($batch->save()) { - foreach ($images as $image) { - add_entity_relationship($image->guid, "belongs_to_batch", $batch->getGUID()); - } - } -} else { - // @todo some sort of message to edit them manually. - exit; -} - -// "added images to album" river -if ($img_river_view == "batch" && $album->new_album == false) { - add_to_river('river/object/tidypics_batch/create', 'create', $batch->getOwnerGUID(), $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()); - - // "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(); - } -} - -echo json_encode(array('batch_guid' => $batch->getGUID())); -exit;
\ No newline at end of file |