From cee2276dc0bd37f7981e885f9dd32cd0e113c1cc Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 23 Oct 2010 12:53:41 +0000 Subject: updating album image list when a photo is deleted --- lib/album.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'lib/album.php') diff --git a/lib/album.php b/lib/album.php index 87bb715f4..15450049a 100644 --- a/lib/album.php +++ b/lib/album.php @@ -138,4 +138,23 @@ class TidypicsAlbum extends ElggObject { } return $imageList[$key]; } + + /** + * Remove an image from the album list + * + * @param int $imageGuid + * @return bool + */ + public function removeImage($imageGuid) { + $imageList = $this->getImageList(); + $key = array_search($imageGuid, $imageList); + if ($key === FALSE) { + return FALSE; + } + + unset($imageList[$key]); + $this->setImageList($imageList); + + return TRUE; + } } -- cgit v1.2.3