mirror of
https://github.com/nextcloud/server.git
synced 2026-04-28 01:28:08 -04:00
Merge pull request #7012 from owncloud/display-share-owner-master
adding share owner information to the file list
This commit is contained in:
commit
2cfd875e61
4 changed files with 30 additions and 13 deletions
|
|
@ -17,7 +17,13 @@ $totalsize = 0; ?>
|
|||
data-mime="<?php p($file['mimetype'])?>"
|
||||
data-size="<?php p($file['size']);?>"
|
||||
data-etag="<?php p($file['etag']);?>"
|
||||
data-permissions="<?php p($file['permissions']); ?>">
|
||||
data-permissions="<?php p($file['permissions']); ?>"
|
||||
|
||||
<?php if(isset($file['displayname_owner'])): ?>
|
||||
data-share-owner="<?php p($file['displayname_owner']) ?>"
|
||||
<?php endif; ?>
|
||||
>
|
||||
|
||||
<?php if(isset($file['isPreviewAvailable']) and $file['isPreviewAvailable']): ?>
|
||||
<td class="filename svg preview-icon"
|
||||
<?php else: ?>
|
||||
|
|
@ -34,17 +40,15 @@ $totalsize = 0; ?>
|
|||
<span class="nametext">
|
||||
<?php print_unescaped(htmlspecialchars($file['name']));?>
|
||||
</span>
|
||||
<span class="uploadtext" currentUploads="0">
|
||||
</span>
|
||||
</a>
|
||||
<?php else: ?>
|
||||
<a class="name" href="<?php p(rtrim($_['downloadURL'],'/').'/'.trim($directory,'/').'/'.$name); ?>">
|
||||
<label class="filetext" title="" for="select-<?php p($file['fileid']); ?>"></label>
|
||||
<span class="nametext"><?php print_unescaped(htmlspecialchars($file['basename']));?><span class='extension'><?php p($file['extension']);?></span></span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if($file['type'] == 'dir'):?>
|
||||
<span class="uploadtext" currentUploads="0">
|
||||
</span>
|
||||
<?php endif;?>
|
||||
</a>
|
||||
</td>
|
||||
<td class="filesize"
|
||||
style="color:rgb(<?php p($simple_size_color.','.$simple_size_color.','.$simple_size_color) ?>)">
|
||||
|
|
|
|||
|
|
@ -5,6 +5,14 @@ $(document).ready(function() {
|
|||
|
||||
if (typeof OC.Share !== 'undefined' && typeof FileActions !== 'undefined' && !disableSharing) {
|
||||
$('#fileList').on('fileActionsReady',function(){
|
||||
|
||||
var allShared = $('#fileList').find('[data-share-owner]').find('[data-Action="Share"]');
|
||||
allShared.addClass('permanent');
|
||||
allShared.find('span').text(function(){
|
||||
$owner = $(this).closest('tr').attr('data-share-owner');
|
||||
return ' ' + t('files_sharing', 'Shared by {owner}', {owner: $owner});
|
||||
});
|
||||
|
||||
if (!sharesLoaded){
|
||||
OC.Share.loadIcons('file');
|
||||
// assume that we got all shares, so switching directories
|
||||
|
|
@ -17,16 +25,15 @@ $(document).ready(function() {
|
|||
});
|
||||
|
||||
FileActions.register('all', 'Share', OC.PERMISSION_READ, OC.imagePath('core', 'actions/share'), function(filename) {
|
||||
if ($('#dir').val() == '/') {
|
||||
var item = $('#dir').val() + filename;
|
||||
} else {
|
||||
var item = $('#dir').val() + '/' + filename;
|
||||
var dir = $('#dir').val();
|
||||
var item = dir + '/' + filename;
|
||||
if (dir == '/') {
|
||||
item = dir + filename;
|
||||
}
|
||||
var tr = FileList.findFileEl(filename);
|
||||
var itemType = 'file';
|
||||
if ($(tr).data('type') == 'dir') {
|
||||
var itemType = 'folder';
|
||||
} else {
|
||||
var itemType = 'file';
|
||||
itemType = 'folder';
|
||||
}
|
||||
var possiblePermissions = $(tr).data('permissions');
|
||||
var appendTo = $(tr).find('td.filename');
|
||||
|
|
|
|||
|
|
@ -137,9 +137,12 @@ class Shared_Cache extends Cache {
|
|||
} else {
|
||||
$cache = $this->getSourceCache($folder);
|
||||
if ($cache) {
|
||||
$parent = $this->storage->getFile($folder);
|
||||
$sourceFolderContent = $cache->getFolderContents($this->files[$folder]);
|
||||
foreach ($sourceFolderContent as $key => $c) {
|
||||
$sourceFolderContent[$key]['usersPath'] = 'files/Shared/' . $folder . '/' . $c['name'];
|
||||
$sourceFolderContent[$key]['uid_owner'] = $parent['uid_owner'];
|
||||
$sourceFolderContent[$key]['displayname_owner'] = $parent['uid_owner'];
|
||||
}
|
||||
|
||||
return $sourceFolderContent;
|
||||
|
|
|
|||
|
|
@ -94,6 +94,9 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent {
|
|||
$file['mtime'] = $item['mtime'];
|
||||
$file['encrypted'] = $item['encrypted'];
|
||||
$file['etag'] = $item['etag'];
|
||||
$file['uid_owner'] = $item['uid_owner'];
|
||||
$file['displayname_owner'] = $item['displayname_owner'];
|
||||
|
||||
$storage = \OC\Files\Filesystem::getStorage('/');
|
||||
$cache = $storage->getCache();
|
||||
if ($item['encrypted'] or ($item['unencrypted_size'] > 0 and $cache->getMimetype($item['mimetype']) === 'httpd/unix-directory')) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue