summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/get.php
diff options
context:
space:
mode:
authorMichael Gapczynski <GapczynskiM@gmail.com>2011-08-18 19:32:24 -0400
committerMichael Gapczynski <GapczynskiM@gmail.com>2011-08-18 19:32:24 -0400
commitd1aebcddf26c155c4efa580d19bb99c0e51ecbba (patch)
tree1165c856c9f1213593437c9ed84461a11112d9b0 /apps/files_sharing/get.php
parent498356fcb85198fd447f112268bb2bb769c05089 (diff)
downloadnextcloud-server-d1aebcddf26c155c4efa580d19bb99c0e51ecbba.tar.gz
nextcloud-server-d1aebcddf26c155c4efa580d19bb99c0e51ecbba.zip
Add downloadURL to files templates for both public links and files
Diffstat (limited to 'apps/files_sharing/get.php')
-rw-r--r--apps/files_sharing/get.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/apps/files_sharing/get.php b/apps/files_sharing/get.php
index 121793e36fb..a828989a8a5 100644
--- a/apps/files_sharing/get.php
+++ b/apps/files_sharing/get.php
@@ -13,14 +13,13 @@ if ($source !== false) {
$user = substr($source, 1, strpos($source, "/", 1) - 1);
OC_Util::setupFS($user);
$source = substr($source, strlen("/".$user."/files"));
- $dir = isset( $_GET['dir'] ) ? $_GET['dir'] : '';
- print_r($dir);
+ $subPath = isset( $_GET['path'] ) ? $_GET['path'] : '';
$root = $source;
- $source .= $dir;
+ $source .= $subPath;
if (!OC_Filesystem::file_exists($source)) {
header("HTTP/1.0 404 Not Found");
$tmpl = new OC_Template("", "404", "guest");
- $tmpl->assign("file", $dir);
+ $tmpl->assign("file", $subPath);
$tmpl->printPage();
exit;
}
@@ -42,7 +41,7 @@ if ($source !== false) {
// Make breadcrumb
$breadcrumb = array();
$pathtohere = "/";
- foreach (explode("/", $dir) as $i) {
+ foreach (explode("/", $subPath) as $i) {
if ($i != "") {
$pathtohere .= "$i/";
$breadcrumb[] = array("dir" => $pathtohere, "name" => $i);
@@ -54,10 +53,11 @@ if ($source !== false) {
OC_Util::addScript("files", "filelist");
$breadcrumbNav = new OC_Template("files", "part.breadcrumb", "");
$breadcrumbNav->assign("breadcrumb", $breadcrumb);
- $breadcrumbNav->assign("baseUrl", OC_Helper::linkTo("files_sharing", "get.php")."?token=".$token."&");
+ $breadcrumbNav->assign("baseURL", OC_Helper::linkTo("files_sharing", "get.php")."?token=".$token."&path=");
$list = new OC_Template("files", "part.list", "");
$list->assign("files", $files);
- $list->assign("baseUrl", OC_Helper::linkTo("files_sharing", "get.php")."?token=".$token."&");
+ $list->assign("baseURL", OC_Helper::linkTo("files_sharing", "get.php")."?token=".$token."&path=");
+ $list->assign("downloadURL", OC_Helper::linkTo("files_sharing", "get.php")."?token=".$token."&path=");
$tmpl = new OC_Template("files", "index", "user");
$tmpl->assign("fileList", $list->fetchPage());
$tmpl->assign("breadcrumb", $breadcrumbNav->fetchPage());