recursive gallery removing on parent dir remove

This commit is contained in:
Bartek Przybylski 2012-01-15 11:51:01 +01:00
parent 9c04858631
commit 5ecc10b756
1 changed files with 8 additions and 0 deletions

View File

@ -48,6 +48,14 @@ class OC_Gallery_Album {
$album = $album->fetchRow();
self::remove($owner, $album['album_name']);
OC_Gallery_Photo::removeByAlbumId($album['album_id']);
// find and remove any gallery which might be stored lower in dir hierarchy
$path = $path.'/%';
$stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE album_path LIKE ? AND uid_owner = ?');
$result = $stmt->execute(array($path, $owner));
while (($album = $result->fetchRow())) {
OC_Gallery_Photo::removeByAlbumId($album['album_id']);
self::remove($owner, $album['album_name']);
}
}
public static function find($owner, $name=null, $path=null){