* @param jQuery jqXHR
*/
_success: function(data, textStatus, jqXHR) {
+ elBySelAll('.jsUserRow', undefined, function(userRow) {
+ var userId = parseInt(elData(userRow, 'object-id'), 10);
+ if (data.objectIDs.indexOf(userId) !== -1) {
+ elData(userRow, 'banned', data.actionName === 'ban');
+ }
+ });
+
$('.jsBanButton').each(function(index, button) {
var $button = $(button);
if (WCF.inArray($button.data('objectID'), data.objectIDs)) {
if (data.actionName == 'ban') {
this._dialog.wcfDialog('close');
}
+
+ WCF.System.Event.fireEvent('com.woltlab.wcf.acp.user', 'refresh', {userIds: data.objectIDs});
}
};
* @param jQuery jqXHR
*/
_success: function(data, textStatus, jqXHR) {
+ elBySelAll('.jsUserRow', undefined, function(userRow) {
+ var userId = parseInt(elData(userRow, 'object-id'), 10);
+ if (data.objectIDs.indexOf(userId) !== -1) {
+ elData(userRow, 'enabled', data.actionName === 'enable');
+ }
+ });
+
$('.jsEnableButton').each(function(index, button) {
var $button = $(button);
if (WCF.inArray($button.data('objectID'), data.objectIDs)) {
var $notification = new WCF.System.Notification();
$notification.show(function() { window.location.reload(); });
+
+ WCF.System.Event.fireEvent('com.woltlab.wcf.acp.user', 'refresh', {userIds: data.objectIDs});
}
};
'wcf.acp.user.ban.neverExpires': '{lang}wcf.acp.user.ban.neverExpires{/lang}',
'wcf.acp.user.sendNewPassword.workerTitle': '{lang}wcf.acp.user.sendNewPassword.workerTitle{/lang}',
'wcf.acp.worker.abort.confirmMessage': '{lang}wcf.acp.worker.abort.confirmMessage{/lang}',
- 'wcf.acp.content.removeContent': '{lang}wcf.acp.content.removeContent{/lang}'
+ 'wcf.acp.content.removeContent': '{lang}wcf.acp.content.removeContent{/lang}',
+ 'wcf.user.status.banned': '{lang}wcf.user.status.banned{/lang}',
+ 'wcf.user.status.isDisabled': '{lang}wcf.user.status.isDisabled{/lang}'
});
WCF.ACP.User.BanHandler.init();
<td class="columnID columnUserID">{@$user->userID}</td>
<td class="columnIcon">{@$user->getAvatar()->getImageTag(24)}</td>
<td class="columnTitle columnUsername">
- {if $user->editable}
- <a title="{lang}wcf.acp.user.edit{/lang}" href="{link controller='UserEdit' id=$user->userID}{/link}">{$user->username}</a>
- {else}
- {$user->username}
- {/if}
+ <span class="username">
+ {if $user->editable}
+ <a title="{lang}wcf.acp.user.edit{/lang}" href="{link controller='UserEdit' id=$user->userID}{/link}">{$user->username}</a>
+ {else}
+ {$user->username}
+ {/if}
+ </span>
+
+ <span class="userStatusIcons">
+ {if $user->banned}<span class="icon icon16 fa-lock jsTooltip jsUserStatusBanned" title="{lang}wcf.user.status.banned{/lang}"></span>{/if}
+ {if $user->activationCode != 0}<span class="icon icon16 fa-power-off jsTooltip jsUserStatusIsDisabled" title="{lang}wcf.user.status.isDisabled{/lang}"></span>{/if}
+ </span>
+
{if MODULE_USER_RANK}
{if $user->getUserTitle()} <span class="badge userTitleBadge{if $user->getRank() && $user->getRank()->cssClassName} {@$user->getRank()->cssClassName}{/if}">{$user->getUserTitle()}</span>{/if}
{if $user->getRank() && $user->getRank()->rankImage} <span class="userRankImage">{@$user->getRank()->getImage()}</span>{/if}
*/
init: function () {
elBySelAll('.jsUserRow', undefined, this._initUser.bind(this));
+
+ EventHandler.add('com.woltlab.wcf.acp.user', 'refresh', this._refreshUsers.bind(this));
},
/**
hasItem = true;
}
}
+ },
+
+ _refreshUsers: function (data) {
+ elBySelAll('.jsUserRow', undefined, function(userRow) {
+ var userId = parseInt(elData(userRow, 'object-id'));
+ if (data.userIds.indexOf(userId) !== -1) {
+ var userStatusIcons = elBySel('.userStatusIcons', userRow);
+
+ var banned = elDataBool(userRow, 'banned');
+ var iconBanned = elBySel('.jsUserStatusBanned', userRow);
+ if (banned && iconBanned === null) {
+ iconBanned = elCreate('span');
+ iconBanned.className = 'icon icon16 fa-lock jsUserStatusBanned jsTooltip';
+ iconBanned.title = Language.get('wcf.user.status.banned');
+ userStatusIcons.insertBefore(iconBanned, null);
+ }
+ else if (!banned && iconBanned !== null) {
+ elRemove(iconBanned);
+ }
+
+ var isDisabled = elDataBool(userRow, 'enabled') === false;
+ var iconIsDisabled = elBySel('.jsUserStatusIsDisabled', userRow);
+ if (isDisabled && iconIsDisabled === null) {
+ iconIsDisabled = elCreate('span');
+ iconIsDisabled.className = 'icon icon16 fa-power-off jsUserStatusIsDisabled jsTooltip';
+ iconIsDisabled.title = Language.get('wcf.user.status.isDisabled');
+ userStatusIcons.appendChild(iconIsDisabled);
+ }
+ else if (!isDisabled && iconIsDisabled !== null) {
+ elRemove(iconIsDisabled);
+ }
+ }
+ })
}
};
});
<item name="wcf.user.sortField.lastActivityTime"><![CDATA[Letzte Aktivität]]></item>
<item name="wcf.user.sortField.reactionReputation"><![CDATA[Reputation aus Reaktionen]]></item>
<item name="wcf.user.articles"><![CDATA[Artikel]]></item>
+ <item name="wcf.user.status.banned"><![CDATA[Der Benutzer ist gesperrt.]]></item>
+ <item name="wcf.user.status.isDisabled"><![CDATA[Der Benutzer ist nicht freigeschaltet.]]></item>
</category>
<category name="wcf.user.menu">
<item name="wcf.user.menu.community"><![CDATA[Community]]></item>
<item name="wcf.user.sortField.lastActivityTime"><![CDATA[Last Activity]]></item>
<item name="wcf.user.sortField.reactionReputation"><![CDATA[Reputation from Reactions]]></item>
<item name="wcf.user.articles"><![CDATA[Articles]]></item>
+ <item name="wcf.user.status.banned"><![CDATA[The user has been banned.]]></item>
+ <item name="wcf.user.status.isDisabled"><![CDATA[The user has not been approved yet.]]></item>
</category>
<category name="wcf.user.menu">
<item name="wcf.user.menu.community"><![CDATA[Community]]></item>