From: Georg Ehrke Date: Mon, 19 Aug 2013 11:24:07 +0000 (+0200) Subject: outsource sharing and deleted files previews to apps X-Git-Tag: v6.0.0alpha2~235^2~15 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d9e8ebabdcd99bade4201d6be82e1841d30c5d65;p=nextcloud-server.git outsource sharing and deleted files previews to apps --- diff --git a/apps/files_sharing/ajax/publicpreview.php b/apps/files_sharing/ajax/publicpreview.php new file mode 100644 index 00000000000..41a1c178a48 --- /dev/null +++ b/apps/files_sharing/ajax/publicpreview.php @@ -0,0 +1,85 @@ +setFile($sharedFile); + $preview->setMaxX($maxX); + $preview->setMaxY($maxY); + $preview->setScalingUp($scalingUp); + + $preview->show(); +} catch (\Exception $e) { + \OC_Response::setStatus(500); + \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 00000000000..02815b5eb42 --- /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/apps/files_trashbin/ajax/preview.php b/apps/files_trashbin/ajax/preview.php new file mode 100644 index 00000000000..a0846b051c7 --- /dev/null +++ b/apps/files_trashbin/ajax/preview.php @@ -0,0 +1,42 @@ +setFile($file); + $preview->setMaxX($maxX); + $preview->setMaxY($maxY); + $preview->setScalingUp($scalingUp); + + $preview->showPreview(); +}catch(\Exception $e) { + \OC_Response::setStatus(500); + \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 00000000000..b1c3f02741e --- /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/ajax/publicpreview.php b/core/ajax/publicpreview.php deleted file mode 100644 index 83194d5349c..00000000000 --- a/core/ajax/publicpreview.php +++ /dev/null @@ -1,86 +0,0 @@ -setFile($sharedFile); - $preview->setMaxX($maxX); - $preview->setMaxY($maxY); - $preview->setScalingUp($scalingUp); - - $preview->show(); -} catch (\Exception $e) { - \OC_Response::setStatus(500); - \OC_Log::write('core', $e->getmessage(), \OC_Log::ERROR); - exit; -} \ No newline at end of file diff --git a/core/ajax/trashbinpreview.php b/core/ajax/trashbinpreview.php deleted file mode 100644 index a916dcf229f..00000000000 --- a/core/ajax/trashbinpreview.php +++ /dev/null @@ -1,43 +0,0 @@ -setFile($file); - $preview->setMaxX($maxX); - $preview->setMaxY($maxY); - $preview->setScalingUp($scalingUp); - - $preview->showPreview(); -}catch(\Exception $e) { - \OC_Response::setStatus(500); - \OC_Log::write('core', $e->getmessage(), \OC_Log::ERROR); - exit; -} \ No newline at end of file diff --git a/core/routes.php b/core/routes.php index ce35be1d583..f0f8ce571e2 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()