From f28d71bb9c1142dd979f5837fb15d914b2d4e4d6 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Mon, 7 May 2012 16:46:35 +0200 Subject: [PATCH] fix gallery sharing --- apps/gallery/appinfo/app.php | 1 + apps/gallery/js/album_cover.js | 2 +- apps/gallery/js/sharing.js | 12 ++++++------ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/apps/gallery/appinfo/app.php b/apps/gallery/appinfo/app.php index 2501ae7bbd5..333b1581ce1 100755 --- a/apps/gallery/appinfo/app.php +++ b/apps/gallery/appinfo/app.php @@ -56,4 +56,5 @@ class OC_GallerySearchProvider extends OC_Search_Provider{ OC_Search::registerProvider('OC_GallerySearchProvider'); require_once('apps/gallery/lib/hooks_handlers.php'); +OCP\CONFIG::setAppValue('core', 'public_gallery', '/apps/gallery/sharing.php'); ?> diff --git a/apps/gallery/js/album_cover.js b/apps/gallery/js/album_cover.js index d44e7f83d1f..61084c99b29 100644 --- a/apps/gallery/js/album_cover.js +++ b/apps/gallery/js/album_cover.js @@ -31,7 +31,7 @@ function albumClick(title) { } function constructSharingPath() { - return document.location.protocol + '//' + document.location.host + OC.linkTo('gallery', 'sharing.php') + '?token=' + Albums.token; + return document.location.protocol + '//' + document.location.host + OC.linkTo('', 'public.php') + '?service=gallery&token=' + Albums.token; } function shareGallery() { diff --git a/apps/gallery/js/sharing.js b/apps/gallery/js/sharing.js index 340d1b9b274..679e39578aa 100644 --- a/apps/gallery/js/sharing.js +++ b/apps/gallery/js/sharing.js @@ -1,5 +1,5 @@ $(document).ready(function() { - $.getJSON('ajax/sharing.php', {operation: 'get_gallery', token: TOKEN}, albumClickHandler); + $.getJSON(OC.filePath('gallery', 'ajax', 'sharing.php'), {operation: 'get_gallery', token: TOKEN}, albumClickHandler); }); var paths = []; @@ -13,7 +13,7 @@ function returnTo(num) { } path = ''; for (var e in paths) path += '/' + paths[e]; - $.getJSON('ajax/sharing.php', {operation: 'get_gallery', token: TOKEN, path: path}, function(r) { + $.getJSON(OC.filePath('gallery', 'ajax', 'sharing.php'), {operation: 'get_gallery', token: TOKEN, path: path}, function(r) { albumClickHandler(r); }); } @@ -21,7 +21,7 @@ function returnTo(num) { function albumClickHandler(r) { var element = $('div#gallery_list'); element.html(''); - var album_template = ''; + var album_template = ''; for (var i in r.albums) { var a = r.albums[i]; @@ -36,7 +36,7 @@ function albumClickHandler(r) { paths.push($(this).attr('title')); path = ''; for (var e in paths) path += '/' + paths[e]; - $.getJSON('ajax/sharing.php', {operation: 'get_gallery', token: TOKEN, path: path}, function(r) { + $.getJSON(OC.filePath('gallery', 'ajax', 'sharing.php'), {operation: 'get_gallery', token: TOKEN, path: path}, function(r) { var name = paths[paths.length-1]; counter++; var d = ''+name+''; @@ -49,9 +49,9 @@ function albumClickHandler(r) { var pat = ''; for (var a in paths) pat += '/'+paths[a]; - var photo_template = ''; + var photo_template = ''; for (var a in r.photos) { - var local = photo_template.replace('IMGPATH', encodeURIComponent(r.photos[a])).replace('*HREF*', 'ajax/sharing.php?token='+TOKEN+'&operation=get_photo&photo='+encodeURIComponent(r.photos[a])); + var local = photo_template.replace('IMGPATH', encodeURIComponent(r.photos[a])).replace('*HREF*', OC.filePath('gallery', 'ajax', 'sharing.php') + '?token='+TOKEN+'&operation=get_photo&photo='+encodeURIComponent(r.photos[a])); element.append(local); } } -- 2.39.5