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 5.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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']); ?>" translate="no" >
  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"></div>
  58. </a>
  59. <nav id="header-left__appmenu"></nav>
  60. </div>
  61. <div class="header-right">
  62. <div id="unified-search"></div>
  63. <div id="notifications"></div>
  64. <div id="contactsmenu"></div>
  65. <div id="settings">
  66. <div id="expand" tabindex="0" role="button" class="menutoggle"
  67. aria-label="<?php p($l->t('Open settings menu'));?>"
  68. aria-haspopup="true" aria-controls="expanddiv" aria-expanded="false">
  69. <div id="avatardiv-menu" class="avatardiv<?php if ($_['userAvatarSet']) {
  70. print_unescaped(' avatardiv-shown');
  71. } else {
  72. print_unescaped('" style="display: none');
  73. } ?>"
  74. data-user="<?php p($_['user_uid']); ?>"
  75. data-displayname="<?php p($_['user_displayname']); ?>"
  76. <?php
  77. if ($_['userAvatarSet']) {
  78. $avatar32 = $getUserAvatar(32); ?> data-avatar="<?php p($avatar32); ?>"
  79. <?php
  80. } ?>>
  81. <?php
  82. if ($_['userAvatarSet']) {?>
  83. <img alt="" width="32" height="32"
  84. src="<?php p($avatar32);?>"
  85. srcset="<?php p($getUserAvatar(64));?> 2x, <?php p($getUserAvatar(128));?> 4x"
  86. >
  87. <?php } ?>
  88. </div>
  89. </div>
  90. <nav class="settings-menu" id="expanddiv" style="display:none;">
  91. <ul>
  92. <?php foreach ($_['settingsnavigation'] as $entry):?>
  93. <li data-id="<?php p($entry['id']); ?>">
  94. <a href="<?php print_unescaped($entry['href'] !== '' ? $entry['href'] : '#'); ?>"
  95. <?php if ($entry["active"]): ?> class="active"<?php endif; ?>>
  96. <img alt="" src="<?php print_unescaped($entry['icon'] . '?v=' . $_['versionHash']); ?>">
  97. <?php p($entry['name']) ?>
  98. </a>
  99. </li>
  100. <?php endforeach; ?>
  101. </ul>
  102. </nav>
  103. </div>
  104. </div>
  105. </header>
  106. <div id="sudo-login-background" class="hidden"></div>
  107. <form id="sudo-login-form" class="hidden" method="POST">
  108. <label>
  109. <?php p($l->t('This action requires you to confirm your password')); ?><br/>
  110. <input type="password" class="question" autocomplete="new-password" name="question" value=" <?php /* Hack against browsers ignoring autocomplete="off" */ ?>"
  111. placeholder="<?php p($l->t('Confirm your password')); ?>" />
  112. </label>
  113. <input class="confirm" value="<?php p($l->t('Confirm')); ?>" type="submit">
  114. </form>
  115. <main id="content" class="app-<?php p($_['appid']) ?>">
  116. <h1 class="hidden-visually">
  117. <?php p($l->t('%s\'s homepage', [$theme->getName()])); ?>
  118. </h1>
  119. <?php print_unescaped($_['content']); ?>
  120. </main>
  121. <div id="profiler-toolbar"></div>
  122. </body>
  123. </html>