Skip to content

Commit 90218dc

Browse files
committed
Added config check
1 parent ecb7d44 commit 90218dc

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

core/js/config.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
'session_keepalive' => \OCP\Config::getSystemValue('session_keepalive', true),
7575
'version' => implode('.', OC_Util::getVersion()),
7676
'versionstring' => OC_Util::getVersionString(),
77+
'enable_avatars' => \OC::$server->getConfig()->getSystemValue('enable_avatars', true),
7778
)
7879
),
7980
"oc_appconfig" => json_encode(

core/js/share.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,17 @@ OC.Share={
358358
var html = '<div id="dropdown" class="drop shareDropDown" data-item-type="'+itemType+'" data-item-source="'+itemSource+'">';
359359
if (data !== false && data.reshare !== false && data.reshare.uid_owner !== undefined) {
360360
if (data.reshare.share_type == OC.Share.SHARE_TYPE_GROUP) {
361-
html += '<span class="reshare">'+t('core', 'Shared with you and the group {group} by {owner}', {group: data.reshare.share_with, owner: data.reshare.displayname_owner})+' <div id="avatar-share-owner" style="display: inline-block"></div></span>';
361+
html += '<span class="reshare">'+t('core', 'Shared with you and the group {group} by {owner}', {group: data.reshare.share_with, owner: data.reshare.displayname_owner});
362+
if (oc_config.enable_avatars === true) {
363+
html += ' <div id="avatar-share-owner" style="display: inline-block"></div>';
364+
}
365+
html += '</span>';
362366
} else {
363-
html += '<span class="reshare">'+t('core', 'Shared with you by {owner}', {owner: data.reshare.displayname_owner})+' <div id="avatar-share-owner" style="display: inline-block"></div></span>';
367+
html += '<span class="reshare">'+t('core', 'Shared with you by {owner}', {owner: data.reshare.displayname_owner});
368+
if (oc_config.enable_avatars === true) {
369+
html += ' <div id="avatar-share-owner" style="display: inline-block"></div>';
370+
}
371+
html += '</span>';
364372
}
365373
html += '<br />';
366374
// reduce possible permissions to what the original share allowed
@@ -439,7 +447,7 @@ OC.Share={
439447
dropDownEl = dropDownEl.appendTo(appendTo);
440448

441449
//Get owner avatars
442-
if (data !== false && data.reshare !== false && data.reshare.uid_owner !== undefined) {
450+
if (oc_config.enable_avatars === true && data !== false && data.reshare !== false && data.reshare.uid_owner !== undefined) {
443451
$('#avatar-share-owner').avatar(data.reshare.uid_owner, 32);
444452
}
445453

@@ -656,10 +664,12 @@ OC.Share={
656664
var html = '<li style="clear: both;" data-share-type="'+escapeHTML(shareType)+'" data-share-with="'+escapeHTML(shareWith)+'" title="' + escapeHTML(shareWith) + '">';
657665
var showCrudsButton;
658666
html += '<a href="#" class="unshare"><img class="svg" alt="'+t('core', 'Unshare')+'" title="'+t('core', 'Unshare')+'" src="'+OC.imagePath('core', 'actions/delete')+'"/></a>';
659-
if (shareType === OC.Share.SHARE_TYPE_USER) {
660-
html += '<div id="avatar-' + escapeHTML(shareWith) + '" class="avatar"></div>';
661-
} else {
662-
html += '<div class="avatar" style="padding-right: 32px"></div>';
667+
if (oc_config.enable_avatars === true) {
668+
if (shareType === OC.Share.SHARE_TYPE_USER) {
669+
html += '<div id="avatar-' + escapeHTML(shareWith) + '" class="avatar"></div>';
670+
} else {
671+
html += '<div class="avatar" style="padding-right: 32px"></div>';
672+
}
663673
}
664674
html += '<span class="username">' + escapeHTML(shareWithDisplayName) + '</span>';
665675
var mailNotificationEnabled = $('input:hidden[name=mailNotificationEnabled]').val();
@@ -692,7 +702,7 @@ OC.Share={
692702
html += '</div>';
693703
html += '</li>';
694704
html = $(html).appendTo('#shareWithList');
695-
if (shareType === OC.Share.SHARE_TYPE_USER) {
705+
if (oc_config.enable_avatars === true && shareType === OC.Share.SHARE_TYPE_USER) {
696706
$('#avatar-' + escapeHTML(shareWith)).avatar(escapeHTML(shareWith), 32);
697707
}
698708
// insert cruds button into last label element

0 commit comments

Comments
 (0)