]> source.dussan.org Git - nextcloud-server.git/commitdiff
pictures: update script and removal some all stuff
authorBartek Przybylski <bart.p.pl@gmail.com>
Thu, 7 Jun 2012 15:07:51 +0000 (17:07 +0200)
committerBartek Przybylski <bart.p.pl@gmail.com>
Sun, 10 Jun 2012 11:17:23 +0000 (13:17 +0200)
apps/gallery/appinfo/update.php [new file with mode: 0644]
apps/gallery/appinfo/version
apps/gallery/index.php

diff --git a/apps/gallery/appinfo/update.php b/apps/gallery/appinfo/update.php
new file mode 100644 (file)
index 0000000..dd248e2
--- /dev/null
@@ -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');
+
index 17b2ccd9bf9050efdf57d7800677e87919b9b5b9..8f0916f768f0487bcf8d33827ce2c8dcecb645c1 100644 (file)
@@ -1 +1 @@
-0.4.3
+0.5.0
index e47fb3db5d6726275074d1b9e6dffb2057ea3fd6..9d4654a7cc5f648f146aabd077a10d8daef1f6f8 100644 (file)
@@ -27,30 +27,6 @@ OCP\User::checkLoggedIn();
 OCP\App::checkAppEnabled('gallery');
 OCP\App::setActiveNavigationEntry( 'gallery_index' );
 
-if (!file_exists(OCP\Config::getSystemValue("datadirectory").'/'. OCP\USER::getUser() .'/gallery')) {
-  mkdir(OCP\Config::getSystemValue("datadirectory").'/'. OCP\USER::getUser() .'/gallery');
-}
-
-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();
 ?>