aboutsummaryrefslogtreecommitdiff
path: root/actions/edit_multi.php
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2009-12-12 19:51:49 +0000
committerCash Costello <cash.costello@gmail.com>2009-12-12 19:51:49 +0000
commit621177abc2bc60e9edb3ca723a4afaa9d9e713ef (patch)
treed6064f1fe767d042ea41e4adea88e57b8e5138ff /actions/edit_multi.php
parentb40060fafaba46e2fb8800b2c2e557a8c6bde9db (diff)
downloadelgg-621177abc2bc60e9edb3ca723a4afaa9d9e713ef.tar.gz
elgg-621177abc2bc60e9edb3ca723a4afaa9d9e713ef.tar.bz2
convert line endings to Unix
Diffstat (limited to 'actions/edit_multi.php')
-rw-r--r--actions/edit_multi.php130
1 files changed, 65 insertions, 65 deletions
diff --git a/actions/edit_multi.php b/actions/edit_multi.php
index 92252b6dd..c7099e6db 100644
--- a/actions/edit_multi.php
+++ b/actions/edit_multi.php
@@ -1,66 +1,66 @@
-<?php
- /**
- * Elgg album: multi image edit action
- *
- * This is called when uploading images
- */
-
- // Make sure we're logged in
- gatekeeper();
-
- // Get input data
- $title_array = get_input('title');
- $caption_array = get_input('caption');
- $tags_array = get_input('tags');
- $image_guid_array = get_input('image_guid');
- $container_guid = get_input('container_guid');
- $album_entity = get_entity($container_guid);
- $cover = get_input('cover');
- $not_updated = array();
-
- foreach($image_guid_array as $key => $im) {
- $image = get_entity($im);
-
- if ($image->canEdit()) {
-
- // Convert string of tags into a preformatted array
- $tagarray = string_to_tag_array($tags_array[$key]);
-
- //set title appropriately
- if ($title_array[$key])
- $image->title = $title_array[$key];
- else
- $image->title = substr($image->originalfilename, 0, strrpos($image->originalfilename, '.'));
-
- //set description appropriately
- $image->description = $caption_array[$key];
-
- // Before we can set metadata, we need to save the image
- if (!$image->save()) {
- array_push($not_updated, $image->guid);
- }
-
- // Now let's add tags. We can pass an array directly to the object property! Easy.
- $image->clearMetadata('tags');
- if (is_array($tagarray)) {
- $image->tags = $tagarray;
- }
-
- //if cover meta is sent from image save as metadata
- if ($cover == $im) {
- $album_entity->cover = $im;
- }
- }
- }
-
- // Success message
- if (count($not_updated) > 0) {
- register_error(elgg_echo("images:notedited"));
- } else {
- system_message(elgg_echo("images:edited"));
- }
-
- // Forward to the main album page
- forward($album_entity->getURL());
-
+<?php
+ /**
+ * Elgg album: multi image edit action
+ *
+ * This is called when uploading images
+ */
+
+ // Make sure we're logged in
+ gatekeeper();
+
+ // Get input data
+ $title_array = get_input('title');
+ $caption_array = get_input('caption');
+ $tags_array = get_input('tags');
+ $image_guid_array = get_input('image_guid');
+ $container_guid = get_input('container_guid');
+ $album_entity = get_entity($container_guid);
+ $cover = get_input('cover');
+ $not_updated = array();
+
+ foreach($image_guid_array as $key => $im) {
+ $image = get_entity($im);
+
+ if ($image->canEdit()) {
+
+ // Convert string of tags into a preformatted array
+ $tagarray = string_to_tag_array($tags_array[$key]);
+
+ //set title appropriately
+ if ($title_array[$key])
+ $image->title = $title_array[$key];
+ else
+ $image->title = substr($image->originalfilename, 0, strrpos($image->originalfilename, '.'));
+
+ //set description appropriately
+ $image->description = $caption_array[$key];
+
+ // Before we can set metadata, we need to save the image
+ if (!$image->save()) {
+ array_push($not_updated, $image->guid);
+ }
+
+ // Now let's add tags. We can pass an array directly to the object property! Easy.
+ $image->clearMetadata('tags');
+ if (is_array($tagarray)) {
+ $image->tags = $tagarray;
+ }
+
+ //if cover meta is sent from image save as metadata
+ if ($cover == $im) {
+ $album_entity->cover = $im;
+ }
+ }
+ }
+
+ // Success message
+ if (count($not_updated) > 0) {
+ register_error(elgg_echo("images:notedited"));
+ } else {
+ system_message(elgg_echo("images:edited"));
+ }
+
+ // Forward to the main album page
+ forward($album_entity->getURL());
+
?> \ No newline at end of file