From 7d8c5f73f551c0d7224bccef6af4b272c124b7e9 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Thu, 21 Sep 2017 11:37:37 +0200 Subject: Add direct preview link to single shared image files Signed-off-by: Roeland Jago Douma --- core/routes.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'core/routes.php') diff --git a/core/routes.php b/core/routes.php index a572c83d749..af445d9da8f 100644 --- a/core/routes.php +++ b/core/routes.php @@ -135,6 +135,14 @@ $this->create('files_sharing.sharecontroller.downloadShare', '/s/{token}/downloa throw new \OC\HintException('App file sharing is not enabled'); } }); +$this->create('files_sharing.publicpreview.directLink', '/s/{token}/preview')->get()->action(function($urlParams) { + if (class_exists(\OCA\Files_Sharing\AppInfo\Application::class, false)) { + $app = new \OCA\Files_Sharing\AppInfo\Application($urlParams); + $app->dispatch('PublicPreviewController', 'directLink'); + } else { + throw new \OC\HintException('App file sharing is not enabled'); + } +}); // used for heartbeat $this->create('heartbeat', '/heartbeat')->action(function(){ -- cgit v1.2.3