317 lines
16 KiB
PHP
317 lines
16 KiB
PHP
<?php
|
|
|
|
/**
|
|
* @var \OC_Defaults $theme
|
|
* @var array $_
|
|
*/
|
|
|
|
$getUserAvatar = static function (int $size) use ($_): string {
|
|
return \OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', [
|
|
'userId' => $_['user_uid'],
|
|
'size' => $size,
|
|
'v' => $_['userAvatarVersion']
|
|
]);
|
|
};
|
|
|
|
$nonceManager = \OC::$server->get(\OC\Security\CSP\ContentSecurityPolicyNonceManager::class);
|
|
|
|
?><!DOCTYPE html>
|
|
<html class="ng-csp" data-placeholder-focus="false" lang="<?php p($_['language']); ?>"
|
|
data-locale="<?php p($_['locale']); ?>" translate="no">
|
|
|
|
<head data-user="<?php p($_['user_uid']); ?>" data-user-displayname="<?php p($_['user_displayname']); ?>"
|
|
data-requesttoken="<?php p($_['requesttoken']); ?>">
|
|
<meta charset="utf-8">
|
|
<title>
|
|
<?php
|
|
p(!empty($_['pageTitle']) && $_['pageTitle'] !== $_['application'] ? $_['pageTitle'] . ' - ' : '');
|
|
p(!empty($_['application']) ? $_['application'] . ' - ' : '');
|
|
p('Forbion F7');
|
|
?>
|
|
</title>
|
|
<meta name="csp-nonce" nonce="<?php p($_['cspNonce']); /* Do not pass into "content" to prevent exfiltration */ ?>">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0<?php if (isset($_['viewport_maximum_scale'])) {
|
|
p(', maximum-scale=' . $_['viewport_maximum_scale']);
|
|
} ?>">
|
|
|
|
<?php if ($theme->getiTunesAppId() !== '') { ?>
|
|
<meta name="apple-itunes-app" content="app-id=<?php p($theme->getiTunesAppId()); ?>">
|
|
<?php } ?>
|
|
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
|
<meta name="apple-mobile-web-app-title"
|
|
content="<?php p((!empty($_['application']) && $_['appid'] != 'files') ? $_['application'] : $theme->getTitle()); ?>">
|
|
<meta name="mobile-web-app-capable" content="yes">
|
|
<meta name="theme-color" content="<?php p($theme->getColorPrimary()); ?>">
|
|
<link rel="manifest" href="/manifest.json" crossorigin="use-credentials">
|
|
<link rel="icon" href="<?php print_unescaped(image_path($_['appid'], 'favicon.ico')); /* IE11+ supports png */ ?>">
|
|
<link rel="apple-touch-icon" href="<?php print_unescaped(image_path($_['appid'], 'favicon-touch.png')); ?>">
|
|
<link rel="apple-touch-icon-precomposed"
|
|
href="<?php print_unescaped(image_path($_['appid'], 'favicon-touch.png')); ?>">
|
|
<link rel="mask-icon" sizes="any" href="<?php print_unescaped(image_path($_['appid'], 'favicon-mask.svg')); ?>"
|
|
color="<?php p($theme->getColorPrimary()); ?>">
|
|
<link rel="manifest" href="<?php print_unescaped(image_path($_['appid'], 'manifest.json')); ?>"
|
|
crossorigin="use-credentials">
|
|
<?php emit_css_loading_tags($_); ?>
|
|
<?php emit_script_loading_tags($_); ?>
|
|
<?php print_unescaped($_['headers']); ?>
|
|
|
|
<link rel="stylesheet" href="/themes/forbion/css/app.css?=" <?= rand(1, 100) ?>>
|
|
|
|
|
|
<?php
|
|
$cssMapping = [
|
|
'/apps/mail' => '/themes/forbion/css/pages/app-mail/_app-mail.css',
|
|
'/apps/files' => '/themes/forbion/css/pages/app-files/_app-files.css',
|
|
'/apps/calendar' => '/themes/forbion/css/pages/app-calendar/_app-calendar.css',
|
|
'/apps/contacts' => '/themes/forbion/css/pages/app-contacts/_app-contacts.css',
|
|
'/apps/deck' => '/themes/forbion/css/pages/app-deck/_app-deck.css',
|
|
'/apps/tasks' => '/themes/forbion/css/pages/app-tasks/_app-tasks.css',
|
|
'/settings' => '/themes/forbion/css/pages/page-settings/_page-settings.css',
|
|
'/settings/users' => '/themes/forbion/css/pages/page-settings/_page-users.css',
|
|
'/apps/spreed' => '/themes/forbion/css/pages/app-spreed/_app-spreed.css',
|
|
'/apps/dashboard' => '/themes/forbion/css/pages/app-dashboard/_app-dashboard.css',
|
|
'/call' => '/themes/forbion/css/pages/app-spreed/_app-spreed.css',
|
|
'/apps/notes/' => '/themes/forbion/css/pages/app-notes/_app-notes.css',
|
|
'/apps/assistant/' => '/themes/forbion/css/pages/app-assistant/_app-assistant.css',
|
|
'/external/' => '/themes/forbion/css/pages/app-external/_app-external.css',
|
|
];
|
|
|
|
$currentUri = $_SERVER['REQUEST_URI'] ?? '';
|
|
foreach ($cssMapping as $path => $cssFile) {
|
|
if (strpos($currentUri, $path) !== false) {
|
|
echo '<link rel="stylesheet" href="' . htmlspecialchars($cssFile) . '">';
|
|
if ($path === '/apps/spreed' || $path === '/call')
|
|
break;
|
|
}
|
|
}
|
|
?>
|
|
|
|
<script nonce="<?= $nonceManager->getNonce() ?>" src="/themes/forbion/js/scripts.js"></script>
|
|
<script type="text/javascript" src="https://only.forbion.ru/web-apps/apps/api/documents/api.js"></script>
|
|
</head>
|
|
|
|
<body id="<?php p($_['bodyid']); ?>" <?php foreach ($_['enabledThemes'] as $themeId) {
|
|
p("data-theme-$themeId ");
|
|
} ?>
|
|
data-themes=<?php p(join(',', $_['enabledThemes'])) ?>>
|
|
<?php include 'layout.noscript.warning.php'; ?>
|
|
<?php include 'layout.initial-state.php'; ?>
|
|
|
|
<div id="skip-actions">
|
|
<?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 } ?>
|
|
<?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 } ?>
|
|
</div>
|
|
<?php
|
|
|
|
$headerStyle = (isset($_GET['iframe']) && $_GET['iframe'] === 'true') ? 'style="display: none;"' : '';
|
|
?>
|
|
<header id="header" class="header-new" <?= $headerStyle ?>>
|
|
<div class="l-wrapper">
|
|
<button class="is-header__burger" type="button">
|
|
<i></i>
|
|
<i></i>
|
|
<i></i>
|
|
</button>
|
|
<a href="/" class="logo__header">
|
|
<img src="/themes/forbion/images/logo-header.svg" alt="logo">
|
|
</a>
|
|
<div class="user-control__header">
|
|
<!-- <a href="/u/--><?php //p($_['user_uid']); ?><!--" class="name__user">-->
|
|
<!--<a class="name__user" style="cursor: default;">-->
|
|
<?php //p($_['user_displayname']); ?>
|
|
<!--</a>-->
|
|
|
|
<div id="user-menu"></div>
|
|
|
|
|
|
|
|
<div class="notifications__wrapper">
|
|
<div id="notifications">
|
|
</div>
|
|
<div class="tooltip-header tooltip-header--notifications">Уведомления</div>
|
|
</div>
|
|
|
|
<div class="help-online__user">
|
|
<a target="_blank" href="https://lk.forbion.ru/accounts/login/">
|
|
<img src="/themes/forbion/images/header/lk-header-icon.svg">
|
|
</a>
|
|
<div class="tooltip-header tooltip-header--user">Личный кабинет</div>
|
|
</div>
|
|
|
|
<div class="unified-search__wrapper">
|
|
<div id="unified-search">
|
|
</div>
|
|
<div class="tooltip-header tooltip-header--search">Поиск</div>
|
|
</div>
|
|
|
|
<div id="assistant">
|
|
<a href="/apps/assistant/">
|
|
<img src="/themes/forbion/images/header/assistant-colored-icon.svg">
|
|
</a>
|
|
<div class="tooltip-header tooltip-header--assistant">ГигаЧат</div>
|
|
</div>
|
|
|
|
</div>
|
|
<nav class="app-menu">
|
|
<ul class="app-menu__list">
|
|
<li class="app-menu-entry">
|
|
<a href="/apps/mail/" class="app-menu-entry__link">
|
|
<span class="app-menu-entry__icon">
|
|
<img src="/themes/forbion/images/header/mail-header-icon.svg" alt="mail">
|
|
</span>
|
|
<span class="app-menu-entry__label">Почта</span>
|
|
</a>
|
|
<div class="tooltip-header-hide">Почта</div>
|
|
</li>
|
|
<li class="app-menu-entry">
|
|
<a href="/apps/files/" class="app-menu-entry__link">
|
|
<span class="app-menu-entry__icon">
|
|
<img src="/themes/forbion/images/header/files-header-icon.svg" alt="files">
|
|
</span>
|
|
<span class="app-menu-entry__label">Файлы</span>
|
|
</a>
|
|
<div class="tooltip-header-hide">Файлы</div>
|
|
</li>
|
|
<li class="app-menu-entry">
|
|
<a href="/apps/calendar/" class="app-menu-entry__link">
|
|
<span class="app-menu-entry__icon">
|
|
<img src="/themes/forbion/images/header/calendar-header-icon.svg" alt="calendar">
|
|
</span>
|
|
<span class="app-menu-entry__label">Календарь</span>
|
|
</a>
|
|
<div class="tooltip-header-hide">Календарь</div>
|
|
</li>
|
|
<li class="app-menu-entry">
|
|
<a href="/apps/contacts/" class="app-menu-entry__link">
|
|
<span class="app-menu-entry__icon">
|
|
<img src="/themes/forbion/images/header/contacts-header-icon.svg" alt="contacts">
|
|
</span>
|
|
<span class="app-menu-entry__label">Контакты</span>
|
|
</a>
|
|
<div class="tooltip-header-hide">Контакты</div>
|
|
</li>
|
|
<li class="app-menu-entry">
|
|
<a href="/apps/spreed/" class="app-menu-entry__link">
|
|
<span class="app-menu-entry__icon">
|
|
<img src="/themes/forbion/images/header/spreed-header-icon.svg" alt="conferences">
|
|
</span>
|
|
<span class="app-menu-entry__label">Конференции</span>
|
|
</a>
|
|
<div class="tooltip-header-hide">Конференции</div>
|
|
</li>
|
|
<li class="app-menu-entry">
|
|
<a href="/apps/deck/" class="app-menu-entry__link">
|
|
<span class="app-menu-entry__icon">
|
|
<img src="/themes/forbion/images/header/deck-header-icon.svg" alt="cards">
|
|
</span>
|
|
<span class="app-menu-entry__label">Карточки</span>
|
|
</a>
|
|
<div class="tooltip-header-hide">Карточки</div>
|
|
</li>
|
|
<li class="app-menu-entry">
|
|
<a href="/apps/tasks/" class="app-menu-entry__link">
|
|
<span class="app-menu-entry__icon">
|
|
<img src="/themes/forbion/images/header/task-header-icon.svg" alt="tasks">
|
|
</span>
|
|
<span class="app-menu-entry__label">Задачи</span>
|
|
</a>
|
|
<div class="tooltip-header-hide">Задачи</div>
|
|
</li>
|
|
<li class="app-menu-entry">
|
|
<a href="/apps/notes/" class="app-menu-entry__link">
|
|
<span class="app-menu-entry__icon">
|
|
<img src="/themes/forbion/images/header/notes-header-icon.svg" alt="notes">
|
|
</span>
|
|
<span class="app-menu-entry__label">Заметки</span>
|
|
</a>
|
|
<div class="tooltip-header-hide">Заметки</div>
|
|
</li>
|
|
<li>
|
|
<ul class="app-menu__list hidden-app-menu__list" id="hidden-menu">
|
|
|
|
<?php
|
|
try {
|
|
$appManager = \OC::$server->getAppManager();
|
|
if ($appManager->isEnabledForUser('external')) {
|
|
$sitesManager = \OC::$server->get(\OCA\External\SitesManager::class);
|
|
$urlGenerator = \OC::$server->getURLGenerator();
|
|
$sites = $sitesManager->getSitesToDisplay();
|
|
|
|
foreach ($sites as $id => $site) {
|
|
if ($site['type'] === \OCA\External\SitesManager::TYPE_LOGIN) {
|
|
continue;
|
|
}
|
|
|
|
$name = $site['name'];
|
|
$url = $site['url'];
|
|
$icon = $site['icon'];
|
|
$redirect = $site['redirect'];
|
|
|
|
if ($redirect) {
|
|
$linkUrl = $url;
|
|
$target = 'target="_blank"';
|
|
} else {
|
|
$linkUrl = $urlGenerator->linkToRoute('external.site.showPage', [
|
|
'id' => $id,
|
|
'path' => ''
|
|
]);
|
|
$target = '';
|
|
}
|
|
|
|
echo '
|
|
<li class="app-menu-entry" data-external-site="' . $id . '">
|
|
<a href="' . htmlspecialchars($linkUrl) . '" class="app-menu-entry__link" ' . $target . ' title="' . htmlspecialchars($name) . '">
|
|
<span class="app-menu-entry__icon">
|
|
<img src="/apps/external/img/' . htmlspecialchars($icon) . '" alt="' . htmlspecialchars($name) . '">
|
|
</span>
|
|
<span class="app-menu-entry__label">' . htmlspecialchars($name) . '</span>
|
|
</a>
|
|
<div class="tooltip-header-hide">' . htmlspecialchars($name) . '</div>
|
|
</li>';
|
|
}
|
|
|
|
}
|
|
} catch (Exception $e) {
|
|
}
|
|
?>
|
|
|
|
<span class="setting-hidden-menu">
|
|
<img src="/themes/forbion/images/menu/settings.svg" alt="settings">
|
|
</span>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
|
|
<div id="app-menu-toggle--more" class="app-menu-entry--more" title="Еще">
|
|
<a class="app-menu-entry__link-more">
|
|
<span class="app-menu-entry__icon">
|
|
<img src="/themes/forbion/images/menu/more.svg" alt="more">
|
|
</span>
|
|
<span class="app-menu-entry__label">Еще</span>
|
|
</a>
|
|
</div>
|
|
|
|
</nav>
|
|
</div>
|
|
</header>
|
|
|
|
<main id="content" class="app-<?php p($_['appid']) ?>">
|
|
<h1 class="hidden-visually" id="page-heading-level-1">
|
|
<?php p(
|
|
(!empty($_['application']) && !empty($_['pageTitle']) && $_['application'] != $_['pageTitle'])
|
|
? $_['application'] . ': ' . $_['pageTitle']
|
|
: (!empty($_['pageTitle']) ? $_['pageTitle'] : $theme->getName())
|
|
); ?>
|
|
</h1>
|
|
<?php print_unescaped($_['content']); ?>
|
|
</main>
|
|
<div id="profiler-toolbar"></div>
|
|
|
|
</body>
|
|
|
|
</html>
|