From d9e8ebabdcd99bade4201d6be82e1841d30c5d65 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Mon, 19 Aug 2013 13:24:07 +0200 Subject: [PATCH] outsource sharing and deleted files previews to apps --- {core => apps/files_sharing}/ajax/publicpreview.php | 3 +-- apps/files_sharing/appinfo/routes.php | 5 +++++ .../files_trashbin/ajax/preview.php | 3 +-- apps/files_trashbin/appinfo/routes.php | 5 +++++ core/routes.php | 4 ---- 5 files changed, 12 insertions(+), 8 deletions(-) rename {core => apps/files_sharing}/ajax/publicpreview.php (97%) create mode 100644 apps/files_sharing/appinfo/routes.php rename core/ajax/trashbinpreview.php => apps/files_trashbin/ajax/preview.php (94%) create mode 100644 apps/files_trashbin/appinfo/routes.php diff --git a/core/ajax/publicpreview.php b/apps/files_sharing/ajax/publicpreview.php similarity index 97% rename from core/ajax/publicpreview.php rename to apps/files_sharing/ajax/publicpreview.php index 83194d5349..41a1c178a4 100644 --- a/core/ajax/publicpreview.php +++ b/apps/files_sharing/ajax/publicpreview.php @@ -81,6 +81,5 @@ try{ $preview->show(); } catch (\Exception $e) { \OC_Response::setStatus(500); - \OC_Log::write('core', $e->getmessage(), \OC_Log::ERROR); - exit; + \OC_Log::write('core', $e->getmessage(), \OC_Log::DEBUG); } \ No newline at end of file diff --git a/apps/files_sharing/appinfo/routes.php b/apps/files_sharing/appinfo/routes.php new file mode 100644 index 0000000000..02815b5eb4 --- /dev/null +++ b/apps/files_sharing/appinfo/routes.php @@ -0,0 +1,5 @@ +create('core_ajax_public_preview', '/publicpreview.png')->action( +function() { + require_once __DIR__ . '/../ajax/publicpreview.php'; +}); \ No newline at end of file diff --git a/core/ajax/trashbinpreview.php b/apps/files_trashbin/ajax/preview.php similarity index 94% rename from core/ajax/trashbinpreview.php rename to apps/files_trashbin/ajax/preview.php index a916dcf229..a0846b051c 100644 --- a/core/ajax/trashbinpreview.php +++ b/apps/files_trashbin/ajax/preview.php @@ -38,6 +38,5 @@ try{ $preview->showPreview(); }catch(\Exception $e) { \OC_Response::setStatus(500); - \OC_Log::write('core', $e->getmessage(), \OC_Log::ERROR); - exit; + \OC_Log::write('core', $e->getmessage(), \OC_Log::DEBUG); } \ No newline at end of file diff --git a/apps/files_trashbin/appinfo/routes.php b/apps/files_trashbin/appinfo/routes.php new file mode 100644 index 0000000000..b1c3f02741 --- /dev/null +++ b/apps/files_trashbin/appinfo/routes.php @@ -0,0 +1,5 @@ +create('core_ajax_trashbin_preview', '/preview.png')->action( +function() { + require_once __DIR__ . '/../ajax/preview.php'; +}); \ No newline at end of file diff --git a/core/routes.php b/core/routes.php index ce35be1d58..f0f8ce571e 100644 --- a/core/routes.php +++ b/core/routes.php @@ -44,10 +44,6 @@ $this->create('core_ajax_routes', '/core/routes.json') ->action('OC_Router', 'JSRoutes'); $this->create('core_ajax_preview', '/core/preview.png') ->actionInclude('core/ajax/preview.php'); -$this->create('core_ajax_trashbin_preview', '/core/trashbinpreview.png') - ->actionInclude('core/ajax/trashbinpreview.php'); -$this->create('core_ajax_public_preview', '/core/publicpreview.png') - ->actionInclude('core/ajax/publicpreview.php'); OC::$CLASSPATH['OC_Core_LostPassword_Controller'] = 'core/lostpassword/controller.php'; $this->create('core_lostpassword_index', '/lostpassword/') ->get()