layout.user.php 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2011-2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. /**
  8. * @var \OC_Defaults $theme
  9. * @var array $_
  10. */
  11. $getUserAvatar = static function (int $size) use ($_): string {
  12. return \OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', [
  13. 'userId' => $_['user_uid'],
  14. 'size' => $size,
  15. 'v' => $_['userAvatarVersion']
  16. ]);
  17. }
  18. ?><!DOCTYPE html>
  19. <html class="ng-csp" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" data-locale="<?php p($_['locale']); ?>" translate="no" >
  20. <head data-user="<?php p($_['user_uid']); ?>" data-user-displayname="<?php p($_['user_displayname']); ?>" data-requesttoken="<?php p($_['requesttoken']); ?>">
  21. <meta charset="utf-8">
  22. <title>
  23. <?php
  24. p(!empty($_['pageTitle']) && $_['pageTitle'] !== $_['application'] ? $_['pageTitle'] . ' - ' : '');
  25. p(!empty($_['application']) ? $_['application'] . ' - ' : '');
  26. p($theme->getTitle());
  27. ?>
  28. </title>
  29. <meta name="csp-nonce" nonce="<?php p($_['cspNonce']); /* Do not pass into "content" to prevent exfiltration */ ?>">
  30. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0<?php if (isset($_['viewport_maximum_scale'])) {
  31. p(', maximum-scale=' . $_['viewport_maximum_scale']);
  32. } ?>">
  33. <?php if ($theme->getiTunesAppId() !== '') { ?>
  34. <meta name="apple-itunes-app" content="app-id=<?php p($theme->getiTunesAppId()); ?>">
  35. <?php } ?>
  36. <meta name="apple-mobile-web-app-capable" content="yes">
  37. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  38. <meta name="apple-mobile-web-app-title" content="<?php p((!empty($_['application']) && $_['appid'] != 'files')? $_['application']:$theme->getTitle()); ?>">
  39. <meta name="mobile-web-app-capable" content="yes">
  40. <meta name="theme-color" content="<?php p($theme->getColorPrimary()); ?>">
  41. <link rel="icon" href="<?php print_unescaped(image_path($_['appid'], 'favicon.ico')); /* IE11+ supports png */ ?>">
  42. <link rel="apple-touch-icon" href="<?php print_unescaped(image_path($_['appid'], 'favicon-touch.png')); ?>">
  43. <link rel="apple-touch-icon-precomposed" href="<?php print_unescaped(image_path($_['appid'], 'favicon-touch.png')); ?>">
  44. <link rel="mask-icon" sizes="any" href="<?php print_unescaped(image_path($_['appid'], 'favicon-mask.svg')); ?>" color="<?php p($theme->getColorPrimary()); ?>">
  45. <link rel="manifest" href="<?php print_unescaped(image_path($_['appid'], 'manifest.json')); ?>" crossorigin="use-credentials">
  46. <?php emit_css_loading_tags($_); ?>
  47. <?php emit_script_loading_tags($_); ?>
  48. <?php print_unescaped($_['headers']); ?>
  49. </head>
  50. <body dir="<?php p($_['direction']); ?>" id="<?php p($_['bodyid']);?>" <?php foreach ($_['enabledThemes'] as $themeId) {
  51. p("data-theme-$themeId ");
  52. }?> data-themes=<?php p(join(',', $_['enabledThemes'])) ?>>
  53. <?php include 'layout.noscript.warning.php'; ?>
  54. <?php include 'layout.initial-state.php'; ?>
  55. <div id="skip-actions">
  56. <?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 } ?>
  57. <?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 } ?>
  58. </div>
  59. <header id="header">
  60. <div class="header-start">
  61. <a href="<?php print_unescaped($_['logoUrl'] ?: link_to('', 'index.php')); ?>"
  62. aria-label="<?php p($l->t('Go to %s', [$_['logoUrl'] ?: $_['defaultAppName']])); ?>"
  63. id="nextcloud">
  64. <div class="logo logo-icon"></div>
  65. </a>
  66. <nav id="header-start__appmenu"></nav>
  67. </div>
  68. <div class="header-end">
  69. <div id="unified-search"></div>
  70. <div id="notifications"></div>
  71. <div id="contactsmenu"></div>
  72. <div id="user-menu"></div>
  73. </div>
  74. </header>
  75. <main id="content" class="app-<?php p($_['appid']) ?>">
  76. <h1 class="hidden-visually" id="page-heading-level-1">
  77. <?php p((!empty($_['application']) && !empty($_['pageTitle']) && $_['application'] != $_['pageTitle'])
  78. ? $_['application'] . ': ' . $_['pageTitle']
  79. : (!empty($_['pageTitle']) ? $_['pageTitle'] : $theme->getName())
  80. ); ?>
  81. </h1>
  82. <?php print_unescaped($_['content']); ?>
  83. </main>
  84. <div id="profiler-toolbar"></div>
  85. </body>
  86. </html>