xref: /webtrees/resources/views/modules/privacy-policy/footer.phtml (revision 10e0649788c8d7d4974d81c048ca2b225df8f22e)
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 py-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" id="cookie-warning">
23            <?= I18N::translate('This website uses cookies to learn about visitor behavior.') ?>
24
25            <button type="button" id="cookie-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("cookie-warning").classList.add("show");
33                }
34                document.getElementById("cookie-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