You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

layout.user.php 9.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <?php
  2. /**
  3. * @var \OC_Defaults $theme
  4. * @var array $_
  5. */
  6. $getUserAvatar = static function (int $size) use ($_): string {
  7. return \OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', [
  8. 'userId' => $_['user_uid'],
  9. 'size' => $size,
  10. 'v' => $_['userAvatarVersion']
  11. ]);
  12. }
  13. ?><!DOCTYPE html>
  14. <html class="ng-csp" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" data-locale="<?php p($_['locale']); ?>" >
  15. <head data-user="<?php p($_['user_uid']); ?>" data-user-displayname="<?php p($_['user_displayname']); ?>" data-requesttoken="<?php p($_['requesttoken']); ?>">
  16. <meta charset="utf-8">
  17. <title>
  18. <?php
  19. p(!empty($_['application'])?$_['application'].' - ':'');
  20. p($theme->getTitle());
  21. ?>
  22. </title>
  23. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
  24. <?php if ($theme->getiTunesAppId() !== '') { ?>
  25. <meta name="apple-itunes-app" content="app-id=<?php p($theme->getiTunesAppId()); ?>">
  26. <?php } ?>
  27. <meta name="apple-mobile-web-app-capable" content="yes">
  28. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  29. <meta name="apple-mobile-web-app-title" content="<?php p((!empty($_['application']) && $_['appid'] != 'files')? $_['application']:$theme->getTitle()); ?>">
  30. <meta name="mobile-web-app-capable" content="yes">
  31. <meta name="theme-color" content="<?php p($theme->getColorPrimary()); ?>">
  32. <link rel="icon" href="<?php print_unescaped(image_path($_['appid'], 'favicon.ico')); /* IE11+ supports png */ ?>">
  33. <link rel="apple-touch-icon" href="<?php print_unescaped(image_path($_['appid'], 'favicon-touch.png')); ?>">
  34. <link rel="apple-touch-icon-precomposed" href="<?php print_unescaped(image_path($_['appid'], 'favicon-touch.png')); ?>">
  35. <link rel="mask-icon" sizes="any" href="<?php print_unescaped(image_path($_['appid'], 'favicon-mask.svg')); ?>" color="<?php p($theme->getColorPrimary()); ?>">
  36. <link rel="manifest" href="<?php print_unescaped(image_path($_['appid'], 'manifest.json')); ?>">
  37. <?php emit_css_loading_tags($_); ?>
  38. <?php emit_script_loading_tags($_); ?>
  39. <?php print_unescaped($_['headers']); ?>
  40. </head>
  41. <body id="<?php p($_['bodyid']);?>">
  42. <?php include 'layout.noscript.warning.php'; ?>
  43. <?php foreach ($_['initialStates'] as $app => $initialState) { ?>
  44. <input type="hidden" id="initial-state-<?php p($app); ?>" value="<?php p(base64_encode($initialState)); ?>">
  45. <?php }?>
  46. <a href="#app-content" class="button primary skip-navigation skip-content"><?php p($l->t('Skip to main content')); ?></a>
  47. <a href="#app-navigation" class="button primary skip-navigation"><?php p($l->t('Skip to navigation of app')); ?></a>
  48. <div id="notification-container">
  49. <div id="notification"></div>
  50. </div>
  51. <header role="banner" id="header">
  52. <div class="header-left">
  53. <a href="<?php print_unescaped($_['logoUrl'] ?: link_to('', 'index.php')); ?>"
  54. id="nextcloud">
  55. <div class="logo logo-icon">
  56. <h1 class="hidden-visually">
  57. <?php p($theme->getName()); ?> <?php p(!empty($_['application'])?$_['application']: $l->t('Apps')); ?>
  58. </h1>
  59. </div>
  60. </a>
  61. <ul id="appmenu" <?php if ($_['themingInvertMenu']) { ?>class="inverted"<?php } ?>>
  62. <?php foreach ($_['navigation'] as $entry): ?>
  63. <li data-id="<?php p($entry['id']); ?>" class="hidden" tabindex="-1">
  64. <a href="<?php print_unescaped($entry['href']); ?>"
  65. <?php if (isset($entry['target']) && $entry['target']): ?> target="_blank" rel="noreferrer noopener"<?php endif; ?>
  66. <?php if ($entry['active']): ?> class="active"<?php endif; ?>
  67. aria-label="<?php p($entry['name']); ?>">
  68. <svg width="24" height="20" viewBox="0 0 24 20" alt=""<?php if ($entry['unread'] !== 0) { ?> class="has-unread"<?php } ?>>
  69. <defs>
  70. <?php if ($_['themingInvertMenu']) { ?><filter id="invertMenuMain-<?php p($entry['id']); ?>"><feColorMatrix in="SourceGraphic" type="matrix" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" /></filter><?php } ?>
  71. <mask id="hole">
  72. <rect width="100%" height="100%" fill="white"/>
  73. <circle r="4.5" cx="21" cy="3" fill="black"/>
  74. </mask>
  75. </defs>
  76. <image x="2" y="0" width="20" height="20" preserveAspectRatio="xMinYMin meet"<?php if ($_['themingInvertMenu']) { ?> filter="url(#invertMenuMain-<?php p($entry['id']); ?>)"<?php } ?> xlink:href="<?php print_unescaped($entry['icon'] . '?v=' . $_['versionHash']); ?>" style="<?php if ($entry['unread'] !== 0) { ?>mask: url("#hole");<?php } ?>" class="app-icon"></image>
  77. <circle class="app-icon-notification" r="3" cx="21" cy="3" fill="red"/>
  78. </svg>
  79. <div class="unread-counter" aria-hidden="true"><?php p($entry['unread']); ?></div>
  80. <span>
  81. <?php p($entry['name']); ?>
  82. </span>
  83. </a>
  84. </li>
  85. <?php endforeach; ?>
  86. <li id="more-apps" class="menutoggle"
  87. aria-haspopup="true" aria-controls="navigation" aria-expanded="false">
  88. <a href="#" aria-label="<?php p($l->t('More apps')); ?>">
  89. <div class="icon-more-white"></div>
  90. <span><?php p($l->t('More')); ?></span>
  91. </a>
  92. </li>
  93. </ul>
  94. <nav role="navigation">
  95. <div id="navigation" style="display: none;" aria-label="<?php p($l->t('More apps menu')); ?>">
  96. <div id="apps">
  97. <ul>
  98. <?php foreach ($_['navigation'] as $entry): ?>
  99. <li data-id="<?php p($entry['id']); ?>">
  100. <a href="<?php print_unescaped($entry['href']); ?>"
  101. <?php if (isset($entry['target']) && $entry['target']): ?> target="_blank" rel="noreferrer noopener"<?php endif; ?>
  102. <?php if ($entry['active']): ?> class="active"<?php endif; ?>
  103. aria-label="<?php p($entry['name']); ?>">
  104. <svg width="20" height="20" viewBox="0 0 20 20" alt=""<?php if ($entry['unread'] !== 0) { ?> class="has-unread"<?php } ?>>
  105. <defs>
  106. <filter id="invertMenuMore-<?php p($entry['id']); ?>"><feColorMatrix in="SourceGraphic" type="matrix" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"></feColorMatrix></filter>
  107. <mask id="hole">
  108. <rect width="100%" height="100%" fill="white"/>
  109. <circle r="4.5" cx="17" cy="3" fill="black"/>
  110. </mask>
  111. </defs>
  112. <image x="0" y="0" width="16" height="16" preserveAspectRatio="xMinYMin meet" filter="url(#invertMenuMore-<?php p($entry['id']); ?>)" xlink:href="<?php print_unescaped($entry['icon'] . '?v=' . $_['versionHash']); ?>" style="<?php if ($entry['unread'] !== 0) { ?>mask: url("#hole");<?php } ?>" class="app-icon"></image>
  113. <circle class="app-icon-notification" r="3" cx="17" cy="3" fill="red"/>
  114. </svg>
  115. <div class="unread-counter" aria-hidden="true"><?php p($entry['unread']); ?></div>
  116. <span class="app-title"><?php p($entry['name']); ?></span>
  117. </a>
  118. </li>
  119. <?php endforeach; ?>
  120. </ul>
  121. </div>
  122. </div>
  123. </nav>
  124. </div>
  125. <div class="header-right">
  126. <div id="notifications"></div>
  127. <div id="unified-search"></div>
  128. <div id="contactsmenu">
  129. <div class="icon-contacts menutoggle" tabindex="0" role="button"
  130. aria-haspopup="true" aria-controls="contactsmenu-menu" aria-expanded="false">
  131. <span class="hidden-visually"><?php p($l->t('Contacts'));?></span>
  132. </div>
  133. <div id="contactsmenu-menu" class="menu"
  134. aria-label="<?php p($l->t('Contacts menu'));?>"></div>
  135. </div>
  136. <div id="settings">
  137. <div id="expand" tabindex="0" role="button" class="menutoggle"
  138. aria-label="<?php p($l->t('Settings'));?>"
  139. aria-haspopup="true" aria-controls="expanddiv" aria-expanded="false">
  140. <div id="avatardiv-menu" class="avatardiv<?php if ($_['userAvatarSet']) {
  141. print_unescaped(' avatardiv-shown');
  142. } else {
  143. print_unescaped('" style="display: none');
  144. } ?>"
  145. data-user="<?php p($_['user_uid']); ?>"
  146. data-displayname="<?php p($_['user_displayname']); ?>"
  147. <?php if ($_['userStatus'] !== false) { ?>
  148. data-userstatus="<?php p($_['userStatus']->getStatus()); ?>"
  149. data-userstatus_message="<?php p($_['userStatus']->getMessage()); ?>"
  150. data-userstatus_icon="<?php p($_['userStatus']->getIcon()); ?>"
  151. <?php }
  152. if ($_['userAvatarSet']) {
  153. $avatar32 = $getUserAvatar(32); ?> data-avatar="<?php p($avatar32); ?>"
  154. <?php
  155. } ?>>
  156. <?php
  157. if ($_['userAvatarSet']) {?>
  158. <img alt="" width="32" height="32"
  159. src="<?php p($avatar32);?>"
  160. srcset="<?php p($getUserAvatar(64));?> 2x, <?php p($getUserAvatar(128));?> 4x"
  161. >
  162. <?php } ?>
  163. </div>
  164. </div>
  165. <nav class="settings-menu" id="expanddiv" style="display:none;"
  166. aria-label="<?php p($l->t('Settings menu'));?>">
  167. <ul>
  168. <?php foreach ($_['settingsnavigation'] as $entry):?>
  169. <li data-id="<?php p($entry['id']); ?>">
  170. <a href="<?php print_unescaped($entry['href']); ?>"
  171. <?php if ($entry["active"]): ?> class="active"<?php endif; ?>>
  172. <img alt="" src="<?php print_unescaped($entry['icon'] . '?v=' . $_['versionHash']); ?>">
  173. <?php p($entry['name']) ?>
  174. </a>
  175. </li>
  176. <?php endforeach; ?>
  177. </ul>
  178. </nav>
  179. </div>
  180. </div>
  181. </header>
  182. <div id="sudo-login-background" class="hidden"></div>
  183. <form id="sudo-login-form" class="hidden" method="POST">
  184. <label>
  185. <?php p($l->t('This action requires you to confirm your password')); ?><br/>
  186. <input type="password" class="question" autocomplete="new-password" name="question" value=" <?php /* Hack against browsers ignoring autocomplete="off" */ ?>"
  187. placeholder="<?php p($l->t('Confirm your password')); ?>" />
  188. </label>
  189. <input class="confirm" value="<?php p($l->t('Confirm')); ?>" type="submit">
  190. </form>
  191. <div id="content" class="app-<?php p($_['appid']) ?>" role="main">
  192. <?php print_unescaped($_['content']); ?>
  193. </div>
  194. </body>
  195. </html>