From 83cbd76b2e11b7d832e212ce1ffc77da7a3dd2a6 Mon Sep 17 00:00:00 2001 From: cash Date: Mon, 2 Jan 2012 21:00:16 -0500 Subject: sorting albums added back --- actions/edit.php | 87 ------------------------------------------- actions/photos/album/sort.php | 18 +++++++++ actions/sortalbum.php | 18 --------- 3 files changed, 18 insertions(+), 105 deletions(-) delete mode 100644 actions/edit.php create mode 100644 actions/photos/album/sort.php delete mode 100644 actions/sortalbum.php (limited to 'actions') diff --git a/actions/edit.php b/actions/edit.php deleted file mode 100644 index df65448c8..000000000 --- a/actions/edit.php +++ /dev/null @@ -1,87 +0,0 @@ -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 = elgg_get_entities(array( - "type" => "object", - "subtype" => "image", - "container_guid" => $guid, - "limit" => ELGG_ENTITIES_NO_VALUE, - )); - 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->setCoverImageGuid($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()); diff --git a/actions/photos/album/sort.php b/actions/photos/album/sort.php new file mode 100644 index 000000000..613747784 --- /dev/null +++ b/actions/photos/album/sort.php @@ -0,0 +1,18 @@ +setImageList($guids); + +system_message(elgg_echo('tidypics:album:sorted', array($album->title))); +forward($album->getURL()); \ No newline at end of file diff --git a/actions/sortalbum.php b/actions/sortalbum.php deleted file mode 100644 index 1aa0e052f..000000000 --- a/actions/sortalbum.php +++ /dev/null @@ -1,18 +0,0 @@ -setImageList($guids); - -system_message(sprintf(elgg_echo('tidypics:album:sorted'), $album->title)); -forward($album->getURL()); \ No newline at end of file -- cgit v1.2.3