xref: /webtrees/resources/views/modules/privacy-policy/footer.phtml (revision 4a9a60957058ca2a34e30a0d6f783e1540606590)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\I18N;
6use Fisharebest\Webtrees\Tree;
7use Fisharebest\Webtrees\View;
8
9/**
10 * @var Tree $tree
11 * @var bool $uses_analytics
12 */
13
14?>
15
16<div class="wt-footer wt-footer-privacy-policy text-center my-2">
17    <a href="<?= e(route('module', ['module' => 'privacy-policy', 'action' => 'Page', 'tree' => $tree->name()])) ?>">
18        <?= I18N::translate('Privacy policy') ?>
19    </a>
20
21    <?php if ($uses_analytics) : ?>
22        <div class="alert alert-info alert-dismissible fade collapse mb-0" id="privacy-warning">
23            <?= I18N::translate('This website uses cookies to learn about visitor behavior.') ?>
24
25            <button type="button" id="privacy-warning-button" class="btn-close" data-bs-dismiss="alert" aria-label="<?= I18N::translate('close') ?>">
26            </button>
27        </div>
28
29        <?php View::push('javascript') ?>
30            <script>
31                if (localStorage.getItem("cookie-warning") !== "ok") {
32                    document.getElementById("privacy-warning").classList.add("show");
33                }
34                document.getElementById("privacy-warning-button").addEventListener("click", function () {
35                    localStorage.setItem("cookie-warning", "ok");
36                });
37            </script>
38        <?php View::endpush() ?>
39    <?php endif ?>
40</div>
41
42
43