layout.user.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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($_['pageTitle'])?$_['pageTitle'].' - ':'');
  20. p(!empty($_['application'])?$_['application'].' - ':'');
  21. p($theme->getTitle());
  22. ?>
  23. </title>
  24. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  25. <?php if ($theme->getiTunesAppId() !== '') { ?>
  26. <meta name="apple-itunes-app" content="app-id=<?php p($theme->getiTunesAppId()); ?>">
  27. <?php } ?>
  28. <meta name="apple-mobile-web-app-capable" content="yes">
  29. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  30. <meta name="apple-mobile-web-app-title" content="<?php p((!empty($_['application']) && $_['appid'] != 'files')? $_['application']:$theme->getTitle()); ?>">
  31. <meta name="mobile-web-app-capable" content="yes">
  32. <meta name="theme-color" content="<?php p($theme->getColorPrimary()); ?>">
  33. <link rel="icon" href="<?php print_unescaped(image_path($_['appid'], 'favicon.ico')); /* IE11+ supports png */ ?>">
  34. <link rel="apple-touch-icon" href="<?php print_unescaped(image_path($_['appid'], 'favicon-touch.png')); ?>">
  35. <link rel="apple-touch-icon-precomposed" href="<?php print_unescaped(image_path($_['appid'], 'favicon-touch.png')); ?>">
  36. <link rel="mask-icon" sizes="any" href="<?php print_unescaped(image_path($_['appid'], 'favicon-mask.svg')); ?>" color="<?php p($theme->getColorPrimary()); ?>">
  37. <link rel="manifest" href="<?php print_unescaped(image_path($_['appid'], 'manifest.json')); ?>">
  38. <?php emit_css_loading_tags($_); ?>
  39. <?php emit_script_loading_tags($_); ?>
  40. <?php print_unescaped($_['headers']); ?>
  41. </head>
  42. <body id="<?php p($_['bodyid']);?>" <?php foreach ($_['enabledThemes'] as $themeId) {
  43. p("data-theme-$themeId ");
  44. }?> data-themes=<?php p(join(',', $_['enabledThemes'])) ?>>
  45. <?php include 'layout.noscript.warning.php'; ?>
  46. <?php foreach ($_['initialStates'] as $app => $initialState) { ?>
  47. <input type="hidden" id="initial-state-<?php p($app); ?>" value="<?php p(base64_encode($initialState)); ?>">
  48. <?php }?>
  49. <div id="skip-actions">
  50. <?php if ($_['id-app-content'] !== null) { ?><a href="<?php p($_['id-app-content']); ?>" class="button primary skip-navigation skip-content"><?php p($l->t('Skip to main content')); ?></a><?php } ?>
  51. <?php if ($_['id-app-navigation'] !== null) { ?><a href="<?php p($_['id-app-navigation']); ?>" class="button primary skip-navigation"><?php p($l->t('Skip to navigation of app')); ?></a><?php } ?>
  52. </div>
  53. <header role="banner" id="header">
  54. <div class="header-left">
  55. <a href="<?php print_unescaped($_['logoUrl'] ?: link_to('', 'index.php')); ?>"
  56. id="nextcloud">
  57. <div class="logo logo-icon">
  58. <h1 class="hidden-visually">
  59. <?php p($l->t('%s\'s homepage', [$theme->getName()])); ?>
  60. </h1>
  61. </div>
  62. </a>
  63. <nav id="header-left__appmenu"></nav>
  64. </div>
  65. <div class="header-right">
  66. <div id="unified-search"></div>
  67. <div id="notifications"></div>
  68. <div id="contactsmenu">
  69. <div class="menutoggle" tabindex="0" role="button"
  70. aria-haspopup="true" aria-controls="contactsmenu-menu" aria-expanded="false">
  71. <span class="hidden-visually"><?php p($l->t('Contacts'));?></span>
  72. </div>
  73. <div id="contactsmenu-menu" class="menu"
  74. aria-label="<?php p($l->t('Contacts menu'));?>"></div>
  75. </div>
  76. <div id="settings">
  77. <div id="expand" tabindex="0" role="button" class="menutoggle"
  78. aria-label="<?php p($l->t('Open settings menu'));?>"
  79. aria-haspopup="true" aria-controls="expanddiv" aria-expanded="false">
  80. <div id="avatardiv-menu" class="avatardiv<?php if ($_['userAvatarSet']) {
  81. print_unescaped(' avatardiv-shown');
  82. } else {
  83. print_unescaped('" style="display: none');
  84. } ?>"
  85. data-user="<?php p($_['user_uid']); ?>"
  86. data-displayname="<?php p($_['user_displayname']); ?>"
  87. <?php
  88. if ($_['userAvatarSet']) {
  89. $avatar32 = $getUserAvatar(32); ?> data-avatar="<?php p($avatar32); ?>"
  90. <?php
  91. } ?>>
  92. <?php
  93. if ($_['userAvatarSet']) {?>
  94. <img alt="" width="32" height="32"
  95. src="<?php p($avatar32);?>"
  96. srcset="<?php p($getUserAvatar(64));?> 2x, <?php p($getUserAvatar(128));?> 4x"
  97. >
  98. <?php } ?>
  99. </div>
  100. </div>
  101. <nav class="settings-menu" id="expanddiv" style="display:none;">
  102. <ul>
  103. <?php foreach ($_['settingsnavigation'] as $entry):?>
  104. <li data-id="<?php p($entry['id']); ?>">
  105. <a href="<?php print_unescaped($entry['href'] !== '' ? $entry['href'] : '#'); ?>"
  106. <?php if ($entry["active"]): ?> class="active"<?php endif; ?>>
  107. <img alt="" src="<?php print_unescaped($entry['icon'] . '?v=' . $_['versionHash']); ?>">
  108. <?php p($entry['name']) ?>
  109. </a>
  110. </li>
  111. <?php endforeach; ?>
  112. </ul>
  113. </nav>
  114. </div>
  115. </div>
  116. </header>
  117. <div id="sudo-login-background" class="hidden"></div>
  118. <form id="sudo-login-form" class="hidden" method="POST">
  119. <label>
  120. <?php p($l->t('This action requires you to confirm your password')); ?><br/>
  121. <input type="password" class="question" autocomplete="new-password" name="question" value=" <?php /* Hack against browsers ignoring autocomplete="off" */ ?>"
  122. placeholder="<?php p($l->t('Confirm your password')); ?>" />
  123. </label>
  124. <input class="confirm" value="<?php p($l->t('Confirm')); ?>" type="submit">
  125. </form>
  126. <div id="content" class="app-<?php p($_['appid']) ?>" role="main">
  127. <?php print_unescaped($_['content']); ?>
  128. </div>
  129. <div id="profiler-toolbar"></div>
  130. </body>
  131. </html>