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