diff options
author | Georg Ehrke <dev@georgswebsite.de> | 2012-04-15 22:28:11 +0200 |
---|---|---|
committer | Georg Ehrke <dev@georgswebsite.de> | 2012-04-15 22:28:11 +0200 |
commit | 77cefdedb86de65e69f470c8b6a1b03bb001966e (patch) | |
tree | 547b3a111c4d07992b7c528f2db4962ee36f91f9 /apps/files_sharing | |
parent | 77a9e343aae4fc19a1e6fbf71b73e171640ac02a (diff) | |
parent | 12818093007d5bdce5519b5015e2a0748c98e24d (diff) | |
download | nextcloud-server-77cefdedb86de65e69f470c8b6a1b03bb001966e.tar.gz nextcloud-server-77cefdedb86de65e69f470c8b6a1b03bb001966e.zip |
Merge branch 'master' into sabredav_1.6
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/appinfo/info.xml | 1 | ||||
-rw-r--r-- | apps/files_sharing/appinfo/version | 1 | ||||
-rw-r--r-- | apps/files_sharing/get.php | 4 | ||||
-rw-r--r-- | apps/files_sharing/js/share.js | 13 |
4 files changed, 12 insertions, 7 deletions
diff --git a/apps/files_sharing/appinfo/info.xml b/apps/files_sharing/appinfo/info.xml index 8fda775520b..490ffaca890 100644 --- a/apps/files_sharing/appinfo/info.xml +++ b/apps/files_sharing/appinfo/info.xml @@ -3,7 +3,6 @@ <id>files_sharing</id> <name>Share Files</name> <description>File sharing between users</description> - <version>0.1</version> <licence>AGPL</licence> <author>Michael Gapczynski</author> <require>2</require> diff --git a/apps/files_sharing/appinfo/version b/apps/files_sharing/appinfo/version new file mode 100644 index 00000000000..ceab6e11ece --- /dev/null +++ b/apps/files_sharing/appinfo/version @@ -0,0 +1 @@ +0.1
\ No newline at end of file diff --git a/apps/files_sharing/get.php b/apps/files_sharing/get.php index 3a3db6dd38e..3e42bf6a6c7 100644 --- a/apps/files_sharing/get.php +++ b/apps/files_sharing/get.php @@ -31,7 +31,7 @@ if ($source !== false) { if ($i['type'] == 'file') { $fileinfo = pathinfo($i['name']); $i['basename'] = $fileinfo['filename']; - $i['extention'] = isset($fileinfo['extension']) ? ('.'.$fileinfo['extension']) : ''; + $i['extension'] = isset($fileinfo['extension']) ? ('.'.$fileinfo['extension']) : ''; } $i['directory'] = substr($i['directory'], $rootLength); if ($i['directory'] == "/") { @@ -62,6 +62,8 @@ if ($source !== false) { $tmpl->assign("fileList", $list->fetchPage()); $tmpl->assign("breadcrumb", $breadcrumbNav->fetchPage()); $tmpl->assign("readonly", true); + $tmpl->assign("allowZipDownload", false); + $tmpl->assign("dir", 'shared dir'); $tmpl->printPage(); } else { //get time mimetype and set the headers diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index fc9e17c25c7..54d749d833e 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -2,8 +2,11 @@ $(document).ready(function() { var shared_status = {}; if (typeof FileActions !== 'undefined') { FileActions.register('all', 'Share', function(filename) { - if (scanFiles.scanning){return;}//workaround to prevent aditional http request block scanning feedback + if (scanFiles.scanning){return;}//workaround to prevent additional http request block scanning feedback var icon; + if (typeof filename == 'undefined') { + return false; + } var file = $('#dir').val()+'/'+filename; if(shared_status[file]) return shared_status[file].icon; @@ -145,7 +148,7 @@ $(document).ready(function() { data: data, success: function(token) { if (token) { - showPublicLink(token); + showPublicLink(token, source.substr(source.lastIndexOf('/'))); } } }); @@ -203,7 +206,7 @@ function createDropdown(filename, files) { if (users) { $.each(users, function(index, row) { if (row.uid_shared_with == 'public') { - showPublicLink(row.token); + showPublicLink(row.token, '/'+filename); } else if (isNaN(index)) { addUser(row.uid_shared_with, row.permissions, index.substr(0, index.lastIndexOf('-'))); } else { @@ -234,9 +237,9 @@ function addUser(uid_shared_with, permissions, parentFolder) { $(user).appendTo('#shared_list'); } -function showPublicLink(token) { +function showPublicLink(token, file) { $('#makelink').attr('checked', true); $('#link').data('token', token); - $('#link').val(parent.location.protocol+'//'+location.host+OC.linkTo('files_sharing','get.php')+'?token='+token); + $('#link').val(parent.location.protocol+'//'+location.host+OC.linkTo('files_sharing','get.php')+'?token='+token+'&f='+file); $('#link').show('blind'); } |