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.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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">
  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. <mask id="hole">
  71. <rect width="100%" height="100%" fill="white"/>
  72. <circle r="4.5" cx="21" cy="3" fill="black"/>
  73. </mask>
  74. </defs>
  75. <image x="2" y="0" width="20" height="20" preserveAspectRatio="xMinYMin meet" xlink:href="<?php print_unescaped($entry['icon'] . '?v=' . $_['versionHash']); ?>" style="<?php if ($entry['unread'] !== 0) { ?>mask: url("#hole");<?php } ?>" class="app-icon"></image>
  76. <circle class="app-icon-notification" r="3" cx="21" cy="3" fill="red"/>
  77. </svg>
  78. <div class="unread-counter" aria-hidden="true"><?php p($entry['unread']); ?></div>
  79. <span>
  80. <?php p($entry['name']); ?>
  81. </span>
  82. </a>
  83. </li>
  84. <?php endforeach; ?>
  85. <li id="more-apps" class="menutoggle"
  86. aria-haspopup="true" aria-controls="navigation" aria-expanded="false">
  87. <a href="#" aria-label="<?php p($l->t('More apps')); ?>">
  88. <div class="icon-more-white"></div>
  89. <span><?php p($l->t('More')); ?></span>
  90. </a>
  91. </li>
  92. </ul>
  93. <nav role="navigation">
  94. <div id="navigation" style="display: none;" aria-label="<?php p($l->t('More apps menu')); ?>">
  95. <div id="apps">
  96. <ul>
  97. <?php foreach ($_['navigation'] as $entry): ?>
  98. <li data-id="<?php p($entry['id']); ?>">
  99. <a href="<?php print_unescaped($entry['href']); ?>"
  100. <?php if (isset($entry['target']) && $entry['target']): ?> target="_blank" rel="noreferrer noopener"<?php endif; ?>
  101. <?php if ($entry['active']): ?> class="active"<?php endif; ?>
  102. aria-label="<?php p($entry['name']); ?>">
  103. <svg width="20" height="20" viewBox="0 0 20 20" alt=""<?php if ($entry['unread'] !== 0) { ?> class="has-unread"<?php } ?>>
  104. <defs>
  105. <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>
  106. <mask id="hole">
  107. <rect width="100%" height="100%" fill="white"/>
  108. <circle r="4.5" cx="17" cy="3" fill="black"/>
  109. </mask>
  110. </defs>
  111. <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>
  112. <circle class="app-icon-notification" r="3" cx="17" cy="3" fill="red"/>
  113. </svg>
  114. <div class="unread-counter" aria-hidden="true"><?php p($entry['unread']); ?></div>
  115. <span class="app-title"><?php p($entry['name']); ?></span>
  116. </a>
  117. </li>
  118. <?php endforeach; ?>
  119. </ul>
  120. </div>
  121. </div>
  122. </nav>
  123. </div>
  124. <div class="header-right">
  125. <div id="notifications"></div>
  126. <div id="unified-search"></div>
  127. <div id="contactsmenu">
  128. <div class="icon-contacts menutoggle" tabindex="0" role="button"
  129. aria-haspopup="true" aria-controls="contactsmenu-menu" aria-expanded="false">
  130. <span class="hidden-visually"><?php p($l->t('Contacts'));?></span>
  131. </div>
  132. <div id="contactsmenu-menu" class="menu"
  133. aria-label="<?php p($l->t('Contacts menu'));?>"></div>
  134. </div>
  135. <div id="settings">
  136. <div id="expand" tabindex="0" role="button" class="menutoggle"
  137. aria-label="<?php p($l->t('Settings'));?>"
  138. aria-haspopup="true" aria-controls="expanddiv" aria-expanded="false">
  139. <div id="avatardiv-menu" class="avatardiv<?php if ($_['userAvatarSet']) {
  140. print_unescaped(' avatardiv-shown');
  141. } else {
  142. print_unescaped('" style="display: none');
  143. } ?>"
  144. data-user="<?php p($_['user_uid']); ?>"
  145. data-displayname="<?php p($_['user_displayname']); ?>"
  146. <?php
  147. if ($_['userAvatarSet']) {
  148. $avatar32 = $getUserAvatar(32); ?> data-avatar="<?php p($avatar32); ?>"
  149. <?php
  150. } ?>>
  151. <?php
  152. if ($_['userAvatarSet']) {?>
  153. <img alt="" width="32" height="32"
  154. src="<?php p($avatar32);?>"
  155. srcset="<?php p($getUserAvatar(64));?> 2x, <?php p($getUserAvatar(128));?> 4x"
  156. >
  157. <?php } ?>
  158. </div>
  159. </div>
  160. <nav class="settings-menu" id="expanddiv" style="display:none;"
  161. aria-label="<?php p($l->t('Settings menu'));?>">
  162. <ul>
  163. <?php foreach ($_['settingsnavigation'] as $entry):?>
  164. <li data-id="<?php p($entry['id']); ?>">
  165. <a href="<?php print_unescaped($entry['href']); ?>"
  166. <?php if ($entry["active"]): ?> class="active"<?php endif; ?>>
  167. <img alt="" src="<?php print_unescaped($entry['icon'] . '?v=' . $_['versionHash']); ?>">
  168. <?php p($entry['name']) ?>
  169. </a>
  170. </li>
  171. <?php endforeach; ?>
  172. </ul>
  173. </nav>
  174. </div>
  175. </div>
  176. </header>
  177. <div id="sudo-login-background" class="hidden"></div>
  178. <form id="sudo-login-form" class="hidden" method="POST">
  179. <label>
  180. <?php p($l->t('This action requires you to confirm your password')); ?><br/>
  181. <input type="password" class="question" autocomplete="new-password" name="question" value=" <?php /* Hack against browsers ignoring autocomplete="off" */ ?>"
  182. placeholder="<?php p($l->t('Confirm your password')); ?>" />
  183. </label>
  184. <input class="confirm" value="<?php p($l->t('Confirm')); ?>" type="submit">
  185. </form>
  186. <div id="content" class="app-<?php p($_['appid']) ?>" role="main">
  187. <?php print_unescaped($_['content']); ?>
  188. </div>
  189. <div id="profiler-toolbar"></div>
  190. </body>
  191. </html>