aboutsummaryrefslogtreecommitdiff
path: root/actions/ajax_upload_complete.php
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2012-07-13 22:50:23 -0400
committerCash Costello <cash.costello@gmail.com>2012-07-13 22:50:23 -0400
commit01730a85bced88f32d88efac995ea12294934a63 (patch)
tree62b71d96d02fce3a75393da08219714fdad4789d /actions/ajax_upload_complete.php
parent919ae814fa2b651072b5bbb901e2183220a0dd30 (diff)
parent5cc8de829c0a7b86c8df27293f4825d0e340d592 (diff)
downloadelgg-01730a85bced88f32d88efac995ea12294934a63.tar.gz
elgg-01730a85bced88f32d88efac995ea12294934a63.tar.bz2
flash uploader working
Diffstat (limited to 'actions/ajax_upload_complete.php')
-rw-r--r--actions/ajax_upload_complete.php56
1 files changed, 0 insertions, 56 deletions
diff --git a/actions/ajax_upload_complete.php b/actions/ajax_upload_complete.php
deleted file mode 100644
index 2abca50dc..000000000
--- a/actions/ajax_upload_complete.php
+++ /dev/null
@@ -1,56 +0,0 @@
-<?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) {
- $new_album = true;
-} else {
- $new_album = false;
-}
-
-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);
-}
-
-$params = array(
- 'type' => 'object',
- 'subtype' => 'image',
- 'metadata_names' => 'batch',
- 'metadata_values' => get_input('batch'),
-);
-$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());
- }
- if (get_plugin_setting('img_river_view', 'tidypics') == "batch" && $new_album == false) {
- add_to_river('river/object/tidypics_batch/create', 'create', $batch->getObjectOwnerGUID(), $batch->getGUID());
- }
- }
-}
-
-// plugins can register to be told when a Tidypics album has had images added
-trigger_elgg_event('upload', 'tp_album', $album);
-
-exit; \ No newline at end of file