xref: /webtrees/resources/views/layouts/administration.phtml (revision d35568b467207589ea9059739da0bf1f7e785a0d)
18d6560c4SGreg Roach<?php
28d6560c4SGreg Roach
310e06497SGreg Roachdeclare(strict_types=1);
410e06497SGreg Roach
58d6560c4SGreg Roachuse Fisharebest\Webtrees\FlashMessages;
656f9a9c1SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\Logout;
70c0910bfSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\HomePage;
8b5536cd7SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\SelectLanguage;
98d6560c4SGreg Roachuse Fisharebest\Webtrees\I18N;
108d6560c4SGreg Roachuse Fisharebest\Webtrees\Module\CustomCssJsModule;
118d6560c4SGreg Roachuse Fisharebest\Webtrees\Module\ModuleCustomInterface;
12abafa13cSGreg Roachuse Fisharebest\Webtrees\Module\ModuleGlobalInterface;
13*d35568b4SGreg Roachuse Fisharebest\Webtrees\Registry;
14abafa13cSGreg Roachuse Fisharebest\Webtrees\Services\ModuleService;
158d6560c4SGreg Roachuse Fisharebest\Webtrees\View;
166ccdf4f0SGreg Roach
1736779af1SGreg Roach/**
1836779af1SGreg Roach * @var string $title
1936779af1SGreg Roach * @var string $content
2036779af1SGreg Roach */
218d6560c4SGreg Roach
228d6560c4SGreg Roach?>
238d0ebef0SGreg Roach
24dd6b2bfcSGreg Roach<!DOCTYPE html>
2565cf5706SGreg Roach<html dir="<?= I18N::locale()->direction() ?>" lang="<?= I18N::locale()->languageTag() ?>">
26dd6b2bfcSGreg Roach    <head>
27dd6b2bfcSGreg Roach        <meta charset="UTF-8">
28dd6b2bfcSGreg Roach        <meta name="viewport" content="width=device-width, initial-scale=1">
29dd6b2bfcSGreg Roach        <meta name="csrf" content="<?= e(csrf_token()) ?>">
30dd6b2bfcSGreg Roach
31ce42304aSGreg Roach        <title><?= strip_tags($title) ?></title>
32dd6b2bfcSGreg Roach
33b08e6999SGreg Roach        <link rel="icon" href="<?= e(asset('favicon.ico')) ?>" type="image/x-icon">
34dd6b2bfcSGreg Roach
35e837ff07SGreg Roach        <link rel="stylesheet" href="<?= e(asset('css/vendor.min.css')) ?>">
36e837ff07SGreg Roach        <link rel="stylesheet" href="<?= e(asset('css/administration.min.css')) ?>">
37dd6b2bfcSGreg Roach
38dd6b2bfcSGreg Roach        <?= View::stack('styles') ?>
39dd6b2bfcSGreg Roach
40*d35568b4SGreg Roach        <?= Registry::container()->get(ModuleService::class)->findByInterface(ModuleGlobalInterface::class)->map(static function (ModuleGlobalInterface $module): string {
41d70512abSGreg Roach    return $module instanceof ModuleCustomInterface || $module instanceof CustomCssJsModule ? '' : $module->headContent();
42d70512abSGreg Roach        })->implode('') ?>
43dd6b2bfcSGreg Roach    </head>
4416543441SGreg Roach    <body class="container-lg wt-global wt-control-panel">
45dd6b2bfcSGreg Roach        <header>
4697c22350SGreg Roach            <div class="wt-accessibility-links position-fixed">
47315eb316SGreg Roach                <a class="visually-hidden visually-hidden-focusable btn btn-info btn-sm" href="#content">
488d6560c4SGreg Roach                    <?= /* I18N: Skip over the headers and menus, to the main content of the page */
498d6560c4SGreg Roach                    I18N::translate('Skip to content') ?>
50dd6b2bfcSGreg Roach                </a>
51dd6b2bfcSGreg Roach            </div>
52dd6b2bfcSGreg Roach
53dd6b2bfcSGreg Roach            <ul class="nav small d-flex justify-content-end">
54dd6b2bfcSGreg Roach                <li class="nav-item menu-mypage">
550c0910bfSGreg Roach                    <a class="nav-link active" href="<?= e(route(HomePage::class)) ?>"><?= I18N::translate('My page') ?></a>
56dd6b2bfcSGreg Roach                </li>
57dd6b2bfcSGreg Roach                <li class="nav-item dropdown menu-language">
58315eb316SGreg Roach                    <a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
59dd6b2bfcSGreg Roach                        <?= I18N::translate('Language') ?>
60dd6b2bfcSGreg Roach                    </a>
61dd6b2bfcSGreg Roach                    <div class="dropdown-menu">
62dd6b2bfcSGreg Roach                        <?php foreach (I18N::activeLocales() as $locale) : ?>
63d4786c66SGreg Roach                            <a class="dropdown-item menu-language-<?= $locale->languageTag() ?> <?= I18N::languageTag() === $locale->languageTag() ? ' active' : '' ?>" href="#" data-wt-post-url="<?= e(route(SelectLanguage::class, ['language' => $locale->languageTag()])) ?>"><?= $locale->endonym() ?></a>
64dd6b2bfcSGreg Roach                        <?php endforeach ?>
65dd6b2bfcSGreg Roach                    </div>
66dd6b2bfcSGreg Roach                </li>
67dd6b2bfcSGreg Roach                <li class="nav-item menu-logout">
68d4786c66SGreg Roach                    <a class="nav-link" href="#" data-wt-post-url="<?= e(route(Logout::class)) ?>" data-wt-reload-url="<?= e(route(HomePage::class)) ?>"><?= I18N::translate('Sign out') ?></a>
69dd6b2bfcSGreg Roach                </li>
70dd6b2bfcSGreg Roach            </ul>
71dd6b2bfcSGreg Roach        </header>
72dd6b2bfcSGreg Roach
7343aac321SGreg Roach        <main id="content">
74dd6b2bfcSGreg Roach            <?php foreach (FlashMessages::getMessages() as $message) : ?>
75dd6b2bfcSGreg Roach                <div class="alert alert-<?= $message->status ?> alert-dismissible" role="alert">
76315eb316SGreg Roach                    <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="<?= I18N::translate('close') ?>">
77dd6b2bfcSGreg Roach                    </button>
78dd6b2bfcSGreg Roach                    <?= $message->text ?>
79dd6b2bfcSGreg Roach                </div>
80dd6b2bfcSGreg Roach            <?php endforeach ?>
81dd6b2bfcSGreg Roach
82dd6b2bfcSGreg Roach            <?= $content ?>
8343aac321SGreg Roach        </main>
8443aac321SGreg Roach
85dd6b2bfcSGreg Roach
86ad727080SGreg Roach        <script src="<?= e(asset('js/vendor.min.js')) ?>"></script>
87ad727080SGreg Roach        <script src="<?= e(asset('js/webtrees.min.js')) ?>"></script>
88dd6b2bfcSGreg Roach
89dd6b2bfcSGreg Roach        <?= View::stack('javascript') ?>
90dd6b2bfcSGreg Roach
91*d35568b4SGreg Roach        <?= Registry::container()->get(ModuleService::class)->findByInterface(ModuleGlobalInterface::class)->map(static function (ModuleGlobalInterface $module): string {
92d70512abSGreg Roach    return $module instanceof ModuleCustomInterface || $module instanceof CustomCssJsModule ? '' : $module->bodyContent();
93d70512abSGreg Roach        })->implode('') ?>
94dd6b2bfcSGreg Roach    </body>
95dd6b2bfcSGreg Roach</html>
96