xref: /webtrees/resources/views/layouts/administration.phtml (revision 10e0649788c8d7d4974d81c048ca2b225df8f22e)
18d6560c4SGreg Roach<?php
28d6560c4SGreg Roach
3*10e06497SGreg Roachdeclare(strict_types=1);
4*10e06497SGreg 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;
13abafa13cSGreg Roachuse Fisharebest\Webtrees\Services\ModuleService;
148d6560c4SGreg Roachuse Fisharebest\Webtrees\View;
156ccdf4f0SGreg Roach
1636779af1SGreg Roach/**
1736779af1SGreg Roach * @var string $title
1836779af1SGreg Roach * @var string $content
1936779af1SGreg Roach */
208d6560c4SGreg Roach
218d6560c4SGreg Roach?>
228d0ebef0SGreg Roach
23dd6b2bfcSGreg Roach<!DOCTYPE html>
2465cf5706SGreg Roach<html dir="<?= I18N::locale()->direction() ?>" lang="<?= I18N::locale()->languageTag() ?>">
25dd6b2bfcSGreg Roach    <head>
26dd6b2bfcSGreg Roach        <meta charset="UTF-8">
27dd6b2bfcSGreg Roach        <meta name="viewport" content="width=device-width, initial-scale=1">
28dd6b2bfcSGreg Roach        <meta name="csrf" content="<?= e(csrf_token()) ?>">
29dd6b2bfcSGreg Roach
30ce42304aSGreg Roach        <title><?= strip_tags($title) ?></title>
31dd6b2bfcSGreg Roach
32b08e6999SGreg Roach        <link rel="icon" href="<?= e(asset('favicon.ico')) ?>" type="image/x-icon">
33dd6b2bfcSGreg Roach
34e837ff07SGreg Roach        <link rel="stylesheet" href="<?= e(asset('css/vendor.min.css')) ?>">
35e837ff07SGreg Roach        <link rel="stylesheet" href="<?= e(asset('css/administration.min.css')) ?>">
36dd6b2bfcSGreg Roach
37dd6b2bfcSGreg Roach        <?= View::stack('styles') ?>
38dd6b2bfcSGreg Roach
39d70512abSGreg Roach        <?= app(ModuleService::class)->findByInterface(ModuleGlobalInterface::class)->map(static function (ModuleGlobalInterface $module): string {
40d70512abSGreg Roach    return $module instanceof ModuleCustomInterface || $module instanceof CustomCssJsModule ? '' : $module->headContent();
41d70512abSGreg Roach        })->implode('') ?>
42dd6b2bfcSGreg Roach    </head>
4316543441SGreg Roach    <body class="container-lg wt-global wt-control-panel">
44dd6b2bfcSGreg Roach        <header>
4597c22350SGreg Roach            <div class="wt-accessibility-links position-fixed">
46315eb316SGreg Roach                <a class="visually-hidden visually-hidden-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">
57315eb316SGreg Roach                    <a class="nav-link dropdown-toggle" data-bs-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) : ?>
62d4786c66SGreg 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>
63dd6b2bfcSGreg Roach                        <?php endforeach ?>
64dd6b2bfcSGreg Roach                    </div>
65dd6b2bfcSGreg Roach                </li>
66dd6b2bfcSGreg Roach                <li class="nav-item menu-logout">
67d4786c66SGreg 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>
68dd6b2bfcSGreg Roach                </li>
69dd6b2bfcSGreg Roach            </ul>
70dd6b2bfcSGreg Roach        </header>
71dd6b2bfcSGreg Roach
7243aac321SGreg Roach        <main id="content">
73dd6b2bfcSGreg Roach            <?php foreach (FlashMessages::getMessages() as $message) : ?>
74dd6b2bfcSGreg Roach                <div class="alert alert-<?= $message->status ?> alert-dismissible" role="alert">
75315eb316SGreg Roach                    <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="<?= I18N::translate('close') ?>">
76dd6b2bfcSGreg Roach                    </button>
77dd6b2bfcSGreg Roach                    <?= $message->text ?>
78dd6b2bfcSGreg Roach                </div>
79dd6b2bfcSGreg Roach            <?php endforeach ?>
80dd6b2bfcSGreg Roach
81dd6b2bfcSGreg Roach            <?= $content ?>
8243aac321SGreg Roach        </main>
8343aac321SGreg Roach
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('') ?>
93dd6b2bfcSGreg Roach    </body>
94dd6b2bfcSGreg Roach</html>
95