/** * Delete Album * * @param integer $guid Album Guid * * @return boolean */ public function deleteAlbum($guid) { if (!empty($guid)) { $album = $this->GetAlbum($guid); if ($album->album->owner_guid == ossn_loggedin_user()->guid || ossn_isAdminLoggedin()) { $photos = new OssnPhotos(); foreach ($album->photos as $photo) { $photos->photoid = $photo->guid; $photos->deleteAlbumPhoto(); } if ($album->album->deleteObject()) { return true; } } } return false; }