layout.user.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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" />
  31. <?php if ($theme->getiTunesAppId() !== '') { ?>
  32. <meta name="apple-itunes-app" content="app-id=<?php p($theme->getiTunesAppId()); ?>">
  33. <?php } ?>
  34. <meta name="apple-mobile-web-app-capable" content="yes">
  35. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  36. <meta name="apple-mobile-web-app-title" content="<?php p((!empty($_['application']) && $_['appid'] != 'files')? $_['application']:$theme->getTitle()); ?>">
  37. <meta name="mobile-web-app-capable" content="yes">
  38. <meta name="theme-color" content="<?php p($theme->getColorPrimary()); ?>">
  39. <link rel="icon" href="<?php print_unescaped(image_path($_['appid'], 'favicon.ico')); /* IE11+ supports png */ ?>">
  40. <link rel="apple-touch-icon" href="<?php print_unescaped(image_path($_['appid'], 'favicon-touch.png')); ?>">
  41. <link rel="apple-touch-icon-precomposed" href="<?php print_unescaped(image_path($_['appid'], 'favicon-touch.png')); ?>">
  42. <link rel="mask-icon" sizes="any" href="<?php print_unescaped(image_path($_['appid'], 'favicon-mask.svg')); ?>" color="<?php p($theme->getColorPrimary()); ?>">
  43. <link rel="manifest" href="<?php print_unescaped(image_path($_['appid'], 'manifest.json')); ?>" crossorigin="use-credentials">
  44. <?php emit_css_loading_tags($_); ?>
  45. <?php emit_script_loading_tags($_); ?>
  46. <?php print_unescaped($_['headers']); ?>
  47. </head>
  48. <body id="<?php p($_['bodyid']);?>" <?php foreach ($_['enabledThemes'] as $themeId) {
  49. p("data-theme-$themeId ");
  50. }?> data-themes=<?php p(join(',', $_['enabledThemes'])) ?>>
  51. <?php include 'layout.noscript.warning.php'; ?>
  52. <?php include 'layout.initial-state.php'; ?>
  53. <div id="skip-actions">
  54. <?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 } ?>
  55. <?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 } ?>
  56. </div>
  57. <header id="header">
  58. <div class="header-left">
  59. <a href="<?php print_unescaped($_['logoUrl'] ?: link_to('', 'index.php')); ?>"
  60. aria-label="<?php p($l->t('Go to %s', [$_['logoUrl'] ?: $_['defaultAppName']])); ?>"
  61. id="nextcloud">
  62. <div class="logo logo-icon"></div>
  63. </a>
  64. <nav id="header-left__appmenu"></nav>
  65. </div>
  66. <div class="header-right">
  67. <div id="unified-search"></div>
  68. <div id="notifications"></div>
  69. <div id="contactsmenu"></div>
  70. <div id="user-menu"></div>
  71. </div>
  72. </header>
  73. <main id="content" class="app-<?php p($_['appid']) ?>">
  74. <h1 class="hidden-visually" id="page-heading-level-1">
  75. <?php p((!empty($_['application']) && !empty($_['pageTitle']) && $_['application'] != $_['pageTitle'])
  76. ? $_['application'].': '.$_['pageTitle']
  77. : (!empty($_['pageTitle']) ? $_['pageTitle'] : $theme->getName())
  78. ); ?>
  79. </h1>
  80. <?php print_unescaped($_['content']); ?>
  81. </main>
  82. <div id="profiler-toolbar"></div>
  83. </body>
  84. </html>