From 4e0c1576475390faa2f1fb4c4dc2902a953f440e Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Wed, 25 Feb 2009 12:16:53 +0000 Subject: First commit --- actions/edit_multi.php | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 actions/edit_multi.php (limited to 'actions/edit_multi.php') diff --git a/actions/edit_multi.php b/actions/edit_multi.php new file mode 100644 index 000000000..9bb9c4eed --- /dev/null +++ b/actions/edit_multi.php @@ -0,0 +1,62 @@ + $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 description appropriately + $image->title = $title_array[$key]; + + //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 -- cgit v1.2.3