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