xref: /webtrees/resources/views/layouts/default.phtml (revision a992e8c1f5cff3fba48e8b69ec698e4e21142dc8)
16ccdf4f0SGreg Roach<?php
26ccdf4f0SGreg Roach
36ccdf4f0SGreg Roachuse Fisharebest\Webtrees\DebugBar;
46ccdf4f0SGreg Roachuse Fisharebest\Webtrees\FlashMessages;
56ccdf4f0SGreg Roachuse Fisharebest\Webtrees\I18N;
66ccdf4f0SGreg Roachuse Fisharebest\Webtrees\Module\ModuleFooterInterface;
76ccdf4f0SGreg Roachuse Fisharebest\Webtrees\Module\ModuleGlobalInterface;
86ccdf4f0SGreg Roachuse Fisharebest\Webtrees\Module\ModuleThemeInterface;
96ccdf4f0SGreg Roachuse Fisharebest\Webtrees\Services\ModuleService;
106ccdf4f0SGreg Roachuse Fisharebest\Webtrees\View;
116ccdf4f0SGreg Roachuse Fisharebest\Webtrees\Webtrees;
126ccdf4f0SGreg Roachuse Psr\Http\Message\ServerRequestInterface;
136ccdf4f0SGreg Roach
146ccdf4f0SGreg Roach/**
156ccdf4f0SGreg Roach * @var string $title
166ccdf4f0SGreg Roach * @var string $content
176ccdf4f0SGreg Roach */
186ccdf4f0SGreg Roach
196ccdf4f0SGreg Roach?>
20dd6b2bfcSGreg Roach
21dd6b2bfcSGreg Roach<!DOCTYPE html>
22e837ff07SGreg Roach<html dir="<?= I18N::direction() ?>" lang="<?= WT_LOCALE ?>">
23dd6b2bfcSGreg Roach    <head>
24dd6b2bfcSGreg Roach        <meta charset="UTF-8">
25dd6b2bfcSGreg Roach        <meta name="csrf" content="<?= e(csrf_token()) ?>">
26dd6b2bfcSGreg Roach        <meta name="viewport" content="width=device-width, initial-scale=1">
27377a2979SGreg Roach        <meta name="robots" content="<?= e($meta_robots ?? 'noindex') ?>">
288d0ebef0SGreg Roach        <meta name="generator" content="<?= e(Webtrees::NAME) ?> <?= e(Webtrees::VERSION) ?>">
29dd6b2bfcSGreg Roach        <?php if ($tree !== null) : ?>
30dd6b2bfcSGreg Roach            <meta name="description" content="<?= e($tree->getPreference('META_DESCRIPTION')) ?>">
31dd6b2bfcSGreg Roach        <?php endif ?>
32dd6b2bfcSGreg Roach
33dd6b2bfcSGreg Roach        <title>
34dd6b2bfcSGreg Roach            <?= strip_tags($title) ?>
35dd6b2bfcSGreg Roach            <?php if ($tree !== null && $tree->getPreference('META_TITLE') !== '') : ?>
36dd6b2bfcSGreg Roach<?= e($tree->getPreference('META_TITLE')) ?>
37dd6b2bfcSGreg Roach            <?php endif ?>
38dd6b2bfcSGreg Roach        </title>
39dd6b2bfcSGreg Roach
4052bcc402SGreg Roach        <!--Generic favicons-->
4152bcc402SGreg Roach        <link rel="icon" sizes="32x32" href="<?= e(asset('favicon-32.png')) ?>">
4252bcc402SGreg Roach        <link rel="icon" sizes="57x57" href="<?= e(asset('favicon-57.png')) ?>">
4352bcc402SGreg Roach        <link rel="icon" sizes="76x76" href="<?= e(asset('favicon-76.png')) ?>">
4452bcc402SGreg Roach        <link rel="icon" sizes="96x96" href="<?= e(asset('favicon-96.png')) ?>">
4552bcc402SGreg Roach        <link rel="icon" sizes="128x128" href="<?= e(asset('favicon-128.png')) ?>">
4652bcc402SGreg Roach        <link rel="icon" sizes="192x192" href="<?= e(asset('favicon-192.png')) ?>">
4752bcc402SGreg Roach        <!--Android-->
4890b733bfSGreg Roach        <link rel="shortcut icon" sizes="196x196" href="<?= e(asset('favicon-196.png')) ?>">
4952bcc402SGreg Roach        <!--iOS-->
5052bcc402SGreg Roach        <link rel="apple-touch-icon" sizes="120x120" href="<?= e(asset('favicon-120.png')) ?>">
5152bcc402SGreg Roach        <link rel="apple-touch-icon" sizes="152x152" href="<?= e(asset('favicon-152.png')) ?>">
5252bcc402SGreg Roach        <link rel="apple-touch-icon" sizes="180x180" href="<?= e(asset('favicon-180.png')) ?>">
5352bcc402SGreg Roach        <!--Windows 8 IE 10-->
5452bcc402SGreg Roach        <meta name="msapplication-TileColor" content="#FFFFFF">
5552bcc402SGreg Roach        <meta name="msapplication-TileImage" content="<?= e(asset('favicon-144.png')) ?>">
5652bcc402SGreg Roach        <!--Windows 8.1 + IE11 and above-->
5752bcc402SGreg Roach        <meta name="msapplication-config" content="<?= e(asset('browserconfig.xml')) ?>">
58dd6b2bfcSGreg Roach
59e837ff07SGreg Roach        <link rel="stylesheet" href="<?= e(asset('css/vendor.min.css')) ?>">
60cab242e7SGreg Roach        <?php foreach (app(ModuleThemeInterface::class)->stylesheets() as $stylesheet) : ?>
61e837ff07SGreg Roach            <link rel="stylesheet" href="<?= e($stylesheet) ?>">
62dd6b2bfcSGreg Roach        <?php endforeach ?>
63dd6b2bfcSGreg Roach
64dd6b2bfcSGreg Roach        <?= View::stack('styles') ?>
65dd6b2bfcSGreg Roach
660b5fd0a6SGreg Roach        <?= app(ModuleService::class)->findByInterface(ModuleGlobalInterface::class)->map(static function (ModuleGlobalInterface $module): string { return $module->headContent(); })->implode('') ?>
67dd6b2bfcSGreg Roach
68dd6b2bfcSGreg Roach        <?= DebugBar::renderHead() ?>
69dd6b2bfcSGreg Roach    </head>
70dd6b2bfcSGreg Roach
71a22c26f3SGreg Roach    <body class="wt-global wt-theme-<?= e(app(ModuleThemeInterface::class)->name()) ?> wt-route-<?= e(app(ServerRequestInterface::class)->getQueryParams()['route'] ?? 'unknown') ?>">
72dd6b2bfcSGreg Roach        <header class="wt-header-wrapper d-print-none">
73dd6b2bfcSGreg Roach            <div class="container wt-header-container">
74dd6b2bfcSGreg Roach                <div class="row wt-header-content">
7597c22350SGreg Roach                    <div class="wt-accessibility-links position-fixed">
76dd6b2bfcSGreg Roach                        <a class="sr-only sr-only-focusable btn btn-info btn-sm" href="#content">
776ccdf4f0SGreg Roach                            <?= /* I18N: Skip over the headers and menus, to the main content of the page */
786ccdf4f0SGreg Roach                            I18N::translate('Skip to content') ?>
79dd6b2bfcSGreg Roach                        </a>
80dd6b2bfcSGreg Roach                    </div>
81dd6b2bfcSGreg Roach                    <div class="col wt-site-logo"></div>
82dd6b2bfcSGreg Roach
83dd6b2bfcSGreg Roach                    <?php if ($tree !== null) : ?>
84cc13d6d8SGreg Roach                        <h1 class="col wt-site-title"><?= e($tree->title()) ?></h1>
85dd6b2bfcSGreg Roach
86dd6b2bfcSGreg Roach                        <div class="col wt-header-search">
87dd6b2bfcSGreg Roach                            <form class="wt-header-search-form" role="search">
88dd6b2bfcSGreg Roach                                <input type="hidden" name="route" value="search-quick">
89aa6f03bbSGreg Roach                                <input type="hidden" name="ged" value="<?= e($tree->name()) ?>">
90dd6b2bfcSGreg Roach                                <div class="input-group">
91dd6b2bfcSGreg Roach                                    <label class="sr-only" for="quick-search"><?= I18N::translate('Search') ?></label>
92dd6b2bfcSGreg Roach                                    <input type="search" class="form-control wt-header-search-field" id="quick-search" name="query" size="15" placeholder="<?= I18N::translate('Search') ?>">
93b6c326d8SGreg Roach                                    <div class="input-group-append">
94dd6b2bfcSGreg Roach                                        <button type="submit" class="btn btn-primary wt-header-search-button">
95dd6b2bfcSGreg Roach                                            <?= view('icons/search') ?>
96dd6b2bfcSGreg Roach                                        </button>
97b6c326d8SGreg Roach                                    </div>
98dd6b2bfcSGreg Roach                                </div>
99dd6b2bfcSGreg Roach                            </form>
100dd6b2bfcSGreg Roach                        </div>
101dd6b2bfcSGreg Roach                    <?php endif ?>
102dd6b2bfcSGreg Roach
103dd6b2bfcSGreg Roach                    <div class="col wt-secondary-navigation">
1040c8c69d4SGreg Roach                        <ul class="nav wt-user-menu">
105cab242e7SGreg Roach                            <?php foreach (app(ModuleThemeInterface::class)->userMenu($tree) as $menu) : ?>
106dd6b2bfcSGreg Roach                                <?= $menu->bootstrap4() ?>
107dd6b2bfcSGreg Roach                            <?php endforeach ?>
108dd6b2bfcSGreg Roach                        </ul>
109dd6b2bfcSGreg Roach                    </div>
110dd6b2bfcSGreg Roach
111dd6b2bfcSGreg Roach                    <?php if ($tree !== null) : ?>
112dd6b2bfcSGreg Roach                        <nav class="col wt-primary-navigation">
1130c8c69d4SGreg Roach                            <ul class="nav wt-genealogy-menu">
114cab242e7SGreg Roach                                <?php foreach (app(ModuleThemeInterface::class)->genealogyMenu($tree) as $menu) : ?>
115dd6b2bfcSGreg Roach                                    <?= $menu->bootstrap4() ?>
116dd6b2bfcSGreg Roach                                <?php endforeach ?>
117dd6b2bfcSGreg Roach                            </ul>
118dd6b2bfcSGreg Roach                        </nav>
119dd6b2bfcSGreg Roach                    <?php endif ?>
120dd6b2bfcSGreg Roach                </div>
121dd6b2bfcSGreg Roach            </div>
122dd6b2bfcSGreg Roach        </header>
123dd6b2bfcSGreg Roach
124dd6b2bfcSGreg Roach        <main id="content" class="wt-main-wrapper">
125dd6b2bfcSGreg Roach            <div class="container wt-main-container">
126dd6b2bfcSGreg Roach                <div class="flash-messages">
127dd6b2bfcSGreg Roach                    <?php foreach (FlashMessages::getMessages() as $message) : ?>
128dd6b2bfcSGreg Roach                        <div class="alert alert-<?= e($message->status) ?> alert-dismissible" role="alert">
129dd6b2bfcSGreg Roach                            <button type="button" class="close" data-dismiss="alert" aria-label="<?= I18N::translate('close') ?>">
130dd6b2bfcSGreg Roach                                <span aria-hidden="true">&times;</span>
131dd6b2bfcSGreg Roach                            </button>
132dd6b2bfcSGreg Roach                            <?= $message->text ?>
133dd6b2bfcSGreg Roach                        </div>
134dd6b2bfcSGreg Roach                    <?php endforeach ?>
135dd6b2bfcSGreg Roach                </div>
136dd6b2bfcSGreg Roach
137dd6b2bfcSGreg Roach                <?= $content ?>
138dd6b2bfcSGreg Roach            </div>
139dd6b2bfcSGreg Roach        </main>
140dd6b2bfcSGreg Roach
14197c22350SGreg Roach        <footer class="wt-footers container d-print-none">
142*a992e8c1SGreg Roach            <?= app(ModuleService::class)->findByInterface(ModuleFooterInterface::class)->map(static function (ModuleFooterInterface $module) use ($request): string { return $module->getFooter($request); })->implode('') ?>
143dd6b2bfcSGreg Roach        </footer>
144dd6b2bfcSGreg Roach
145ad727080SGreg Roach        <script src="<?= e(asset('js/vendor.min.js')) ?>"></script>
146ad727080SGreg Roach        <script src="<?= e(asset('js/webtrees.min.js')) ?>"></script>
147dd6b2bfcSGreg Roach
148dd6b2bfcSGreg Roach        <script>
149dd6b2bfcSGreg Roach            activate_colorbox();
150dd6b2bfcSGreg Roach            jQuery.extend(jQuery.colorbox.settings, {
151dd6b2bfcSGreg Roach                width:          "85%",
152dd6b2bfcSGreg Roach                height:         "85%",
153dd6b2bfcSGreg Roach                transition:     "none",
154dd6b2bfcSGreg Roach                slideshowStart: "<?= I18N::translate('Play') ?>",
155dd6b2bfcSGreg Roach                slideshowStop:  "<?= I18N::translate('Stop') ?>",
1566ccdf4f0SGreg Roach                title:          function () {
1576ccdf4f0SGreg Roach                    return this.dataset.title;
1586ccdf4f0SGreg Roach                },
159dd6b2bfcSGreg Roach            });
160dd6b2bfcSGreg Roach        </script>
161dd6b2bfcSGreg Roach
162dd6b2bfcSGreg Roach        <?= View::stack('javascript') ?>
163dd6b2bfcSGreg Roach
1640b5fd0a6SGreg Roach        <?= app(ModuleService::class)->findByInterface(ModuleGlobalInterface::class)->map(static function (ModuleGlobalInterface $module): string { return $module->bodyContent(); })->implode('') ?>
165abafa13cSGreg Roach
166dd6b2bfcSGreg Roach        <?= DebugBar::render() ?>
167dd6b2bfcSGreg Roach    </body>
168dd6b2bfcSGreg Roach</html>
169