layout.public.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2018-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. ?>
  7. <!DOCTYPE html>
  8. <html class="ng-csp" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" data-locale="<?php p($_['locale']); ?>" translate="no" >
  9. <head data-requesttoken="<?php p($_['requesttoken']); ?>">
  10. <meta charset="utf-8">
  11. <title>
  12. <?php
  13. p(!empty($_['application']) ? $_['application'].' - ' : '');
  14. p($theme->getTitle());
  15. ?>
  16. </title>
  17. <meta name="csp-nonce" nonce="<?php p($_['cspNonce']); /* Do not pass into "content" to prevent exfiltration */ ?>">
  18. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0<?php if (isset($_['viewport_maximum_scale'])) {
  19. p(', maximum-scale=' . $_['viewport_maximum_scale']);
  20. } ?>">
  21. <?php if ($theme->getiTunesAppId() !== '') { ?>
  22. <meta name="apple-itunes-app" content="app-id=<?php p($theme->getiTunesAppId()); ?>">
  23. <?php } ?>
  24. <meta name="apple-mobile-web-app-capable" content="yes">
  25. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  26. <meta name="apple-mobile-web-app-title" content="<?php p((!empty($_['application']) && $_['appid'] !== 'files')? $_['application']:$theme->getTitle()); ?>">
  27. <meta name="mobile-web-app-capable" content="yes">
  28. <meta name="theme-color" content="<?php p($theme->getColorPrimary()); ?>">
  29. <link rel="icon" href="<?php print_unescaped(image_path($_['appid'], 'favicon.ico')); /* IE11+ supports png */ ?>">
  30. <link rel="apple-touch-icon" href="<?php print_unescaped(image_path($_['appid'], 'favicon-touch.png')); ?>">
  31. <link rel="apple-touch-icon-precomposed" href="<?php print_unescaped(image_path($_['appid'], 'favicon-touch.png')); ?>">
  32. <link rel="mask-icon" sizes="any" href="<?php print_unescaped(image_path($_['appid'], 'favicon-mask.svg')); ?>" color="<?php p($theme->getColorPrimary()); ?>">
  33. <link rel="manifest" href="<?php print_unescaped(image_path($_['appid'], 'manifest.json')); ?>" crossorigin="use-credentials">
  34. <?php emit_css_loading_tags($_); ?>
  35. <?php emit_script_loading_tags($_); ?>
  36. <?php print_unescaped($_['headers']); ?>
  37. </head>
  38. <body id="<?php p($_['bodyid']);?>">
  39. <?php include('layout.noscript.warning.php'); ?>
  40. <?php include('layout.initial-state.php'); ?>
  41. <div id="skip-actions">
  42. <?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 } ?>
  43. <?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 } ?>
  44. </div>
  45. <header id="header">
  46. <div class="header-left">
  47. <div id="nextcloud" class="header-appname">
  48. <?php if ($_['logoUrl']): ?>
  49. <a href="<?php print_unescaped($_['logoUrl']); ?>"
  50. aria-label="<?php p($l->t('Go to %s', [$_['logoUrl']])); ?>">
  51. <div class="logo logo-icon"></div>
  52. </a>
  53. <?php else: ?>
  54. <div class="logo logo-icon"></div>
  55. <?php endif; ?>
  56. <div class="header-info">
  57. <span class="header-title">
  58. <?php if (isset($template) && $template->getHeaderTitle() !== '') { ?>
  59. <?php p($template->getHeaderTitle()); ?>
  60. <?php } else { ?>
  61. <?php p($theme->getName()); ?>
  62. <?php } ?>
  63. </span>
  64. <?php if (isset($template) && $template->getHeaderDetails() !== '') { ?>
  65. <span class="header-shared-by">
  66. <?php p($template->getHeaderDetails()); ?>
  67. </span>
  68. <?php } ?>
  69. </div>
  70. </div>
  71. </div>
  72. <div class="header-right">
  73. <?php
  74. /** @var \OCP\AppFramework\Http\Template\PublicTemplateResponse $template */
  75. if (isset($template) && $template->getActionCount() !== 0) {
  76. $primary = $template->getPrimaryAction();
  77. $others = $template->getOtherActions(); ?>
  78. <span id="header-primary-action" class="<?php if ($template->getActionCount() === 1) {
  79. p($primary->getIcon());
  80. } ?>">
  81. <a href="<?php p($primary->getLink()); ?>" class="primary button">
  82. <span><?php p($primary->getLabel()) ?></span>
  83. </a>
  84. </span>
  85. <?php if ($template->getActionCount() > 1) { ?>
  86. <div id="header-secondary-action">
  87. <button id="header-actions-toggle" class="menutoggle icon-more-white"></button>
  88. <div id="header-actions-menu" class="popovermenu menu">
  89. <ul>
  90. <?php
  91. /** @var \OCP\AppFramework\Http\Template\IMenuAction $action */
  92. foreach ($others as $action) {
  93. print_unescaped($action->render());
  94. }
  95. ?>
  96. </ul>
  97. </div>
  98. </div>
  99. <?php } ?>
  100. <?php
  101. } ?>
  102. </div>
  103. </header>
  104. <main id="content" class="app-<?php p($_['appid']) ?>">
  105. <h1 class="hidden-visually">
  106. <?php if (isset($template) && $template->getHeaderTitle() !== '') { ?>
  107. <?php p($template->getHeaderTitle()); ?>
  108. <?php } else { ?>
  109. <?php p($theme->getName()); ?>
  110. <?php } ?>
  111. </h1>
  112. <?php print_unescaped($_['content']); ?>
  113. </main>
  114. <?php if (isset($template) && $template->getFooterVisible() && ($theme->getLongFooter() !== '' || $_['showSimpleSignUpLink'])) { ?>
  115. <footer>
  116. <p><?php print_unescaped($theme->getLongFooter()); ?></p>
  117. <?php
  118. if ($_['showSimpleSignUpLink']) {
  119. ?>
  120. <p class="footer__simple-sign-up">
  121. <a href="<?php p($_['signUpLink']); ?>" target="_blank" rel="noreferrer noopener">
  122. <?php p($l->t('Get your own free account')); ?>
  123. </a>
  124. </p>
  125. <?php
  126. }
  127. ?>
  128. </footer>
  129. <?php } ?>
  130. </body>
  131. </html>