[Pkg-owncloud-commits] [owncloud] 08/67: don't show the share action in the file view for publically shared files.

David Prévot taffit at alioth.debian.org
Fri Nov 8 23:10:30 UTC 2013


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag v4.5.1
in repository owncloud.

commit f1d9359acfc483c389db4d7ecf566e426ae38afa
Author: Björn Schießle <schiessle at owncloud.com>
Date:   Wed Oct 10 17:43:09 2012 +0200

    don't show the share action in the file view for publically shared files.
---
 apps/files/templates/part.list.php |    9 +++++++++
 apps/files_sharing/js/share.js     |    2 +-
 apps/files_sharing/public.php      |    1 +
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/apps/files/templates/part.list.php b/apps/files/templates/part.list.php
index 8faeae3..1329b5d 100644
--- a/apps/files/templates/part.list.php
+++ b/apps/files/templates/part.list.php
@@ -1,3 +1,12 @@
+		<script type="text/javascript">
+		<?php if ( array_key_exists('publicListView', $_) && $_['publicListView'] == true ) {
+			echo "var publicListView = true;";
+		} else {
+			echo "var publicListView = false;";
+		}
+		?>
+		</script>
+		
 		<?php foreach($_['files'] as $file):
 			$simple_file_size = OCP\simple_file_size($file['size']);
 			$simple_size_color = intval(200-$file['size']/(1024*1024)*2); // the bigger the file, the darker the shade of grey; megabytes*2
diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js
index bc94d78..72663c0 100644
--- a/apps/files_sharing/js/share.js
+++ b/apps/files_sharing/js/share.js
@@ -1,6 +1,6 @@
 $(document).ready(function() {
 
-	if (typeof OC.Share !== 'undefined' && typeof FileActions !== 'undefined') {
+	if (typeof OC.Share !== 'undefined' && typeof FileActions !== 'undefined'  && !publicListView) {
 		OC.Share.loadIcons('file');
 		FileActions.register('all', 'Share', OC.PERMISSION_READ, function(filename) {
 			// Return the correct sharing icon
diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index 3434010..5119086 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -138,6 +138,7 @@ if (isset($_GET['file']) || isset($_GET['dir'])) {
 					}
 					$list = new OCP\Template('files', 'part.list', '');
 					$list->assign('files', $files, false);
+					$list->assign('publicListView', true);
 					$list->assign('baseURL', OCP\Util::linkToPublic('files').'&dir='.$_GET['dir'].'&path=', false);
 					$list->assign('downloadURL', OCP\Util::linkToPublic('files').'&download&dir='.$_GET['dir'].'&path=', false);
 					$breadcrumbNav = new OCP\Template('files', 'part.breadcrumb', '' );

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list