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