xref: /webtrees/resources/views/admin/clean-data.phtml (revision 58c781b3c055e42036269e115fb5a3c4643b0df4)
1<?php
2
3use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
4use Fisharebest\Webtrees\Http\RequestHandlers\DeletePath;
5use Fisharebest\Webtrees\I18N;
6
7/**
8 * @var array<string> $entries
9 * @var array<string> $protected
10 * @var string        $title
11 */
12
13?>
14
15<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), $title]]) ?>
16
17<h1><?= $title ?></h1>
18
19<p>
20    <?= I18N::translate('Files marked with %s are required for proper operation and cannot be removed.', view('icons/ban')) ?>
21</p>
22
23<form method="post">
24    <input type="hidden" value="admin-clean-data">
25
26    <ul class="fa-ul mx-0">
27        <?php foreach ($entries as $entry) : ?>
28            <li>
29                <?php if (substr_compare($entry, '/', -1) === 0) : ?>
30                    <?= view('icons/folder') ?>
31                <?php else : ?>
32                     <?= view('icons/file') ?>
33                <?php endif ?>
34                <?= e($entry) ?>
35                <?php if (in_array($entry, $protected, true)) : ?>
36                    <?= view('icons/ban') ?>
37                <?php else : ?>
38                    <a
39                        href="#"
40                        data-wt-confirm="<?= I18N::translate('Are you sure you want to delete “%s”?', e($entry)) ?>"
41                        data-wt-post-url="<?= e(route(DeletePath::class, ['path' => $entry])) ?>"
42                        class="btn btn-sm btn-link"
43                    >
44                        <?= view('icons/delete') ?>
45                        <span class="visually-hidden"><?= I18N::translate('delete') ?></span>
46                    </a>
47                <?php endif ?>
48            </li>
49        <?php endforeach ?>
50    </ul>
51
52    <?= csrf_field() ?>
53</form>
54