aboutsummaryrefslogtreecommitdiff
path: root/lib/album.php
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2010-10-23 12:53:41 +0000
committerCash Costello <cash.costello@gmail.com>2010-10-23 12:53:41 +0000
commitcee2276dc0bd37f7981e885f9dd32cd0e113c1cc (patch)
tree011d6c966680d2c7b03f03f3d2e90f6ea12eb555 /lib/album.php
parente8fafaca927a17a6badad86e9a0c6ad4c911b8f1 (diff)
downloadelgg-cee2276dc0bd37f7981e885f9dd32cd0e113c1cc.tar.gz
elgg-cee2276dc0bd37f7981e885f9dd32cd0e113c1cc.tar.bz2
updating album image list when a photo is deleted
Diffstat (limited to 'lib/album.php')
-rw-r--r--lib/album.php19
1 files changed, 19 insertions, 0 deletions
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;
+ }
}