summaryrefslogtreecommitdiffstats
path: root/core/routes.php
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-05-04 10:28:06 +0200
committerVincent Petry <pvince81@owncloud.com>2016-05-06 16:46:59 +0200
commit093e9dd4225e6681140523c75bfc20809cd6d651 (patch)
tree21541ba147dad52fefc704900b6aebe4b8d921b0 /core/routes.php
parentba998670333b5430cd00dbce82a44f831ef34da1 (diff)
downloadnextcloud-server-093e9dd4225e6681140523c75bfc20809cd6d651.tar.gz
nextcloud-server-093e9dd4225e6681140523c75bfc20809cd6d651.zip
Add route to resolve fileid to files app URL
The following routes will redirect to the files app and display the matching folder. If the fileid is a file, it will scroll to it. - http://localhost/owncloud/index.php/f/$fileid - http://localhost/owncloud/index.php/files/?dir=somedir&fileid=$fileid
Diffstat (limited to 'core/routes.php')
-rw-r--r--core/routes.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/routes.php b/core/routes.php
index 2b7a19f7d86..a9c800af4e8 100644
--- a/core/routes.php
+++ b/core/routes.php
@@ -108,6 +108,12 @@ $this->create('core_ajax_preview', '/core/preview.png')
$this->create('core_ajax_update', '/core/ajax/update.php')
->actionInclude('core/ajax/update.php');
+// File routes
+$this->create('files.viewcontroller.showFile', '/f/{fileId}')->action(function($urlParams) {
+ $app = new \OCA\Files\AppInfo\Application($urlParams);
+ $app->dispatch('ViewController', 'showFile');
+});
+
// Sharing routes
$this->create('files_sharing.sharecontroller.showShare', '/s/{token}')->action(function($urlParams) {
$app = new \OCA\Files_Sharing\AppInfo\Application($urlParams);