layout.public.php 5.2 KB

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