| 1 | <nav id="topMenu" class="userPanel{if $__wcf->user->userID} userPanelLoggedIn{/if}"> |
| 2 | {if $__wcf->user->userID} |
| 3 | <span class="userPanelAvatar">{@$__wcf->getUserProfileHandler()->getAvatar()->getImageTag(32)}</span> |
| 4 | {/if} |
| 5 | |
| 6 | <ul class="userPanelItems"> |
| 7 | {if $__wcf->user->userID} |
| 8 | <!-- user menu --> |
| 9 | <li id="userMenu"> |
| 10 | <a |
| 11 | class="jsTooltip" |
| 12 | href="{$__wcf->user->getLink()}" |
| 13 | title="{lang}wcf.user.controlPanel{/lang}" |
| 14 | role="button" |
| 15 | tabindex="0" |
| 16 | aria-haspopup="true" |
| 17 | aria-expanded="false" |
| 18 | > |
| 19 | {@$__wcf->getUserProfileHandler()->getAvatar()->getImageTag(32)} <span>{lang}wcf.user.userNote{/lang}</span> |
| 20 | </a> |
| 21 | <div class="userMenu userMenuControlPanel" data-origin="userMenu" tabindex="-1" hidden> |
| 22 | <div class="userMenuHeader"> |
| 23 | <div class="userMenuTitle">{lang}wcf.user.controlPanel{/lang}</div> |
| 24 | </div> |
| 25 | <div class="userMenuContent"> |
| 26 | <div class="userMenuItem"> |
| 27 | <div class="userMenuItemImage"> |
| 28 | {@$__wcf->getUserProfileHandler()->getUserProfile()->getAvatar()->getImageTag(48)} |
| 29 | </div> |
| 30 | <div class="userMenuItemContent"> |
| 31 | {* This is the unformatted username, custom styles might not work nicely here and |
| 32 | the consistent styling is used to provide visual anchors to identify links. *} |
| 33 | <a href="{$__wcf->user->getLink()}" class="userMenuItemLink">{$__wcf->user->username}</a> |
| 34 | |
| 35 | {if MODULE_USER_RANK} |
| 36 | {if $__wcf->getUserProfileHandler()->getUserTitle()} |
| 37 | <span class="badge userTitleBadge{if $__wcf->getUserProfileHandler()->getRank() && $__wcf->getUserProfileHandler()->getRank()->cssClassName} {@$__wcf->getUserProfileHandler()->getRank()->cssClassName}{/if}">{$__wcf->getUserProfileHandler()->getUserTitle()}</span> |
| 38 | {/if} |
| 39 | {if $__wcf->getUserProfileHandler()->getRank() && $__wcf->getUserProfileHandler()->getRank()->rankImage} |
| 40 | <span class="userRankImage">{@$__wcf->getUserProfileHandler()->getRank()->getImage()}</span> |
| 41 | {/if} |
| 42 | {/if} |
| 43 | </div> |
| 44 | <div class="userMenuItemMeta"> |
| 45 | {lang}wcf.user.myProfile{/lang} |
| 46 | </div> |
| 47 | </div> |
| 48 | </div> |
| 49 | <div class="userMenuContentDivider"></div> |
| 50 | {if $__wcf->session->getPermission('admin.general.canUseAcp')} |
| 51 | <div class="userMenuContent"> |
| 52 | <div class="userMenuItem userMenuItemNarrow userMenuItemSingleLine"> |
| 53 | <div class="userMenuItemImage"> |
| 54 | <span class="icon icon32 fa-wrench"></span> |
| 55 | </div> |
| 56 | <div class="userMenuItemContent"> |
| 57 | <a href="{link isACP=true}{/link}" class="userMenuItemLink">{lang}wcf.global.acp{/lang}</a> |
| 58 | </div> |
| 59 | </div> |
| 60 | </div> |
| 61 | <div class="userMenuContentDivider"></div> |
| 62 | {/if} |
| 63 | <div class="userMenuContent"> |
| 64 | {foreach from=$__wcf->getUserMenu()->getUserMenuItems() item=menuItem} |
| 65 | <div class="userMenuItem userMenuItemNarrow" data-category="{$menuItem[category]->menuItem}"> |
| 66 | <div class="userMenuItemImage"> |
| 67 | <span class="icon icon32 {$menuItem[category]->getIconClassName()}"></span> |
| 68 | </div> |
| 69 | <div class="userMenuItemContent"> |
| 70 | <a href="{$menuItem[link]}" class="userMenuItemLink"> |
| 71 | {$menuItem[category]->getTitle()} |
| 72 | </a> |
| 73 | </div> |
| 74 | <div class="userMenuItemMeta"> |
| 75 | {implode from=$menuItem[items] item=title glue=' ยท '}{$title}{/implode} |
| 76 | </div> |
| 77 | </div> |
| 78 | {/foreach} |
| 79 | </div> |
| 80 | <div class="userMenuFooter"> |
| 81 | <a href="{link controller='Logout'}t={csrfToken type=url}{/link}" class="userMenuFooterLink">{lang}wcf.user.logout{/lang}</a> |
| 82 | </div> |
| 83 | </div> |
| 84 | <script data-relocate="true"> |
| 85 | require(["WoltLabSuite/Core/Ui/User/Menu/ControlPanel"], ({ setup }) => setup()); |
| 86 | </script> |
| 87 | </li> |
| 88 | |
| 89 | <!-- user notifications --> |
| 90 | {if !$__hideUserMenu|isset} |
| 91 | <li id="userNotifications" data-count="{#$__wcf->getUserNotificationHandler()->getNotificationCount()}" data-title="Benachrichtigungen"> |
| 92 | <a |
| 93 | class="jsTooltip" |
| 94 | href="{link controller='NotificationList'}{/link}" |
| 95 | title="{lang}wcf.user.notification.notifications{/lang}" |
| 96 | role="button" |
| 97 | tabindex="0" |
| 98 | aria-haspopup="true" |
| 99 | aria-expanded="false" |
| 100 | > |
| 101 | <span class="icon icon32 fa-bell-o"></span> <span>{lang}wcf.user.notification.notifications{/lang}</span>{if $__wcf->getUserNotificationHandler()->getNotificationCount()} <span class="badge badgeUpdate">{#$__wcf->getUserNotificationHandler()->getNotificationCount()}</span>{/if} |
| 102 | </a> |
| 103 | {if !OFFLINE || $__wcf->session->getPermission('admin.general.canViewPageDuringOfflineMode')} |
| 104 | <script data-relocate="true"> |
| 105 | require(["WoltLabSuite/Core/Ui/User/Menu/Data/Notification"], ({ setup }) => { |
| 106 | setup({ |
| 107 | noItems: '{jslang}wcf.user.notification.noMoreNotifications{/jslang}', |
| 108 | settingsLink: '{link controller='NotificationSettings' encode=false}{/link}', |
| 109 | settingsTitle: '{jslang}wcf.user.notification.settings{/jslang}', |
| 110 | showAllLink: '{link controller='NotificationList' encode=false}{/link}', |
| 111 | showAllTitle: '{jslang}wcf.user.notification.showAll{/jslang}', |
| 112 | title: '{jslang}wcf.user.notification.notifications{/jslang}', |
| 113 | }); |
| 114 | }); |
| 115 | </script> |
| 116 | {/if} |
| 117 | </li> |
| 118 | {/if} |
| 119 | {else} |
| 120 | {if $__wcf->getLanguage()->getLanguages()|count > 1} |
| 121 | <li id="pageLanguageContainer"> |
| 122 | <script data-relocate="true"> |
| 123 | require(['EventHandler', 'WoltLabSuite/Core/Language/Chooser'], function(EventHandler, LanguageChooser) { |
| 124 | var languages = { |
| 125 | {implode from=$__wcf->getLanguage()->getLanguages() item=_language} |
| 126 | '{@$_language->languageID}': { |
| 127 | iconPath: '{@$_language->getIconPath()|encodeJS}', |
| 128 | languageName: '{@$_language|encodeJS}', |
| 129 | languageCode: '{@$_language->languageCode|encodeJS}' |
| 130 | } |
| 131 | {/implode} |
| 132 | }; |
| 133 | |
| 134 | var callback = function(listItem) { |
| 135 | var location; |
| 136 | var languageCode = elData(listItem, 'language-code'); |
| 137 | var link = elBySel('link[hreflang="' + languageCode + '"]'); |
| 138 | if (link !== null) { |
| 139 | location = link.href; |
| 140 | } |
| 141 | else { |
| 142 | location = window.location.toString().replace(/#.*/, '').replace(/(\?|&)l=[0-9]+/g, ''); |
| 143 | } |
| 144 | |
| 145 | var delimiter = (location.indexOf('?') == -1) ? '?' : '&'; |
| 146 | window.location = location + delimiter + 'l=' + elData(listItem, 'language-id') + window.location.hash; |
| 147 | }; |
| 148 | |
| 149 | LanguageChooser.init('pageLanguageContainer', 'pageLanguageID', {@$__wcf->getLanguage()->languageID}, languages, callback); |
| 150 | EventHandler.add('com.woltlab.wcf.UserMenuMobile', 'more', function(data) { |
| 151 | if (data.identifier === 'com.woltlab.wcf.language') { |
| 152 | callback(data.parent); |
| 153 | } |
| 154 | }); |
| 155 | }); |
| 156 | </script> |
| 157 | </li> |
| 158 | {/if} |
| 159 | {if !$__disableLoginLink|isset} |
| 160 | <!-- login box --> |
| 161 | <li id="userLogin"> |
| 162 | <a class="loginLink" href="{link controller='Login'}{/link}">{lang}wcf.user.loginOrRegister{/lang}</a> |
| 163 | <div id="loginForm" class="loginForm" style="display: none"> |
| 164 | <form method="post" action="{link controller='Login'}{/link}"> |
| 165 | <section class="section loginFormLogin"> |
| 166 | <h2 class="sectionTitle">{lang}wcf.user.login.login{/lang}</h2> |
| 167 | |
| 168 | <dl> |
| 169 | <dt><label for="username">{lang}wcf.user.usernameOrEmail{/lang}</label></dt> |
| 170 | <dd> |
| 171 | <input type="text" id="username" name="username" value="" required class="long" autocomplete="username"> |
| 172 | </dd> |
| 173 | </dl> |
| 174 | |
| 175 | <dl> |
| 176 | <dt><label for="password">{lang}wcf.user.password{/lang}</label></dt> |
| 177 | <dd> |
| 178 | <input type="password" id="password" name="password" value="" class="long" autocomplete="current-password"> |
| 179 | <small><a href="{link controller='LostPassword'}{/link}">{lang}wcf.user.lostPassword{/lang}</a></small> |
| 180 | </dd> |
| 181 | </dl> |
| 182 | |
| 183 | {event name='fields'} |
| 184 | |
| 185 | <div class="userLoginButtons"> |
| 186 | <input type="submit" value="{lang}wcf.global.button.submit{/lang}" accesskey="s"> |
| 187 | <input type="hidden" name="url" value="{$__wcf->session->requestURI}"> |
| 188 | {csrfToken} |
| 189 | </div> |
| 190 | </section> |
| 191 | |
| 192 | {if !REGISTER_DISABLED} |
| 193 | <section class="section loginFormRegister"> |
| 194 | <h2 class="sectionTitle">{lang}wcf.user.login.register{/lang}</h2> |
| 195 | |
| 196 | <p>{lang}wcf.user.login.register.teaser{/lang}</p> |
| 197 | |
| 198 | <div class="userLoginButtons"> |
| 199 | <a href="{link controller='Register'}{/link}" class="button loginFormRegisterButton">{lang}wcf.user.login.register.registerNow{/lang}</a> |
| 200 | </div> |
| 201 | </section> |
| 202 | {/if} |
| 203 | |
| 204 | {hascontent} |
| 205 | <section class="section loginFormThirdPartyLogin"> |
| 206 | <h2 class="sectionTitle">{lang}wcf.user.login.3rdParty{/lang}</h2> |
| 207 | |
| 208 | <dl> |
| 209 | <dt></dt> |
| 210 | <dd> |
| 211 | <ul class="buttonList"> |
| 212 | {content} |
| 213 | {if FACEBOOK_PUBLIC_KEY !== '' && FACEBOOK_PRIVATE_KEY !== ''} |
| 214 | <li id="facebookAuth" class="thirdPartyLogin"> |
| 215 | <a href="{link controller='FacebookAuth'}{/link}" class="button thirdPartyLoginButton facebookLoginButton"><span class="icon icon24 fa-facebook-official"></span> <span>{lang}wcf.user.3rdparty.facebook.login{/lang}</span></a> |
| 216 | </li> |
| 217 | {/if} |
| 218 | |
| 219 | {if GOOGLE_PUBLIC_KEY !== '' && GOOGLE_PRIVATE_KEY !== ''} |
| 220 | <li id="googleAuth" class="thirdPartyLogin"> |
| 221 | <a href="{link controller='GoogleAuth'}{/link}" class="button thirdPartyLoginButton googleLoginButton"><span class="icon icon24 fa-google"></span> <span>{lang}wcf.user.3rdparty.google.login{/lang}</span></a> |
| 222 | </li> |
| 223 | {/if} |
| 224 | |
| 225 | {if TWITTER_PUBLIC_KEY !== '' && TWITTER_PRIVATE_KEY !== ''} |
| 226 | <li id="twitterAuth" class="thirdPartyLogin"> |
| 227 | <a href="{link controller='TwitterAuth'}{/link}" class="button thirdPartyLoginButton twitterLoginButton"><span class="icon icon24 fa-twitter"></span> <span>{lang}wcf.user.3rdparty.twitter.login{/lang}</span></a> |
| 228 | </li> |
| 229 | {/if} |
| 230 | |
| 231 | {if GITHUB_PUBLIC_KEY !== '' && GITHUB_PRIVATE_KEY !== ''} |
| 232 | <li id="githubAuth" class="thirdPartyLogin"> |
| 233 | <a href="{link controller='GithubAuth'}{/link}" class="button thirdPartyLoginButton githubLoginButton"><span class="icon icon24 fa-github"></span> <span>{lang}wcf.user.3rdparty.github.login{/lang}</span></a> |
| 234 | </li> |
| 235 | {/if} |
| 236 | |
| 237 | {event name='3rdpartyButtons'} |
| 238 | {/content} |
| 239 | </ul> |
| 240 | </dd> |
| 241 | </dl> |
| 242 | </section> |
| 243 | {/hascontent} |
| 244 | </form> |
| 245 | </div> |
| 246 | |
| 247 | <script data-relocate="true"> |
| 248 | $(function() { |
| 249 | WCF.Language.addObject({ |
| 250 | 'wcf.user.button.login': '{jslang}wcf.user.button.login{/jslang}', |
| 251 | 'wcf.user.button.register': '{jslang}wcf.user.button.register{/jslang}', |
| 252 | 'wcf.user.login': '{jslang}wcf.user.login{/jslang}' |
| 253 | }); |
| 254 | WCF.User.QuickLogin.init(); |
| 255 | }); |
| 256 | </script> |
| 257 | </li> |
| 258 | {/if} |
| 259 | {/if} |
| 260 | |
| 261 | {if !$__hideUserMenu|isset} |
| 262 | {if $__wcf->user->userID && $__wcf->session->getPermission('mod.general.canUseModeration')} |
| 263 | <li id="outstandingModeration" data-count="{#$__wcf->getModerationQueueManager()->getUnreadModerationCount()}"> |
| 264 | <a |
| 265 | class="jsTooltip" |
| 266 | href="{link controller='ModerationList'}{/link}" |
| 267 | title="{lang}wcf.moderation.moderation{/lang}" |
| 268 | role="button" |
| 269 | tabindex="0" |
| 270 | aria-haspopup="true" |
| 271 | aria-expanded="false" |
| 272 | > |
| 273 | <span class="icon icon32 fa-exclamation-triangle"></span> |
| 274 | <span>{lang}wcf.moderation.moderation{/lang}</span> |
| 275 | {if $__wcf->getModerationQueueManager()->getUnreadModerationCount()}<span class="badge badgeUpdate">{#$__wcf->getModerationQueueManager()->getUnreadModerationCount()}</span>{/if} |
| 276 | </a> |
| 277 | {if !OFFLINE || $__wcf->session->getPermission('admin.general.canViewPageDuringOfflineMode')} |
| 278 | <script data-relocate="true"> |
| 279 | require(["WoltLabSuite/Core/Ui/User/Menu/Data/ModerationQueue"], ({ setup }) => { |
| 280 | setup({ |
| 281 | deletedContent: '{jslang}wcf.moderation.showDeletedContent{/jslang}', |
| 282 | deletedContentLink: '{link controller='DeletedContentList' encode=false}{/link}', |
| 283 | noItems: '{jslang}wcf.moderation.noMoreItems{/jslang}', |
| 284 | showAllLink: '{link controller='ModerationList' encode=false}{/link}', |
| 285 | showAllTitle: '{jslang}wcf.moderation.showAll{/jslang}', |
| 286 | title: '{jslang}wcf.moderation.moderation{/jslang}' |
| 287 | }); |
| 288 | }); |
| 289 | </script> |
| 290 | {/if} |
| 291 | </li> |
| 292 | {/if} |
| 293 | |
| 294 | {event name='menuItems'} |
| 295 | {/if} |
| 296 | |
| 297 | <!-- page search --> |
| 298 | {if !SEARCH_USE_CAPTCHA || $__wcf->user->userID} |
| 299 | <li class="jsOnly"> |
| 300 | <a href="#" id="userPanelSearchButton" class="jsTooltip" title="{lang}wcf.global.search{/lang}"><span class="icon icon32 fa-search"></span> <span>{lang}wcf.global.search{/lang}</span></a> |
| 301 | </li> |
| 302 | {else} |
| 303 | <li> |
| 304 | <a href="{link controller='Search'}{/link}" class="jsTooltip" title="{lang}wcf.global.search{/lang}"><span class="icon icon32 fa-search"></span> <span>{lang}wcf.global.search{/lang}</span></a> |
| 305 | <span id="userPanelSearchButton" style="display: none"></span> |
| 306 | </li> |
| 307 | {/if} |
| 308 | </ul> |
| 309 | </nav> |