diff options
author | Vincent Petry <pvince81@owncloud.com> | 2013-10-21 12:05:14 -0700 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2013-10-21 12:05:14 -0700 |
commit | 635a46b3736be2c38835cb38441d969e9d45bab1 (patch) | |
tree | ed7f0eab5aa370776044d91baedb47469fbfb9cc | |
parent | be5e1e990bc6a2e4b4821b2b3280a03e0fd639d8 (diff) | |
parent | 85edbb08c1768237e005fea3a763deff2c859c29 (diff) | |
download | nextcloud-server-635a46b3736be2c38835cb38441d969e9d45bab1.tar.gz nextcloud-server-635a46b3736be2c38835cb38441d969e9d45bab1.zip |
Merge pull request #5444 from frisco82/fixDisplayGroup
Fix display name for user after sharing
-rw-r--r-- | core/ajax/share.php | 7 | ||||
-rw-r--r-- | core/js/share.js | 12 |
2 files changed, 11 insertions, 8 deletions
diff --git a/core/ajax/share.php b/core/ajax/share.php index dbad8f2e971..7dd89deb8e5 100644 --- a/core/ajax/share.php +++ b/core/ajax/share.php @@ -305,8 +305,9 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo && $uid != OC_User::getUser()) { $shareWith[] = array( 'label' => $displayName, - 'value' => array('shareType' => OCP\Share::SHARE_TYPE_USER, - 'shareWith' => $uid) + 'value' => array( + 'shareType' => OCP\Share::SHARE_TYPE_USER, + 'shareWith' => $uid) ); $count++; } @@ -324,7 +325,7 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo || !is_array($_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP]) || !in_array($group, $_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP])) { $shareWith[] = array( - 'label' => $group.' ('.$l->t('group').')', + 'label' => $group, 'value' => array( 'shareType' => OCP\Share::SHARE_TYPE_GROUP, 'shareWith' => $group diff --git a/core/js/share.js b/core/js/share.js index 9c606b9de62..17d69d6b4b3 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -282,7 +282,7 @@ OC.Share={ // Default permissions are Edit (CRUD) and Share var permissions = OC.PERMISSION_ALL; OC.Share.share(itemType, itemSource, shareType, shareWith, permissions, function() { - OC.Share.addShareWith(shareType, shareWith, selected.item.value.shareWith, permissions, possiblePermissions); + OC.Share.addShareWith(shareType, shareWith, selected.item.label, permissions, possiblePermissions); $('#shareWith').val(''); OC.Share.updateIcon(itemType, itemSource); }); @@ -291,12 +291,14 @@ OC.Share={ }) // customize internal _renderItem function to display groups and users differently .data("ui-autocomplete")._renderItem = function( ul, item ) { - var insert = $( "<a>" ).text( item.label ); - if(item.label.length > 8 && item.label.substr(item.label.length-8) === ' (group)') { - // current label is group - wrap "strong" element - insert = insert.wrapInner('<strong>'); + var insert = $( "<a>" ); + var text = (item.value.shareType == 1)? item.label + ' ('+t('core', 'group')+')' : item.label; + insert.text( text ); + if(item.value.shareType == 1) { + insert = insert.wrapInner('<strong></strong>'); } return $( "<li>" ) + .addClass((item.value.shareType == 1)?'group':'user') .append( insert ) .appendTo( ul ); }; |