xref: /webtrees/resources/views/layouts/administration.phtml (revision 1f1ffa65b3b51df2b95b5c68894525436855964a)
1<?php
2
3use Fisharebest\Webtrees\DebugBar;
4use Fisharebest\Webtrees\FlashMessages;
5use Fisharebest\Webtrees\I18N;
6use Fisharebest\Webtrees\Module\CustomCssJsModule;
7use Fisharebest\Webtrees\Module\ModuleCustomInterface;
8use Fisharebest\Webtrees\Module\ModuleGlobalInterface;
9use Fisharebest\Webtrees\Services\ModuleService;
10use Fisharebest\Webtrees\View;
11use Psr\Http\Message\ServerRequestInterface;
12
13/** @var string $title */
14/** @var string $content */
15
16?>
17
18<!DOCTYPE html>
19<html dir="<?= I18N::direction() ?>" lang="<?= WT_LOCALE ?>">
20    <head>
21        <meta charset="UTF-8">
22        <meta name="viewport" content="width=device-width, initial-scale=1">
23        <meta name="csrf" content="<?= e(csrf_token()) ?>">
24
25        <title><?= $title ?></title>
26
27        <link rel="icon" href="<?= e(asset('favicon.ico')) ?>" type="image/x-icon">
28
29        <link rel="stylesheet" href="<?= e(asset('css/vendor.min.css')) ?>">
30        <link rel="stylesheet" href="<?= e(asset('css/administration.min.css')) ?>">
31
32        <?= View::stack('styles') ?>
33
34        <?= app(ModuleService::class)->findByInterface(ModuleGlobalInterface::class)->map(static function (ModuleGlobalInterface $module): string { return $module instanceof ModuleCustomInterface || $module instanceof CustomCssJsModule ? '' : $module->headContent(); })->implode('') ?>
35
36        <?= DebugBar::renderHead() ?>
37    </head>
38    <body class="container wt-global wt-route-<?= e(app(ServerRequestInterface::class)->getQueryParams()['route']) ?>">
39        <header>
40            <div class="wt-accessibility-links position-fixed">
41                <a class="sr-only sr-only-focusable btn btn-info btn-sm" href="#content">
42                    <?= /* I18N: Skip over the headers and menus, to the main content of the page */
43                    I18N::translate('Skip to content') ?>
44                </a>
45            </div>
46
47            <ul class="nav small d-flex justify-content-end">
48                <li class="nav-item menu-mypage">
49                    <a class="nav-link active" href="<?= e(route('user-page')) ?>"><?= I18N::translate('My page') ?></a>
50                </li>
51                <li class="nav-item dropdown menu-language">
52                    <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
53                        <?= I18N::translate('Language') ?>
54                    </a>
55                    <div class="dropdown-menu">
56                        <?php foreach (I18N::activeLocales() as $locale) : ?>
57                            <a class="dropdown-item menu-language-<?= $locale->languageTag() ?> <?= WT_LOCALE === $locale->languageTag() ? ' active' : '' ?>" data-language="<?= $locale->languageTag() ?>" href="#"><?= $locale->endonym() ?></a>
58                        <?php endforeach ?>
59                    </div>
60                </li>
61                <li class="nav-item menu-logout">
62                    <a class="nav-link" href="<?= e(route('logout')) ?>"><?= I18N::translate('Sign out') ?></a>
63                </li>
64            </ul>
65        </header>
66
67        <div id="content"></div>
68
69        <?php foreach (FlashMessages::getMessages() as $message) : ?>
70            <div class="alert alert-<?= $message->status ?> alert-dismissible" role="alert">
71                <button type="button" class="close" data-dismiss="alert" aria-label="<?= I18N::translate('close') ?>">
72                    <span aria-hidden="true">&times;</span>
73                </button>
74                <?= $message->text ?>
75            </div>
76        <?php endforeach ?>
77
78        <?= $content ?>
79
80        <script src="<?= e(asset('js/vendor.min.js')) ?>"></script>
81        <script src="<?= e(asset('js/webtrees.min.js')) ?>"></script>
82
83        <?= View::stack('javascript') ?>
84
85        <?= app(ModuleService::class)->findByInterface(ModuleGlobalInterface::class)->map(static function (ModuleGlobalInterface $module): string { return $module instanceof ModuleCustomInterface || $module instanceof CustomCssJsModule ? '' : $module->bodyContent(); })->implode('') ?>
86
87        <?= DebugBar::render() ?>
88    </body>
89</html>
90