]> source.dussan.org Git - nextcloud-server.git/commitdiff
don't show the share action in the file view for publically shared files.
authorBjörn Schießle <schiessle@owncloud.com>
Wed, 10 Oct 2012 15:43:09 +0000 (17:43 +0200)
committerBjörn Schießle <schiessle@owncloud.com>
Wed, 10 Oct 2012 15:44:21 +0000 (17:44 +0200)
apps/files/templates/part.list.php
apps/files_sharing/js/share.js
apps/files_sharing/public.php

index 8faeae3939cd14344879d6a804ea6f54ec34e4f6..1329b5dc5cd0a5cbab338baf453188e7b8c45964 100644 (file)
@@ -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
index bc94d78fb765f4d020f118310c2d2530d035b576..72663c068c9eb7b8abaeff191bd8adfbf289fc0a 100644 (file)
@@ -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
index 34340102a9e9b18aa0221122d8b5ef5ae2254e82..5119086ce0d6bf6da413cca761c107538cc0d1c5 100644 (file)
@@ -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', '' );