don't show the share action in the file view for publically shared files.

This commit is contained in:
Björn Schießle 2012-10-10 17:43:09 +02:00
parent fe5b4d2fba
commit 41640b4b91
3 changed files with 11 additions and 1 deletions

View 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

View 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

View 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', '' );