xref: /webtrees/resources/views/layouts/administration.phtml (revision ce42304a0e3b715b5830d587f136ecd5ca69f11b)
18d6560c4SGreg Roach<?php
28d6560c4SGreg Roach
38d6560c4SGreg Roachuse Fisharebest\Webtrees\DebugBar;
48d6560c4SGreg Roachuse Fisharebest\Webtrees\FlashMessages;
556f9a9c1SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\Logout;
60c0910bfSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\HomePage;
7b5536cd7SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\SelectLanguage;
88d6560c4SGreg Roachuse Fisharebest\Webtrees\I18N;
98d6560c4SGreg Roachuse Fisharebest\Webtrees\Module\CustomCssJsModule;
108d6560c4SGreg Roachuse Fisharebest\Webtrees\Module\ModuleCustomInterface;
11abafa13cSGreg Roachuse Fisharebest\Webtrees\Module\ModuleGlobalInterface;
12abafa13cSGreg Roachuse Fisharebest\Webtrees\Services\ModuleService;
138d6560c4SGreg Roachuse Fisharebest\Webtrees\View;
146ccdf4f0SGreg Roachuse Psr\Http\Message\ServerRequestInterface;
156ccdf4f0SGreg Roach
166ccdf4f0SGreg Roach/** @var string $title */
176ccdf4f0SGreg Roach/** @var string $content */
188d6560c4SGreg Roach
198d6560c4SGreg Roach?>
208d0ebef0SGreg Roach
21dd6b2bfcSGreg Roach<!DOCTYPE html>
2265cf5706SGreg Roach<html dir="<?= I18N::locale()->direction() ?>" lang="<?= I18N::locale()->languageTag() ?>">
23dd6b2bfcSGreg Roach    <head>
24dd6b2bfcSGreg Roach        <meta charset="UTF-8">
25dd6b2bfcSGreg Roach        <meta name="viewport" content="width=device-width, initial-scale=1">
26dd6b2bfcSGreg Roach        <meta name="csrf" content="<?= e(csrf_token()) ?>">
27dd6b2bfcSGreg Roach
28*ce42304aSGreg Roach        <title><?= strip_tags($title) ?></title>
29dd6b2bfcSGreg Roach
30b08e6999SGreg Roach        <link rel="icon" href="<?= e(asset('favicon.ico')) ?>" type="image/x-icon">
31dd6b2bfcSGreg Roach
32e837ff07SGreg Roach        <link rel="stylesheet" href="<?= e(asset('css/vendor.min.css')) ?>">
33e837ff07SGreg Roach        <link rel="stylesheet" href="<?= e(asset('css/administration.min.css')) ?>">
34dd6b2bfcSGreg Roach
35dd6b2bfcSGreg Roach        <?= View::stack('styles') ?>
36dd6b2bfcSGreg Roach
37d70512abSGreg Roach        <?= app(ModuleService::class)->findByInterface(ModuleGlobalInterface::class)->map(static function (ModuleGlobalInterface $module): string {
38d70512abSGreg Roach    return $module instanceof ModuleCustomInterface || $module instanceof CustomCssJsModule ? '' : $module->headContent();
39d70512abSGreg Roach        })->implode('') ?>
40abafa13cSGreg Roach
41dd6b2bfcSGreg Roach        <?= DebugBar::renderHead() ?>
42dd6b2bfcSGreg Roach    </head>
43c1b29ce3SGreg Roach    <body class="container wt-global wt-control-panel wt-route-<?= e(app(ServerRequestInterface::class)->getAttribute('route')) ?>">
44dd6b2bfcSGreg Roach        <header>
4597c22350SGreg Roach            <div class="wt-accessibility-links position-fixed">
46dd6b2bfcSGreg Roach                <a class="sr-only sr-only-focusable btn btn-info btn-sm" href="#content">
478d6560c4SGreg Roach                    <?= /* I18N: Skip over the headers and menus, to the main content of the page */
488d6560c4SGreg Roach                    I18N::translate('Skip to content') ?>
49dd6b2bfcSGreg Roach                </a>
50dd6b2bfcSGreg Roach            </div>
51dd6b2bfcSGreg Roach
52dd6b2bfcSGreg Roach            <ul class="nav small d-flex justify-content-end">
53dd6b2bfcSGreg Roach                <li class="nav-item menu-mypage">
540c0910bfSGreg Roach                    <a class="nav-link active" href="<?= e(route(HomePage::class)) ?>"><?= I18N::translate('My page') ?></a>
55dd6b2bfcSGreg Roach                </li>
56dd6b2bfcSGreg Roach                <li class="nav-item dropdown menu-language">
57dd6b2bfcSGreg Roach                    <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
58dd6b2bfcSGreg Roach                        <?= I18N::translate('Language') ?>
59dd6b2bfcSGreg Roach                    </a>
60dd6b2bfcSGreg Roach                    <div class="dropdown-menu">
61dd6b2bfcSGreg Roach                        <?php foreach (I18N::activeLocales() as $locale) : ?>
6265cf5706SGreg Roach                            <a class="dropdown-item menu-language-<?= $locale->languageTag() ?> <?= I18N::languageTag() === $locale->languageTag() ? ' active' : '' ?>" href="#" data-post-url="<?= e(route(SelectLanguage::class, ['language' => $locale->languageTag()])) ?>"><?= $locale->endonym() ?></a>
63dd6b2bfcSGreg Roach                        <?php endforeach ?>
64dd6b2bfcSGreg Roach                    </div>
65dd6b2bfcSGreg Roach                </li>
66dd6b2bfcSGreg Roach                <li class="nav-item menu-logout">
670d7461faSGreg Roach                    <a class="nav-link" href="#" data-post-url="<?= e(route(Logout::class)) ?>"><?= I18N::translate('Sign out') ?></a>
68dd6b2bfcSGreg Roach                </li>
69dd6b2bfcSGreg Roach            </ul>
70dd6b2bfcSGreg Roach        </header>
71dd6b2bfcSGreg Roach
72dd6b2bfcSGreg Roach        <div id="content"></div>
73dd6b2bfcSGreg Roach
74dd6b2bfcSGreg Roach        <?php foreach (FlashMessages::getMessages() as $message) : ?>
75dd6b2bfcSGreg Roach            <div class="alert alert-<?= $message->status ?> alert-dismissible" role="alert">
76dd6b2bfcSGreg Roach                <button type="button" class="close" data-dismiss="alert" aria-label="<?= I18N::translate('close') ?>">
77dd6b2bfcSGreg Roach                    <span aria-hidden="true">&times;</span>
78dd6b2bfcSGreg Roach                </button>
79dd6b2bfcSGreg Roach                <?= $message->text ?>
80dd6b2bfcSGreg Roach            </div>
81dd6b2bfcSGreg Roach        <?php endforeach ?>
82dd6b2bfcSGreg Roach
83dd6b2bfcSGreg Roach        <?= $content ?>
84dd6b2bfcSGreg Roach
85ad727080SGreg Roach        <script src="<?= e(asset('js/vendor.min.js')) ?>"></script>
86ad727080SGreg Roach        <script src="<?= e(asset('js/webtrees.min.js')) ?>"></script>
87dd6b2bfcSGreg Roach
88dd6b2bfcSGreg Roach        <?= View::stack('javascript') ?>
89dd6b2bfcSGreg Roach
90d70512abSGreg Roach        <?= app(ModuleService::class)->findByInterface(ModuleGlobalInterface::class)->map(static function (ModuleGlobalInterface $module): string {
91d70512abSGreg Roach    return $module instanceof ModuleCustomInterface || $module instanceof CustomCssJsModule ? '' : $module->bodyContent();
92d70512abSGreg Roach        })->implode('') ?>
93abafa13cSGreg Roach
94dd6b2bfcSGreg Roach        <?= DebugBar::render() ?>
95dd6b2bfcSGreg Roach    </body>
96dd6b2bfcSGreg Roach</html>
97