diff options
author | Bart Visscher <bartv@thisnet.nl> | 2011-12-08 20:04:56 +0100 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2011-12-08 20:05:12 +0100 |
commit | eeaf539a4414e3081b6f6652167363a3221a1973 (patch) | |
tree | 0616110c205df731c542ea600db369d842a99f9c /apps/gallery/index.php | |
parent | d4546cdf37bced97d447b5170202cbd61c39d3be (diff) | |
download | nextcloud-server-eeaf539a4414e3081b6f6652167363a3221a1973.tar.gz nextcloud-server-eeaf539a4414e3081b6f6652167363a3221a1973.zip |
Gallery: splitout model code
Diffstat (limited to 'apps/gallery/index.php')
-rw-r--r-- | apps/gallery/index.php | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/apps/gallery/index.php b/apps/gallery/index.php index 87fdafcf13c..2c409089ebe 100644 --- a/apps/gallery/index.php +++ b/apps/gallery/index.php @@ -7,8 +7,7 @@ OC_App::setActiveNavigationEntry( 'gallery_index' ); if (!isset($_GET['view'])) { - $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE uid_owner = ?'); - $result = $stmt->execute(array(OC_User::getUser())); + $result = OC_Gallery_Album::find(OC_User::getUser()); $r = array(); while ($row = $result->fetchRow()) @@ -18,9 +17,7 @@ if (!isset($_GET['view'])) { $tmpl->assign('r', $r); $tmpl->printPage(); } else { - $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_photos, *PREFIX*gallery_albums WHERE uid_owner = ? AND album_name = ? AND *PREFIX*gallery_albums.album_id = *PREFIX*gallery_photos.album_id'); - - $result = $stmt->execute(array(OC_User::getUser(), $_GET['view'])); + $result = OC_Gallery_Photo::findForAlbum(OC_User::getUser(), $_GET['view']); $photos = array(); while ($p = $result->fetchRow()) |