xref: /webtrees/resources/views/layouts/administration.phtml (revision 43aac321b4cfc463dba6787f2005f16d962a7b4c)
18d6560c4SGreg Roach<?php
28d6560c4SGreg Roach
38d6560c4SGreg Roachuse Fisharebest\Webtrees\FlashMessages;
456f9a9c1SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\Logout;
50c0910bfSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\HomePage;
6b5536cd7SGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\SelectLanguage;
78d6560c4SGreg Roachuse Fisharebest\Webtrees\I18N;
88d6560c4SGreg Roachuse Fisharebest\Webtrees\Module\CustomCssJsModule;
98d6560c4SGreg Roachuse Fisharebest\Webtrees\Module\ModuleCustomInterface;
10abafa13cSGreg Roachuse Fisharebest\Webtrees\Module\ModuleGlobalInterface;
11abafa13cSGreg Roachuse Fisharebest\Webtrees\Services\ModuleService;
128d6560c4SGreg Roachuse Fisharebest\Webtrees\View;
136ccdf4f0SGreg Roach
146ccdf4f0SGreg Roach/** @var string $title */
156ccdf4f0SGreg Roach/** @var string $content */
168d6560c4SGreg Roach
178d6560c4SGreg Roach?>
188d0ebef0SGreg Roach
19dd6b2bfcSGreg Roach<!DOCTYPE html>
2065cf5706SGreg Roach<html dir="<?= I18N::locale()->direction() ?>" lang="<?= I18N::locale()->languageTag() ?>">
21dd6b2bfcSGreg Roach    <head>
22dd6b2bfcSGreg Roach        <meta charset="UTF-8">
23dd6b2bfcSGreg Roach        <meta name="viewport" content="width=device-width, initial-scale=1">
24dd6b2bfcSGreg Roach        <meta name="csrf" content="<?= e(csrf_token()) ?>">
25dd6b2bfcSGreg Roach
26ce42304aSGreg Roach        <title><?= strip_tags($title) ?></title>
27dd6b2bfcSGreg Roach
28b08e6999SGreg Roach        <link rel="icon" href="<?= e(asset('favicon.ico')) ?>" type="image/x-icon">
29dd6b2bfcSGreg Roach
30e837ff07SGreg Roach        <link rel="stylesheet" href="<?= e(asset('css/vendor.min.css')) ?>">
31e837ff07SGreg Roach        <link rel="stylesheet" href="<?= e(asset('css/administration.min.css')) ?>">
32dd6b2bfcSGreg Roach
33dd6b2bfcSGreg Roach        <?= View::stack('styles') ?>
34dd6b2bfcSGreg Roach
35d70512abSGreg Roach        <?= app(ModuleService::class)->findByInterface(ModuleGlobalInterface::class)->map(static function (ModuleGlobalInterface $module): string {
36d70512abSGreg Roach    return $module instanceof ModuleCustomInterface || $module instanceof CustomCssJsModule ? '' : $module->headContent();
37d70512abSGreg Roach        })->implode('') ?>
38dd6b2bfcSGreg Roach    </head>
3916543441SGreg Roach    <body class="container-lg wt-global wt-control-panel">
40dd6b2bfcSGreg Roach        <header>
4197c22350SGreg Roach            <div class="wt-accessibility-links position-fixed">
42315eb316SGreg Roach                <a class="visually-hidden visually-hidden-focusable btn btn-info btn-sm" href="#content">
438d6560c4SGreg Roach                    <?= /* I18N: Skip over the headers and menus, to the main content of the page */
448d6560c4SGreg Roach                    I18N::translate('Skip to content') ?>
45dd6b2bfcSGreg Roach                </a>
46dd6b2bfcSGreg Roach            </div>
47dd6b2bfcSGreg Roach
48dd6b2bfcSGreg Roach            <ul class="nav small d-flex justify-content-end">
49dd6b2bfcSGreg Roach                <li class="nav-item menu-mypage">
500c0910bfSGreg Roach                    <a class="nav-link active" href="<?= e(route(HomePage::class)) ?>"><?= I18N::translate('My page') ?></a>
51dd6b2bfcSGreg Roach                </li>
52dd6b2bfcSGreg Roach                <li class="nav-item dropdown menu-language">
53315eb316SGreg Roach                    <a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
54dd6b2bfcSGreg Roach                        <?= I18N::translate('Language') ?>
55dd6b2bfcSGreg Roach                    </a>
56dd6b2bfcSGreg Roach                    <div class="dropdown-menu">
57dd6b2bfcSGreg Roach                        <?php foreach (I18N::activeLocales() as $locale) : ?>
58d4786c66SGreg 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>
59dd6b2bfcSGreg Roach                        <?php endforeach ?>
60dd6b2bfcSGreg Roach                    </div>
61dd6b2bfcSGreg Roach                </li>
62dd6b2bfcSGreg Roach                <li class="nav-item menu-logout">
63d4786c66SGreg 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>
64dd6b2bfcSGreg Roach                </li>
65dd6b2bfcSGreg Roach            </ul>
66dd6b2bfcSGreg Roach        </header>
67dd6b2bfcSGreg Roach
68*43aac321SGreg Roach        <main id="content">
69dd6b2bfcSGreg Roach            <?php foreach (FlashMessages::getMessages() as $message) : ?>
70dd6b2bfcSGreg Roach                <div class="alert alert-<?= $message->status ?> alert-dismissible" role="alert">
71315eb316SGreg Roach                    <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="<?= I18N::translate('close') ?>">
72dd6b2bfcSGreg Roach                    </button>
73dd6b2bfcSGreg Roach                    <?= $message->text ?>
74dd6b2bfcSGreg Roach                </div>
75dd6b2bfcSGreg Roach            <?php endforeach ?>
76dd6b2bfcSGreg Roach
77dd6b2bfcSGreg Roach            <?= $content ?>
78*43aac321SGreg Roach        </main>
79*43aac321SGreg Roach
80dd6b2bfcSGreg Roach
81ad727080SGreg Roach        <script src="<?= e(asset('js/vendor.min.js')) ?>"></script>
82ad727080SGreg Roach        <script src="<?= e(asset('js/webtrees.min.js')) ?>"></script>
83dd6b2bfcSGreg Roach
84dd6b2bfcSGreg Roach        <?= View::stack('javascript') ?>
85dd6b2bfcSGreg Roach
86d70512abSGreg Roach        <?= app(ModuleService::class)->findByInterface(ModuleGlobalInterface::class)->map(static function (ModuleGlobalInterface $module): string {
87d70512abSGreg Roach    return $module instanceof ModuleCustomInterface || $module instanceof CustomCssJsModule ? '' : $module->bodyContent();
88d70512abSGreg Roach        })->implode('') ?>
89dd6b2bfcSGreg Roach    </body>
90dd6b2bfcSGreg Roach</html>
91