xref: /webtrees/resources/views/layouts/default.phtml (revision d36fce8c366ca445c8c1cf949463b24454867d72)
16ccdf4f0SGreg Roach<?php
26ccdf4f0SGreg Roach
36ccdf4f0SGreg Roachuse Fisharebest\Webtrees\DebugBar;
46ccdf4f0SGreg Roachuse Fisharebest\Webtrees\FlashMessages;
5*d36fce8cSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\AppleTouchIconPng;
6*d36fce8cSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\BrowserconfigXml;
7f5402f3dSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\SearchQuickAction;
8439bf5cfSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\WebmanifestJson;
96ccdf4f0SGreg Roachuse Fisharebest\Webtrees\I18N;
106ccdf4f0SGreg Roachuse Fisharebest\Webtrees\Module\ModuleFooterInterface;
116ccdf4f0SGreg Roachuse Fisharebest\Webtrees\Module\ModuleGlobalInterface;
126ccdf4f0SGreg Roachuse Fisharebest\Webtrees\Module\ModuleThemeInterface;
136ccdf4f0SGreg Roachuse Fisharebest\Webtrees\Services\ModuleService;
14a907ae44SGreg Roachuse Fisharebest\Webtrees\Tree;
156ccdf4f0SGreg Roachuse Fisharebest\Webtrees\View;
166ccdf4f0SGreg Roachuse Fisharebest\Webtrees\Webtrees;
176ccdf4f0SGreg Roachuse Psr\Http\Message\ServerRequestInterface;
186ccdf4f0SGreg Roach
196ccdf4f0SGreg Roach/**
206ccdf4f0SGreg Roach * @var string                 $content
21a907ae44SGreg Roach * @var ServerRequestInterface $request
22a907ae44SGreg Roach * @var string                 $title
23a907ae44SGreg Roach * @var Tree                   $tree
246ccdf4f0SGreg Roach */
256ccdf4f0SGreg Roach
266ccdf4f0SGreg Roach?>
27dd6b2bfcSGreg Roach
28dd6b2bfcSGreg Roach<!DOCTYPE html>
2965cf5706SGreg Roach<html dir="<?= I18N::locale()->direction() ?>" lang="<?= I18N::locale()->languageTag() ?>">
30dd6b2bfcSGreg Roach    <head>
31dd6b2bfcSGreg Roach        <meta charset="UTF-8">
32dd6b2bfcSGreg Roach        <meta name="csrf" content="<?= e(csrf_token()) ?>">
33dd6b2bfcSGreg Roach        <meta name="viewport" content="width=device-width, initial-scale=1">
34377a2979SGreg Roach        <meta name="robots" content="<?= e($meta_robots ?? 'noindex') ?>">
358d0ebef0SGreg Roach        <meta name="generator" content="<?= e(Webtrees::NAME) ?> <?= e(Webtrees::VERSION) ?>">
362406e0e0SGreg Roach        <meta name="description" content="<?= $meta_description ?? '' ?>">
37dd6b2bfcSGreg Roach
38dd6b2bfcSGreg Roach        <title>
39dd6b2bfcSGreg Roach            <?= strip_tags($title) ?>
40dd6b2bfcSGreg Roach            <?php if ($tree !== null && $tree->getPreference('META_TITLE') !== '') : ?>
41dd6b2bfcSGreg Roach<?= e($tree->getPreference('META_TITLE')) ?>
42dd6b2bfcSGreg Roach            <?php endif ?>
43dd6b2bfcSGreg Roach        </title>
44dd6b2bfcSGreg Roach
45a951c2d0SGreg Roach        <!--iOS-->
46*d36fce8cSGreg Roach        <link rel="apple-touch-icon" sizes="180x180" href="<?= e(route(AppleTouchIconPng::class)) ?>">
4752bcc402SGreg Roach        <!--Generic favicons-->
4852bcc402SGreg Roach        <link rel="icon" sizes="32x32" href="<?= e(asset('favicon-32.png')) ?>">
4952bcc402SGreg Roach        <link rel="icon" sizes="192x192" href="<?= e(asset('favicon-192.png')) ?>">
500601cabdSGreg Roach        <!--IE11/Edge-->
51*d36fce8cSGreg Roach        <meta name="msapplication-config" content="<?= e(route(BrowserconfigXml::class)) ?>">
52dd6b2bfcSGreg Roach
53439bf5cfSGreg Roach        <link rel="manifest" href="<?= e(route(WebmanifestJson::class)) ?>">
54c4d12d2bSGreg Roach
55e837ff07SGreg Roach        <link rel="stylesheet" href="<?= e(asset('css/vendor.min.css')) ?>">
56cab242e7SGreg Roach        <?php foreach (app(ModuleThemeInterface::class)->stylesheets() as $stylesheet) : ?>
57e837ff07SGreg Roach            <link rel="stylesheet" href="<?= e($stylesheet) ?>">
58dd6b2bfcSGreg Roach        <?php endforeach ?>
59dd6b2bfcSGreg Roach
60dd6b2bfcSGreg Roach        <?= View::stack('styles') ?>
61dd6b2bfcSGreg Roach
62d70512abSGreg Roach        <?= app(ModuleService::class)->findByInterface(ModuleGlobalInterface::class)->map(static function (ModuleGlobalInterface $module): string {
63d70512abSGreg Roach            return $module->headContent();
64d70512abSGreg Roach        })->implode('') ?>
65dd6b2bfcSGreg Roach
66dd6b2bfcSGreg Roach        <?= DebugBar::renderHead() ?>
67dd6b2bfcSGreg Roach    </head>
68dd6b2bfcSGreg Roach
69a907ae44SGreg Roach    <body class="wt-global wt-theme-<?= e(app(ModuleThemeInterface::class)->name()) ?> wt-route-<?= e(substr(strrchr($request->getAttribute('route')->name, '\\'),1)) ?>">
70dd6b2bfcSGreg Roach        <header class="wt-header-wrapper d-print-none">
7116543441SGreg Roach            <div class="container-lg wt-header-container">
72dd6b2bfcSGreg Roach                <div class="row wt-header-content">
7397c22350SGreg Roach                    <div class="wt-accessibility-links position-fixed">
74dd6b2bfcSGreg Roach                        <a class="sr-only sr-only-focusable btn btn-info btn-sm" href="#content">
756ccdf4f0SGreg Roach                            <?= /* I18N: Skip over the headers and menus, to the main content of the page */
766ccdf4f0SGreg Roach                            I18N::translate('Skip to content') ?>
77dd6b2bfcSGreg Roach                        </a>
78dd6b2bfcSGreg Roach                    </div>
79dd6b2bfcSGreg Roach                    <div class="col wt-site-logo"></div>
80dd6b2bfcSGreg Roach
81dd6b2bfcSGreg Roach                    <?php if ($tree !== null) : ?>
82cc13d6d8SGreg Roach                        <h1 class="col wt-site-title"><?= e($tree->title()) ?></h1>
83dd6b2bfcSGreg Roach
84dd6b2bfcSGreg Roach                        <div class="col wt-header-search">
85a907ae44SGreg Roach                            <form method="post"
86a907ae44SGreg Roach                                  action="<?= e(route(SearchQuickAction::class, ['tree' => $tree->name()])) ?>"
87a907ae44SGreg Roach                                  class="wt-header-search-form" role="search">
88d1fc782cSGreg Roach                                <?= csrf_field() ?>
89dd6b2bfcSGreg Roach                                <div class="input-group">
90dd6b2bfcSGreg Roach                                    <label class="sr-only" for="quick-search"><?= I18N::translate('Search') ?></label>
91a907ae44SGreg Roach                                    <input type="search" class="form-control wt-header-search-field" id="quick-search"
92a907ae44SGreg Roach                                           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) : ?>
106f78837dcSGreg Roach                                <?= view('components/menu-item', ['menu' => $menu]) ?>
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) : ?>
115f78837dcSGreg Roach                                    <?= view('components/menu-item', ['menu' => $menu]) ?>
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">
12516543441SGreg Roach            <div class="container-lg 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">
129a907ae44SGreg Roach                            <button type="button" class="close" data-dismiss="alert"
130a907ae44SGreg Roach                                    aria-label="<?= I18N::translate('close') ?>">
131dd6b2bfcSGreg Roach                                <span aria-hidden="true">&times;</span>
132dd6b2bfcSGreg Roach                            </button>
133dd6b2bfcSGreg Roach                            <?= $message->text ?>
134dd6b2bfcSGreg Roach                        </div>
135dd6b2bfcSGreg Roach                    <?php endforeach ?>
136dd6b2bfcSGreg Roach                </div>
137dd6b2bfcSGreg Roach
138dd6b2bfcSGreg Roach                <?= $content ?>
139dd6b2bfcSGreg Roach            </div>
140dd6b2bfcSGreg Roach        </main>
141dd6b2bfcSGreg Roach
14216543441SGreg Roach        <footer class="container-lg wt-footers d-print-none">
143d70512abSGreg Roach            <?= app(ModuleService::class)->findByInterface(ModuleFooterInterface::class)->map(static function (ModuleFooterInterface $module) use ($request): string {
144d70512abSGreg Roach                return $module->getFooter($request);
145d70512abSGreg Roach            })->implode('') ?>
146dd6b2bfcSGreg Roach        </footer>
147dd6b2bfcSGreg Roach
148ad727080SGreg Roach        <script src="<?= e(asset('js/vendor.min.js')) ?>"></script>
149ad727080SGreg Roach        <script src="<?= e(asset('js/webtrees.min.js')) ?>"></script>
150dd6b2bfcSGreg Roach
151dd6b2bfcSGreg Roach        <script>
152cee51dfdSGreg Roach            // Trigger an event when we click on an (any) image
153cee51dfdSGreg Roach            $('body').on('click', 'a.gallery', function () {
154cee51dfdSGreg Roach                // Enable colorbox for images
155cee51dfdSGreg Roach                $("a[type^=image].gallery").colorbox({
156cee51dfdSGreg Roach                    // Don't scroll window with document
157cee51dfdSGreg Roach                    fixed: true,
158dd6b2bfcSGreg Roach                    width: "85%",
159dd6b2bfcSGreg Roach                    height: "85%",
160cee51dfdSGreg Roach                    current: "",
161cee51dfdSGreg Roach                    previous: '<i class="fas fa-arrow-left wt-icon-flip-rtl" title="<?= I18N::translate('previous') ?>"></i>',
162cee51dfdSGreg Roach                    next: '<i class="fas fa-arrow-right wt-icon-flip-rtl" title="<?= I18N::translate('next') ?>"></i>',
163cee51dfdSGreg Roach                    slideshowStart: '<i class="fas fa-play" title="<?= I18N::translate('Play') ?>"></i>',
164cee51dfdSGreg Roach                    slideshowStop: '<i class="fas fa-stop" title="<?= I18N::translate('Stop') ?>"></i>',
165cee51dfdSGreg Roach                    close: '<i class="fas fa-times" title="<?= I18N::translate('close') ?>"></i>',
1666ccdf4f0SGreg Roach                    title: function () {
1676ccdf4f0SGreg Roach                        return this.dataset.title;
1686ccdf4f0SGreg Roach                    },
169cee51dfdSGreg Roach                    photo: true,
170cee51dfdSGreg Roach                    rel: "gallery", // Turn all images on the page into a slideshow
171cee51dfdSGreg Roach                    slideshow: true,
172cee51dfdSGreg Roach                    slideshowAuto: false,
173cee51dfdSGreg Roach                    // Add wheelzoom to the displayed image
174cee51dfdSGreg Roach                    onComplete: function () {
175cee51dfdSGreg Roach                        // Disable click on image triggering next image
176cee51dfdSGreg Roach                        // https://github.com/jackmoore/colorbox/issues/668
177cee51dfdSGreg Roach                        $(".cboxPhoto").unbind("click");
1783cf811e8SGreg Roach                        // Enable wheel/pinch zooming
1793cf811e8SGreg Roach                        $('.cboxPhoto').wrap("<pinch-zoom></pinch-zoom>");
180cee51dfdSGreg Roach                    }
181cee51dfdSGreg Roach                });
182dd6b2bfcSGreg Roach            });
183dd6b2bfcSGreg Roach        </script>
184dd6b2bfcSGreg Roach
185dd6b2bfcSGreg Roach        <?= View::stack('javascript') ?>
186dd6b2bfcSGreg Roach
187d70512abSGreg Roach        <?= app(ModuleService::class)->findByInterface(ModuleGlobalInterface::class)->map(static function (ModuleGlobalInterface $module): string {
188d70512abSGreg Roach            return $module->bodyContent();
189d70512abSGreg Roach        })->implode('') ?>
190abafa13cSGreg Roach
191dd6b2bfcSGreg Roach        <?= DebugBar::render() ?>
192dd6b2bfcSGreg Roach    </body>
193dd6b2bfcSGreg Roach</html>
194