1
0

layout.public.php 5.1 KB

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