From 621177abc2bc60e9edb3ca723a4afaa9d9e713ef Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 12 Dec 2009 19:51:49 +0000 Subject: convert line endings to Unix --- actions/edit.php | 162 +++++++++++++++++++++++++++---------------------------- 1 file changed, 81 insertions(+), 81 deletions(-) (limited to 'actions/edit.php') diff --git a/actions/edit.php b/actions/edit.php index 91c465828..cdf9420b2 100644 --- a/actions/edit.php +++ b/actions/edit.php @@ -1,81 +1,81 @@ -canEdit()) { - forward(); - } - - // Get owning user/group - $owner = get_entity($entity->getOwner()); - - // change access only if access is different from current - if ($subtype == 'album' && $entity->access_id != $access) { - $entity->access_id = $access; - - //get images from album and update access on image entities - $images = get_entities("object","image", $guid, '', 999, '', false); - foreach ($images as $im) { - $im->access_id = $access; - $im->save(); - } - } - - - // Set its title and description appropriately - $entity->title = $title; - $entity->description = $body; - - // Before we can set metadata, we need to save the entity - if (!$entity->save()) { - register_error(elgg_echo("album:error")); - $entity->delete(); - forward($_SERVER['HTTP_REFERER']); //failed, so forward to previous page - } - - // Now let's add tags - $tagarray = string_to_tag_array($tags); - $entity->clearMetadata('tags'); - if (is_array($tagarray)) { - $entity->tags = $tagarray; - } - - //if cover meta is sent from image save as metadata - if ($subtype == 'image' && $cover == elgg_echo('album:cover')) { - $album = get_entity($container_guid); - $album->cover = $entity->guid; - } - - // Success message - if ($subtype == 'album') { - system_message(elgg_echo("album:edited")); - // plugins can register to be told when a Tidypics album has been updated - trigger_elgg_event('update', 'tp_album', $entity); - } else { - system_message(elgg_echo('images:edited')); - // plugins can register to be told when a Tidypics image has been updated - trigger_elgg_event('update', 'tp_image', $entity); - } - - forward($entity->getURL()); -?> +canEdit()) { + forward(); + } + + // Get owning user/group + $owner = get_entity($entity->getOwner()); + + // change access only if access is different from current + if ($subtype == 'album' && $entity->access_id != $access) { + $entity->access_id = $access; + + //get images from album and update access on image entities + $images = get_entities("object","image", $guid, '', 999, '', false); + foreach ($images as $im) { + $im->access_id = $access; + $im->save(); + } + } + + + // Set its title and description appropriately + $entity->title = $title; + $entity->description = $body; + + // Before we can set metadata, we need to save the entity + if (!$entity->save()) { + register_error(elgg_echo("album:error")); + $entity->delete(); + forward($_SERVER['HTTP_REFERER']); //failed, so forward to previous page + } + + // Now let's add tags + $tagarray = string_to_tag_array($tags); + $entity->clearMetadata('tags'); + if (is_array($tagarray)) { + $entity->tags = $tagarray; + } + + //if cover meta is sent from image save as metadata + if ($subtype == 'image' && $cover == elgg_echo('album:cover')) { + $album = get_entity($container_guid); + $album->cover = $entity->guid; + } + + // Success message + if ($subtype == 'album') { + system_message(elgg_echo("album:edited")); + // plugins can register to be told when a Tidypics album has been updated + trigger_elgg_event('update', 'tp_album', $entity); + } else { + system_message(elgg_echo('images:edited')); + // plugins can register to be told when a Tidypics image has been updated + trigger_elgg_event('update', 'tp_image', $entity); + } + + forward($entity->getURL()); +?> -- cgit v1.2.3