From c51b483f24936c8d04a54a6999412937ec21c49a Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 19 Nov 2011 23:13:26 -0500 Subject: uploading photos through the basic interface works now --- actions/photos/batch/edit.php | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 actions/photos/batch/edit.php (limited to 'actions/photos/batch') diff --git a/actions/photos/batch/edit.php b/actions/photos/batch/edit.php new file mode 100644 index 000000000..6d376a9db --- /dev/null +++ b/actions/photos/batch/edit.php @@ -0,0 +1,42 @@ + $guid) { + $image = get_entity($guid); + + if ($image->canEdit()) { + + // set title appropriately + if ($titles[$key]) { + $image->title = $titles[$key]; + } else { + $image->title = substr($image->originalfilename, 0, strrpos($image->originalfilename, '.')); + } + + // set description appropriately + $image->description = $captions[$key]; + $image->tags = string_to_tag_array($tags[$key]); + + if (!$image->save()) { + array_push($not_updated, $image->getGUID()); + } + } +} + +if (count($not_updated) > 0) { + register_error(elgg_echo("images:notedited")); +} else { + system_message(elgg_echo("images:edited")); +} +forward($image->getContainerEntity()->getURL()); -- cgit v1.2.3