Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2017-09-21 12:37:37 +0300
committerRoeland Jago Douma <roeland@famdouma.nl>2017-09-25 17:18:50 +0300
commit7d8c5f73f551c0d7224bccef6af4b272c124b7e9 (patch)
treed9e1d8d7b7a9444c8abd4b10fe8f73eb79365b7f /core/routes.php
parent29fb315ffcbfb910a36b58ca99cdefb1fe531423 (diff)
Add direct preview link to single shared image files
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'core/routes.php')
-rw-r--r--core/routes.php8
1 files changed, 8 insertions, 0 deletions
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(){