xref: /webtrees/resources/views/admin/modules.phtml (revision 9e5cb8c9c4992a543a6e21f7ba387f3b275fa389)
1dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\Bootstrap4; ?>
2dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\I18N; ?>
3*9e5cb8c9SGreg Roach<?php use Fisharebest\Webtrees\Module\ModuleAnalyticsInterface; ?>
4dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\Module\ModuleBlockInterface; ?>
5dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\Module\ModuleChartInterface; ?>
6dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\Module\ModuleConfigInterface; ?>
79cad7645SGreg Roach<?php use Fisharebest\Webtrees\Module\ModuleCustomInterface; ?>
8dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\Module\ModuleMenuInterface; ?>
9dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\Module\ModuleReportInterface; ?>
10dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\Module\ModuleSidebarInterface; ?>
11dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\Module\ModuleTabInterface; ?>
12dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\Module\ModuleThemeInterface; ?>
13dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\View; ?>
14dd6b2bfcSGreg Roach
15dd6b2bfcSGreg Roach<?= view('components/breadcrumbs', ['links' => [route('admin-control-panel') => I18N::translate('Control panel'), $title]]) ?>
16dd6b2bfcSGreg Roach
17dd6b2bfcSGreg Roach<h1><?= $title ?></h1>
18dd6b2bfcSGreg Roach
19dd6b2bfcSGreg Roach<?php foreach ($deleted_modules as $module_name) : ?>
20dd6b2bfcSGreg Roach    <div class="alert alert-warning" role="alert">
21244d9cdfSGreg Roach        <form action="<?= e(route('delete-module-settings')) ?>" class="form-inline" method="POST">
22dd6b2bfcSGreg Roach            <?= csrf_field() ?>
23dd6b2bfcSGreg Roach            <input type="hidden" name="module_name" value="<?= $module_name ?>">
24dd6b2bfcSGreg Roach            <?= I18N::translate('Preferences exist for the module “%s”, but this module no longer exists.', $module_name) ?>
25dd6b2bfcSGreg Roach            <button type="submit" class="btn btn-secondary text-wrap">
26dd6b2bfcSGreg Roach                <?= I18N::translate('Delete the preferences for this module.') ?>
27dd6b2bfcSGreg Roach            </button>
28dd6b2bfcSGreg Roach            </form>
29dd6b2bfcSGreg Roach    </div>
30dd6b2bfcSGreg Roach<?php endforeach ?>
31dd6b2bfcSGreg Roach
32f70ab68bSGreg Roach<form method="POST">
33dd6b2bfcSGreg Roach    <input type="hidden" name="route" value="admin-update-module-status">
34dd6b2bfcSGreg Roach    <?= csrf_field() ?>
35dd6b2bfcSGreg Roach    <table class="table table-bordered table-hover table-sm table-module-administration" data-info="false" data-paging="false" data-state-save="true">
36dd6b2bfcSGreg Roach        <caption class="sr-only">
37dd6b2bfcSGreg Roach            <?= I18N::translate('Module administration') ?>
38dd6b2bfcSGreg Roach        </caption>
39dd6b2bfcSGreg Roach        <thead>
40dd6b2bfcSGreg Roach            <tr>
41dd6b2bfcSGreg Roach                <th>
42dd6b2bfcSGreg Roach                    <?= I18N::translate('Module') ?>
43dd6b2bfcSGreg Roach                </th>
44dd6b2bfcSGreg Roach                <th>
45dd6b2bfcSGreg Roach                    <?= I18N::translate('Enabled') ?>
46dd6b2bfcSGreg Roach                </th>
470cb66f86SGreg Roach                <th data-orderable="false">
48dd6b2bfcSGreg Roach                    <?= I18N::translate('Description') ?>
49dd6b2bfcSGreg Roach                </th>
500cb66f86SGreg Roach                <th title="<?= I18N::translate('Preferences') ?>">
510cb66f86SGreg Roach                    <?= view('icons/preferences') ?>
520cb66f86SGreg Roach                    <span class="sr-only"><?= I18N::translate('Preferences') ?></span>
53dd6b2bfcSGreg Roach                </th>
540cb66f86SGreg Roach                <th title="<?= I18N::translate('Menus') ?>">
550cb66f86SGreg Roach                    <?= view('icons/menu') ?>
560cb66f86SGreg Roach                    <span class="sr-only"><?= I18N::translate('Menus') ?></span>
57dd6b2bfcSGreg Roach                </th>
580cb66f86SGreg Roach                <th title="<?= I18N::translate('Tabs') ?>">
590cb66f86SGreg Roach                    <?= view('icons/tab') ?>
600cb66f86SGreg Roach                    <span class="sr-only"><?= I18N::translate('Tabs') ?></span>
61dd6b2bfcSGreg Roach                </th>
620cb66f86SGreg Roach                <th title="<?= I18N::translate('Sidebars') ?>">
630cb66f86SGreg Roach                    <?= view('icons/sidebar') ?>
640cb66f86SGreg Roach                    <span class="sr-only"><?= I18N::translate('Sidebars') ?></span>
65dd6b2bfcSGreg Roach                </th>
660cb66f86SGreg Roach                <th title="<?= I18N::translate('Blocks') ?>">
670cb66f86SGreg Roach                    <?= view('icons/block') ?>
680cb66f86SGreg Roach                    <span class="sr-only"><?= I18N::translate('Blocks') ?></span>
69dd6b2bfcSGreg Roach                </th>
700cb66f86SGreg Roach                <th title="<?= I18N::translate('Charts') ?>">
710cb66f86SGreg Roach                    <?= view('icons/chart') ?>
720cb66f86SGreg Roach                    <span class="sr-only"><?= I18N::translate('Charts') ?></span>
73dd6b2bfcSGreg Roach                </th>
740cb66f86SGreg Roach                <th title="<?= I18N::translate('Reports') ?>">
750cb66f86SGreg Roach                    <?= view('icons/report') ?>
760cb66f86SGreg Roach                    <span class="sr-only"><?= I18N::translate('Reports') ?></span>
77dd6b2bfcSGreg Roach                </th>
78*9e5cb8c9SGreg Roach                <th title="<?= I18N::translate('Tracking and analytics') ?>">
79*9e5cb8c9SGreg Roach                    <?= view('icons/analytics') ?>
80*9e5cb8c9SGreg Roach                    <span class="sr-only"><?= I18N::translate('Tracking and analytics') ?></span>
81*9e5cb8c9SGreg Roach                </th>
820cb66f86SGreg Roach                <th class="d-none" title="<?= I18N::translate('Themes') ?>">
830cb66f86SGreg Roach                    <?= view('icons/theme') ?>
840cb66f86SGreg Roach                    <span class="sr-only"><?= I18N::translate('Themes') ?></span>
85dd6b2bfcSGreg Roach                </th>
86dd6b2bfcSGreg Roach            </tr>
87dd6b2bfcSGreg Roach        </thead>
880cb66f86SGreg Roach
89dd6b2bfcSGreg Roach        <tbody>
9049a243cbSGreg Roach            <?php foreach ($modules as $module) : ?>
91dd6b2bfcSGreg Roach                <tr>
920cb66f86SGreg Roach                    <th scope="row" dir="auto">
9349a243cbSGreg Roach                        <?= $module->title() ?>
94dd6b2bfcSGreg Roach                    </th>
9549a243cbSGreg Roach                    <td class="text-center" data-sort="<?= $module->isEnabled() ?>">
96677aaceaSGreg Roach                        <?= Bootstrap4::checkbox('', false, ['name' => 'status-' . $module->name(), 'checked' => $module->isEnabled()]) ?>
97dd6b2bfcSGreg Roach                    </td>
980cb66f86SGreg Roach                    <td>
9949a243cbSGreg Roach                        <?= $module->description() ?>
1009cad7645SGreg Roach                        <?php if ($module instanceof ModuleCustomInterface) : ?>
101dd6b2bfcSGreg Roach                            <br>
102dd6b2bfcSGreg Roach                            <?= view('icons/warning') ?>
103dd6b2bfcSGreg Roach                            <?= I18N::translate('Custom module') ?>
104dd6b2bfcSGreg Roach                            <?php if ($module::CUSTOM_VERSION) : ?>
105dd6b2bfcSGreg Roach                                - <?= I18N::translate('Version') ?> <?= $module::CUSTOM_VERSION ?>
106dd6b2bfcSGreg Roach                            <?php endif ?>
107dd6b2bfcSGreg Roach                            <?php if ($module::CUSTOM_WEBSITE) : ?>
108dd6b2bfcSGreg Roach                                - <a href="<?= $module::CUSTOM_WEBSITE ?>">
109dd6b2bfcSGreg Roach                                    <?= $module::CUSTOM_WEBSITE ?>
110dd6b2bfcSGreg Roach                                </a>
111dd6b2bfcSGreg Roach                            <?php endif ?>
112dd6b2bfcSGreg Roach                        <?php endif ?>
113dd6b2bfcSGreg Roach                    </td>
1140cb66f86SGreg Roach                    <td class="text-center text-muted" title="<?= I18N::translate('Preferences') ?>">
1150cb66f86SGreg Roach                        <?php if ($module instanceof ModuleConfigInterface) : ?>
1160cb66f86SGreg Roach                            <a href="<?= e($module->getConfigLink()) ?>" title="<?= I18N::translate('Preferences') ?>">
1170cb66f86SGreg Roach                                <?= view('icons/preferences') ?>
1180cb66f86SGreg Roach                                <span class="sr-only">
1190cb66f86SGreg Roach                                    <?= I18N::translate('Preferences') ?>
1200cb66f86SGreg Roach                                </span>
1210cb66f86SGreg Roach                            </a>
1220cb66f86SGreg Roach                        <?php endif ?>
1230cb66f86SGreg Roach                    </td>
1240cb66f86SGreg Roach                    <td class="text-center text-muted" title="<?= I18N::translate('Menu') ?>">
125dd6b2bfcSGreg Roach                        <?php if ($module instanceof ModuleMenuInterface) : ?>
126dd6b2bfcSGreg Roach                            <?= view('icons/menu') ?>
127dd6b2bfcSGreg Roach                            <span class="sr-only"><?= I18N::translate('Menu') ?></span>
128dd6b2bfcSGreg Roach                        <?php else : ?>
129dd6b2bfcSGreg Roach                            -
130dd6b2bfcSGreg Roach                        <?php endif ?>
131dd6b2bfcSGreg Roach                    </td>
1320cb66f86SGreg Roach                    <td class="text-center text-muted" title="<?= I18N::translate('Tab') ?>">
133dd6b2bfcSGreg Roach                        <?php if ($module instanceof ModuleTabInterface) : ?>
134dd6b2bfcSGreg Roach                            <?= view('icons/tab') ?>
135dd6b2bfcSGreg Roach                            <span class="sr-only"><?= I18N::translate('Tab') ?></span>
1360cb66f86SGreg Roach                        <?php else : ?>
1370cb66f86SGreg Roach                            -
138dd6b2bfcSGreg Roach                        <?php endif ?>
1390cb66f86SGreg Roach                    </td>
1400cb66f86SGreg Roach                    <td class="text-center text-muted" title="<?= I18N::translate('Sidebar') ?>">
141dd6b2bfcSGreg Roach                        <?php if ($module instanceof ModuleSidebarInterface) : ?>
142dd6b2bfcSGreg Roach                            <?= view('icons/sidebar') ?>
143dd6b2bfcSGreg Roach                            <span class="sr-only"><?= I18N::translate('Sidebar') ?></span>
1440cb66f86SGreg Roach                        <?php else : ?>
1450cb66f86SGreg Roach                            -
146dd6b2bfcSGreg Roach                        <?php endif ?>
1470cb66f86SGreg Roach                    </td>
1480cb66f86SGreg Roach                    <td class="text-center text-muted">
1490cb66f86SGreg Roach                        <?php if ($module instanceof ModuleBlockInterface) : ?>
1500cb66f86SGreg Roach                            <?php if ($module->isUserBlock()) : ?>
1510cb66f86SGreg Roach                                <span title="<?= I18N::translate('My page') ?>">
152dd6b2bfcSGreg Roach                                    <?= view('icons/block-user') ?>
1530cb66f86SGreg Roach                                </span>
1540cb66f86SGreg Roach                                <span class="sr-only">
1550cb66f86SGreg Roach                                    <?= I18N::translate('My page') ?>
1560cb66f86SGreg Roach                                </span>
157dd6b2bfcSGreg Roach                            <?php endif ?>
1580cb66f86SGreg Roach
1590cb66f86SGreg Roach                            <?php if ($module->isTreeBlock()) : ?>
1600cb66f86SGreg Roach                                <span title="<?= I18N::translate('Home page') ?>">
161dd6b2bfcSGreg Roach                                    <?= view('icons/block-tree') ?>
1620cb66f86SGreg Roach                                </span>
1630cb66f86SGreg Roach                                <span class="sr-only">
1640cb66f86SGreg Roach                                    <?= I18N::translate('Home page') ?>
1650cb66f86SGreg Roach                                </span>
166dd6b2bfcSGreg Roach                            <?php endif ?>
1670cb66f86SGreg Roach                        <?php else : ?>
1680cb66f86SGreg Roach                            -
1690cb66f86SGreg Roach                        <?php endif ?>
1700cb66f86SGreg Roach                    </td>
1710cb66f86SGreg Roach                    <td class="text-center text-muted" title="<?= I18N::translate('Chart') ?>">
172dd6b2bfcSGreg Roach                        <?php if ($module instanceof ModuleChartInterface) : ?>
173dd6b2bfcSGreg Roach                            <?= view('icons/chart') ?>
174dd6b2bfcSGreg Roach                            <span class="sr-only"><?= I18N::translate('Chart') ?></span>
1750cb66f86SGreg Roach                        <?php else : ?>
1760cb66f86SGreg Roach                            -
177dd6b2bfcSGreg Roach                        <?php endif ?>
1780cb66f86SGreg Roach                    </td>
1790cb66f86SGreg Roach                    <td class="text-center text-muted" title="<?= I18N::translate('Report') ?>">
180dd6b2bfcSGreg Roach                        <?php if ($module instanceof ModuleReportInterface) : ?>
181dd6b2bfcSGreg Roach                            <?= view('icons/report') ?>
182dd6b2bfcSGreg Roach                            <span class="sr-only"><?= I18N::translate('Report') ?></span>
1830cb66f86SGreg Roach                        <?php else : ?>
1840cb66f86SGreg Roach                            -
185dd6b2bfcSGreg Roach                        <?php endif ?>
1860cb66f86SGreg Roach                    </td>
187*9e5cb8c9SGreg Roach                    <td class="text-center text-muted" title="<?= I18N::translate('Tracking and analytics') ?>">
188*9e5cb8c9SGreg Roach                        <?php if ($module instanceof ModuleAnalyticsInterface) : ?>
189*9e5cb8c9SGreg Roach                            <?= view('icons/analytics') ?>
190*9e5cb8c9SGreg Roach                            <span class="sr-only"><?= I18N::translate('Tracking and analytics') ?></span>
191*9e5cb8c9SGreg Roach                        <?php else : ?>
192*9e5cb8c9SGreg Roach                            -
193*9e5cb8c9SGreg Roach                        <?php endif ?>
194*9e5cb8c9SGreg Roach                    </td>
1950cb66f86SGreg Roach                    <td class="text-center text-muted d-none" title="<?= I18N::translate('Theme') ?>">
196dd6b2bfcSGreg Roach                        <?php if ($module instanceof ModuleThemeInterface) : ?>
197dd6b2bfcSGreg Roach                            <?= view('icons/theme') ?>
198dd6b2bfcSGreg Roach                            <span class="sr-only"><?= I18N::translate('Theme') ?></span>
1990cb66f86SGreg Roach                        <?php else : ?>
2000cb66f86SGreg Roach                            -
201dd6b2bfcSGreg Roach                        <?php endif ?>
202dd6b2bfcSGreg Roach                    </td>
203dd6b2bfcSGreg Roach                </tr>
204dd6b2bfcSGreg Roach            <?php endforeach ?>
205dd6b2bfcSGreg Roach        </tbody>
206dd6b2bfcSGreg Roach    </table>
207dd6b2bfcSGreg Roach    <button class="btn btn-primary" type="submit">
208dd6b2bfcSGreg Roach        <?= view('icons/save') ?>
209dd6b2bfcSGreg Roach        <?= I18N::translate('save') ?></button>
210dd6b2bfcSGreg Roach</form>
211dd6b2bfcSGreg Roach
212dd6b2bfcSGreg Roach<?php View::push('javascript') ?>
213dd6b2bfcSGreg Roach<script>
214dd6b2bfcSGreg Roach  'use strict';
215dd6b2bfcSGreg Roach
216dd6b2bfcSGreg Roach  $(".table-module-administration").dataTable({<?= I18N::datatablesI18N() ?>});
217dd6b2bfcSGreg Roach</script>
218dd6b2bfcSGreg Roach<?php View::endpush() ?>
219