<optiontype>boolean</optiontype>
<defaultvalue>0</defaultvalue>
</option>
+ <option name="message_sidebar_enable_user_online_marking">
+ <categoryname>message.sidebar</categoryname>
+ <optiontype>boolean</optiontype>
+ <defaultvalue>1</defaultvalue>
+ <options>module_users_online</options>
+ </option>
<option name="message_sidebar_user_options">
<categoryname>message.sidebar</categoryname>
<optiontype>useroptions</optiontype>
<header>
<h2 class="username">
<a href="{link controller='User' object=$userProfile->getDecoratedObject()}{/link}" class="userLink" data-user-id="{@$userProfile->userID}" rel="author">
- <span itemprop="name">{$username}</span>
+ <span itemprop="name">{if MESSAGE_SIDEBAR_ENABLE_USER_ONLINE_MARKING}{@$userProfile->getFormattedUsername()}{else}{$username}{/if}</span>
</a>
</h2>
use wcf\data\user\avatar\DefaultAvatar;
use wcf\data\user\avatar\Gravatar;
use wcf\data\user\avatar\UserAvatar;
+use wcf\data\user\group\UserGroup;
use wcf\data\user\online\UserOnline;
use wcf\data\user\option\ViewableUserOption;
use wcf\data\user\rank\UserRank;
$option->setOptionValue($this->getDecoratedObject());
return $option->optionValue;
}
+
+ /**
+ * Returns the formatted username.
+ *
+ * @return string
+ */
+ public function getFormattedUsername() {
+ $username = StringUtil::encodeHTML($this->username);
+
+ if ($this->userOnlineGroupID) {
+ $group = UserGroup::getGroupByID($this->userOnlineGroupID);
+ if ($group !== null && $group->userOnlineMarking && $group->userOnlineMarking != '%s') {
+ return sprintf($group->userOnlineMarking, $username);
+ }
+ }
+
+ return $username;
+ }
}
<item name="wcf.acp.option.google_maps_enable_double_click_zoom"><![CDATA[Zoom durch Doppelklick zulassen]]></item>
<item name="wcf.acp.option.google_maps_default_latitude"><![CDATA[Standard-Kartenposition (Breitengrad)]]></item>
<item name="wcf.acp.option.google_maps_default_longitude"><![CDATA[Standard-Kartenposition (Längengrad)]]></item>
+ <item name="wcf.acp.option.message_sidebar_enable_user_online_marking"><![CDATA[„Benutzer online“-Darstellung für Benutzernamen verwenden]]></item>
</category>
<category name="wcf.acp.package">
<item name="wcf.acp.option.google_maps_enable_double_click_zoom"><![CDATA[Enable Zoom by Double-Clicking]]></item>
<item name="wcf.acp.option.google_maps_default_latitude"><![CDATA[Default Map Position (Latitude)]]></item>
<item name="wcf.acp.option.google_maps_default_longitude"><![CDATA[Default Map Position (Longitude)]]></item>
+ <item name="wcf.acp.option.message_sidebar_enable_user_online_marking"><![CDATA[TODO: „Benutzer online“-Darstellung für Benutzernamen verwenden]]></item>
</category>
<category name="wcf.acp.package">