diff --git a/apps/gallery/ajax/cover.php b/apps/gallery/ajax/cover.php index d83f4daaa52ef0f0fac5f6b58b4aef2e9f33ec0e..181a919375db977f3eb1d20604343648887e44c6 100644 --- a/apps/gallery/ajax/cover.php +++ b/apps/gallery/ajax/cover.php @@ -1,4 +1,26 @@ <?php + +/** +* ownCloud - gallery application +* +* @author Bartek Przybylski +* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +* License as published by the Free Software Foundation; either +* version 3 of the License, or any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU AFFERO GENERAL PUBLIC LICENSE for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library. If not, see <http://www.gnu.org/licenses/>. +* +*/ + require_once('../../../lib/base.php'); OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('gallery'); diff --git a/apps/gallery/ajax/createAlbum.php b/apps/gallery/ajax/createAlbum.php index 9413b54718abf46a9393ce957e6740182bb0b067..152f5834bcb4130d7f0f1db203c13f0aa521bbf0 100644 --- a/apps/gallery/ajax/createAlbum.php +++ b/apps/gallery/ajax/createAlbum.php @@ -1,4 +1,26 @@ <?php + +/** +* ownCloud - gallery application +* +* @author Bartek Przybylski +* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +* License as published by the Free Software Foundation; either +* version 3 of the License, or any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU AFFERO GENERAL PUBLIC LICENSE for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library. If not, see <http://www.gnu.org/licenses/>. +* +*/ + require_once('../../../lib/base.php'); OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('gallery'); diff --git a/apps/gallery/ajax/galleryOp.php b/apps/gallery/ajax/galleryOp.php index 8a006dda63700923886c192d44fc7e6d87292f75..3d1ed1f33cbc26e063be9ddc976e2d9efc144741 100644 --- a/apps/gallery/ajax/galleryOp.php +++ b/apps/gallery/ajax/galleryOp.php @@ -1,4 +1,26 @@ <? + +/** +* ownCloud - gallery application +* +* @author Bartek Przybylski +* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +* License as published by the Free Software Foundation; either +* version 3 of the License, or any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU AFFERO GENERAL PUBLIC LICENSE for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library. If not, see <http://www.gnu.org/licenses/>. +* +*/ + require_once('../../../lib/base.php'); require_once(OC::$CLASSPATH['OC_Gallery_Album']); OC_JSON::checkLoggedIn(); diff --git a/apps/gallery/ajax/getAlbums.php b/apps/gallery/ajax/getAlbums.php index e4736076fed346f5d30c4ea1d661b958f53f7551..9e9c6ef496c7b6a889db143a0ec1443da6d3341b 100644 --- a/apps/gallery/ajax/getAlbums.php +++ b/apps/gallery/ajax/getAlbums.php @@ -1,4 +1,26 @@ <?php + +/** +* ownCloud - gallery application +* +* @author Bartek Przybylski +* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +* License as published by the Free Software Foundation; either +* version 3 of the License, or any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU AFFERO GENERAL PUBLIC LICENSE for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library. If not, see <http://www.gnu.org/licenses/>. +* +*/ + require_once('../../../lib/base.php'); OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('gallery'); diff --git a/apps/gallery/ajax/getCovers.php b/apps/gallery/ajax/getCovers.php index db7c8e9fcdec977aff344fe630741e46a0dc7f8d..4db73d0fbf3594dd510da0566f308f912f719ba3 100644 --- a/apps/gallery/ajax/getCovers.php +++ b/apps/gallery/ajax/getCovers.php @@ -1,4 +1,26 @@ <?php + +/** +* ownCloud - gallery application +* +* @author Bartek Przybylski +* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +* License as published by the Free Software Foundation; either +* version 3 of the License, or any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU AFFERO GENERAL PUBLIC LICENSE for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library. If not, see <http://www.gnu.org/licenses/>. +* +*/ + require_once('../../../lib/base.php'); OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('gallery'); diff --git a/apps/gallery/ajax/scanForAlbums.php b/apps/gallery/ajax/scanForAlbums.php index b1f0a433a42c6906d1352a105df07b8162aca917..b8ed639d9dc20ee5da64b26b73050f428bf25b24 100644 --- a/apps/gallery/ajax/scanForAlbums.php +++ b/apps/gallery/ajax/scanForAlbums.php @@ -1,5 +1,26 @@ <?php +/** +* ownCloud - gallery application +* +* @author Bartek Przybylski +* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +* License as published by the Free Software Foundation; either +* version 3 of the License, or any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU AFFERO GENERAL PUBLIC LICENSE for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library. If not, see <http://www.gnu.org/licenses/>. +* +*/ + require_once('../../../lib/base.php'); OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('gallery'); diff --git a/apps/gallery/ajax/thumbnail.php b/apps/gallery/ajax/thumbnail.php index d937691fa036607b94b8b4a80d2213a5964d872b..6d25c7a2536ad146f352e26b73cd67ea4d39b1ae 100644 --- a/apps/gallery/ajax/thumbnail.php +++ b/apps/gallery/ajax/thumbnail.php @@ -1,4 +1,26 @@ <?php + +/** +* ownCloud - gallery application +* +* @author Bartek Przybylski +* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +* License as published by the Free Software Foundation; either +* version 3 of the License, or any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU AFFERO GENERAL PUBLIC LICENSE for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library. If not, see <http://www.gnu.org/licenses/>. +* +*/ + require_once('../../../lib/base.php'); OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('gallery'); diff --git a/apps/gallery/appinfo/app.php b/apps/gallery/appinfo/app.php index 3a2dbcb43adca1d5e10f7e1739d80715804d5de7..9c665fd3500f34b6ffb3554a01d4a2ece3654cdf 100644 --- a/apps/gallery/appinfo/app.php +++ b/apps/gallery/appinfo/app.php @@ -1,4 +1,26 @@ <?php + +/** +* ownCloud - gallery application +* +* @author Bartek Przybylski +* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +* License as published by the Free Software Foundation; either +* version 3 of the License, or any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU AFFERO GENERAL PUBLIC LICENSE for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library. If not, see <http://www.gnu.org/licenses/>. +* +*/ + OC::$CLASSPATH['OC_Gallery_Album'] = 'apps/gallery/lib/album.php'; OC::$CLASSPATH['OC_Gallery_Photo'] = 'apps/gallery/lib/photo.php'; OC::$CLASSPATH['OC_Gallery_Scanner'] = 'apps/gallery/lib/scanner.php'; diff --git a/apps/gallery/appinfo/info.xml b/apps/gallery/appinfo/info.xml index ba51bf0bd55f63e42d41db384bcd344cd3e9adb5..c275f39bb253c39a5772a2d05057d697427d01bf 100644 --- a/apps/gallery/appinfo/info.xml +++ b/apps/gallery/appinfo/info.xml @@ -6,6 +6,6 @@ <licence>AGPL</licence> <author>Bartek Przybylski</author> <require>2</require> - <description></description> + <description>Gallery application for ownCloud</description> <default_enable/> </info> diff --git a/apps/gallery/index.php b/apps/gallery/index.php index 0cd795bac0137d470dae0bca4d9e4d05e0927801..822a5b8e143ec8d595837dc8b97177287064e612 100644 --- a/apps/gallery/index.php +++ b/apps/gallery/index.php @@ -1,4 +1,26 @@ <?php + +/** +* ownCloud - gallery application +* +* @author Bartek Przybylski +* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +* License as published by the Free Software Foundation; either +* version 3 of the License, or any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU AFFERO GENERAL PUBLIC LICENSE for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library. If not, see <http://www.gnu.org/licenses/>. +* +*/ + require_once('../../lib/base.php'); OC_Util::checkLoggedIn(); diff --git a/apps/gallery/lib/album.php b/apps/gallery/lib/album.php index 98876b891c592b57c3505a60bee0f06495c49960..a94eff3acd7864abf4907883cd6a2b94672e7616 100644 --- a/apps/gallery/lib/album.php +++ b/apps/gallery/lib/album.php @@ -1,5 +1,26 @@ <?php +/** +* ownCloud - gallery application +* +* @author Bartek Przybylski +* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +* License as published by the Free Software Foundation; either +* version 3 of the License, or any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU AFFERO GENERAL PUBLIC LICENSE for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library. If not, see <http://www.gnu.org/licenses/>. +* +*/ + class OC_Gallery_Album { public static function create($owner, $name, $path){ $stmt = OC_DB::prepare('INSERT INTO *PREFIX*gallery_albums (uid_owner, album_name, album_path) VALUES (?, ?, ?)'); diff --git a/apps/gallery/lib/hooks_handlers.php b/apps/gallery/lib/hooks_handlers.php index 1bddaf363e3531061094db02182486f5784c573d..b6aa8a400cf0a228e0c342d665edd547d452845b 100644 --- a/apps/gallery/lib/hooks_handlers.php +++ b/apps/gallery/lib/hooks_handlers.php @@ -1,5 +1,26 @@ <?php +/** +* ownCloud - gallery application +* +* @author Bartek Przybylski +* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +* License as published by the Free Software Foundation; either +* version 3 of the License, or any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU AFFERO GENERAL PUBLIC LICENSE for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library. If not, see <http://www.gnu.org/licenses/>. +* +*/ + OC_Hook::connect("OC_Filesystem", "post_write", "OC_Gallery_Hooks_Handlers", "addPhotoFromPath"); OC_Hook::connect("OC_Filesystem", "delete", "OC_Gallery_Hooks_Handlers", "removePhoto"); OC_Hook::connect("OC_Filesystem", "post_rename", "OC_Gallery_Hooks_Handlers", "renamePhoto"); @@ -18,7 +39,8 @@ class OC_Gallery_Hooks_Handlers { private static function createAlbum($path) { $new_album_name = trim(str_replace('/', '.', $path), '.'); - if ($new_album_name == '') $new_album_name = 'main'; + if ($new_album_name == '') + $new_album_name = 'main'; OC_Log::write(self::$APP_TAG, 'Creating new album '.$new_album_name, OC_Log::DEBUG); OC_Gallery_Album::create(OC_User::getUser(), $new_album_name, $path); @@ -53,8 +75,8 @@ class OC_Gallery_Hooks_Handlers { } public static function renamePhoto($params) { - $olddir = substr($params['oldpath'], 0, strrpos($params['oldpath'], '/')); - $newdir = substr($params['newpath'], 0, strrpos($params['newpath'], '/')); + $olddir = substr($params['oldpath'], 0, strrpos($params['oldpath'], '/')+1); + $newdir = substr($params['newpath'], 0, strrpos($params['newpath'], '/')+1); if (!self::isPhoto($params['newpath'])) return; $album; $newAlbumId; diff --git a/apps/gallery/lib/images_utils.php b/apps/gallery/lib/images_utils.php index cb46bf3f16093bbf66487502079561cacf5e5f56..0cfa52eb56431f8510d637882c0c93cda8c77e74 100644 --- a/apps/gallery/lib/images_utils.php +++ b/apps/gallery/lib/images_utils.php @@ -1,4 +1,26 @@ <?php + +/** +* ownCloud - gallery application +* +* @author Bartek Przybylski +* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +* License as published by the Free Software Foundation; either +* version 3 of the License, or any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU AFFERO GENERAL PUBLIC LICENSE for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library. If not, see <http://www.gnu.org/licenses/>. +* +*/ + require_once('../../../lib/base.php'); OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('gallery'); diff --git a/apps/gallery/lib/photo.php b/apps/gallery/lib/photo.php index f8a640819a1fe15340fc731aabb6fd862a65d611..23887098e0fe87c5d2b27dc43cf933634550c0d8 100644 --- a/apps/gallery/lib/photo.php +++ b/apps/gallery/lib/photo.php @@ -1,5 +1,26 @@ <?php +/** +* ownCloud - gallery application +* +* @author Bartek Przybylski +* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +* License as published by the Free Software Foundation; either +* version 3 of the License, or any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU AFFERO GENERAL PUBLIC LICENSE for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library. If not, see <http://www.gnu.org/licenses/>. +* +*/ + class OC_Gallery_Photo{ public static function create($albumId, $img){ $stmt = OC_DB::prepare('INSERT INTO *PREFIX*gallery_photos (album_id, file_path) VALUES (?, ?)'); diff --git a/apps/gallery/lib/scanner.php b/apps/gallery/lib/scanner.php index f754f913001ccd06bc1de010f0bfd591596fcb3c..3eba9260ac7ff30f294fc6d1ee285a4159163901 100644 --- a/apps/gallery/lib/scanner.php +++ b/apps/gallery/lib/scanner.php @@ -1,5 +1,26 @@ <?php +/** +* ownCloud - gallery application +* +* @author Bartek Przybylski +* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +* License as published by the Free Software Foundation; either +* version 3 of the License, or any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU AFFERO GENERAL PUBLIC LICENSE for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library. If not, see <http://www.gnu.org/licenses/>. +* +*/ + require_once('base.php'); // base lib require_once('images_utils.php');