From 14e1be56a0927db5344af062a06839f08f674805 Mon Sep 17 00:00:00 2001
From: Bartek Przybylski <bart.p.pl@gmail.com>
Date: Thu, 7 Jun 2012 17:07:51 +0200
Subject: [PATCH] pictures: update script and removal some all stuff

---
 apps/gallery/appinfo/update.php |  9 +++++++++
 apps/gallery/appinfo/version    |  2 +-
 apps/gallery/index.php          | 24 ++----------------------
 3 files changed, 12 insertions(+), 23 deletions(-)
 create mode 100644 apps/gallery/appinfo/update.php

diff --git a/apps/gallery/appinfo/update.php b/apps/gallery/appinfo/update.php
new file mode 100644
index 0000000000..dd248e21b3
--- /dev/null
+++ b/apps/gallery/appinfo/update.php
@@ -0,0 +1,9 @@
+<?php
+
+$stmt = OCP\DB::prepare('DROP TABLE IF EXISTS *PREFIX*gallery_photos');
+$stmt->execute();
+$stmt = OCP\DB::prepare('DROP TABLE IF EXISTS *PREFIX*gallery_albums');
+$stmt->execute();
+
+\OC_DB::createDbFromStructure('./database.xml');
+
diff --git a/apps/gallery/appinfo/version b/apps/gallery/appinfo/version
index 17b2ccd9bf..8f0916f768 100644
--- a/apps/gallery/appinfo/version
+++ b/apps/gallery/appinfo/version
@@ -1 +1 @@
-0.4.3
+0.5.0
diff --git a/apps/gallery/index.php b/apps/gallery/index.php
index a9fe200c4e..9d4654a7cc 100644
--- a/apps/gallery/index.php
+++ b/apps/gallery/index.php
@@ -27,26 +27,6 @@ OCP\User::checkLoggedIn();
 OCP\App::checkAppEnabled('gallery');
 OCP\App::setActiveNavigationEntry( 'gallery_index' );
 
-if (!isset($_GET['view'])) {
-  $result = OC_Gallery_Album::find(OCP\USER::getUser());
-
-  $r = array();
-  while ($row = $result->fetchRow())
-    $r[] = $row;
-
-  $tmpl = new OCP\Template( 'gallery', 'index', 'user' );
-  $tmpl->assign('r', $r);
-  $tmpl->printPage();
-} else {
-  $result = OC_Gallery_Photo::findForAlbum(OCP\USER::getUser(), $_GET['view']);
-
-  $photos = array();
-  while ($p = $result->fetchRow())
-    $photos[] = $p['file_path'];
-  
-  $tmpl = new OCP\Template( 'gallery', 'view_album', 'user' );
-  $tmpl->assign('photos', $photos);
-  $tmpl->assign('albumName', $_GET['view']);
-  $tmpl->printPage();
-}
+$tmpl = new OCP\Template( 'gallery', 'index', 'user' );
+$tmpl->printPage();
 ?>
-- 
GitLab