summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2012-09-07 00:01:52 -0400
committerMichael Gapczynski <mtgap@owncloud.com>2012-09-07 00:02:22 -0400
commit73d726d1b26f011e77761934bcf7f5ce8db86241 (patch)
treeb95913dddcd74b71a97c20ea843d5a4ea23ded16 /apps/files
parent17dadd5c8a39f1903ffeec2c2c78e5e6cd145d9c (diff)
downloadnextcloud-server-73d726d1b26f011e77761934bcf7f5ce8db86241.tar.gz
nextcloud-server-73d726d1b26f011e77761934bcf7f5ce8db86241.zip
Support for unshare from self, with a bunch of temporary fixes to overcome configuration problems with file actions
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/js/fileactions.js7
-rw-r--r--apps/files/js/filelist.js7
-rw-r--r--apps/files/templates/index.php7
3 files changed, 18 insertions, 3 deletions
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js
index b7670fa2259..1403d345e8a 100644
--- a/apps/files/js/fileactions.js
+++ b/apps/files/js/fileactions.js
@@ -103,7 +103,12 @@ var FileActions={
if(img.call){
img=img(file);
}
- var html='<a href="#" original-title="' + t('files', 'Delete') + '" class="action delete" style="display:none" />';
+ // NOTE: Temporary fix to allow unsharing of files in root of Shared folder
+ if ($('#dir').val() == '/Shared') {
+ var html = '<a href="#" original-title="' + t('files', 'Unshare') + '" class="action delete" style="display:none" />';
+ } else {
+ var html='<a href="#" original-title="' + t('files', 'Delete') + '" class="action delete" style="display:none" />';
+ }
var element=$(html);
if(img){
element.append($('<img src="'+img+'"/>'));
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index b777785f4d9..7ebfd4b68bb 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -263,7 +263,12 @@ var FileList={
return;
}
FileList.prepareDeletion(files);
- $('#notification').html(t('files', 'deleted')+' '+files+'<span class="undo">'+t('files', 'undo')+'</span>');
+ // NOTE: Temporary fix to change the text to unshared for files in root of Shared folder
+ if ($('#dir').val() == '/Shared') {
+ $('#notification').html(t('files', 'unshared')+' '+files+'<span class="undo">'+t('files', 'undo')+'</span>');
+ } else {
+ $('#notification').html(t('files', 'deleted')+' '+files+'<span class="undo">'+t('files', 'undo')+'</span>');
+ }
$('#notification').fadeIn();
},
finishDelete:function(ready,sync){
diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php
index ec9e80e955e..911a312fb9a 100644
--- a/apps/files/templates/index.php
+++ b/apps/files/templates/index.php
@@ -57,7 +57,12 @@
<th id="headerDate">
<span id="modified"><?php echo $l->t( 'Modified' ); ?></span>
<?php if ($_['permissions'] & OCP\Share::PERMISSION_DELETE): ?>
- <span class="selectedActions"><a href="" class="delete"><?php echo $l->t('Delete')?> <img class="svg" alt="<?php echo $l->t('Delete')?>" src="<?php echo OCP\image_path("core", "actions/delete.svg"); ?>" /></a></span>
+<!-- NOTE: Temporary fix to allow unsharing of files in root of Shared folder -->
+ <?php if ($_['dir'] == '/Shared'): ?>
+ <span class="selectedActions"><a href="" class="delete"><?php echo $l->t('Unshare')?> <img class="svg" alt="<?php echo $l->t('Unshare')?>" src="<?php echo OCP\image_path("core", "actions/delete.svg"); ?>" /></a></span>
+ <?php else: ?>
+ <span class="selectedActions"><a href="" class="delete"><?php echo $l->t('Delete')?> <img class="svg" alt="<?php echo $l->t('Delete')?>" src="<?php echo OCP\image_path("core", "actions/delete.svg"); ?>" /></a></span>
+ <?php endif; ?>
<?php endif; ?>
</th>
</tr>