xref: /webtrees/resources/views/admin/modules.phtml (revision f3244202e6616ebc53cb830c32604bacdd56af4d)
1dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\Bootstrap4; ?>
2dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\I18N; ?>
39e5cb8c9SGreg 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; ?>
833c34396SGreg Roach<?php use Fisharebest\Webtrees\Module\ModuleFooterInterface; ?>
9*f3244202SGreg Roach<?php use Fisharebest\Webtrees\Module\ModuleHistoricEventsInterface; ?>
10dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\Module\ModuleMenuInterface; ?>
11dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\Module\ModuleReportInterface; ?>
12dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\Module\ModuleSidebarInterface; ?>
13dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\Module\ModuleTabInterface; ?>
14dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\Module\ModuleThemeInterface; ?>
15dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\View; ?>
16dd6b2bfcSGreg Roach
17dd6b2bfcSGreg Roach<?= view('components/breadcrumbs', ['links' => [route('admin-control-panel') => I18N::translate('Control panel'), $title]]) ?>
18dd6b2bfcSGreg Roach
19dd6b2bfcSGreg Roach<h1><?= $title ?></h1>
20dd6b2bfcSGreg Roach
21dd6b2bfcSGreg Roach<?php foreach ($deleted_modules as $module_name) : ?>
22dd6b2bfcSGreg Roach    <div class="alert alert-warning" role="alert">
23244d9cdfSGreg Roach        <form action="<?= e(route('delete-module-settings')) ?>" class="form-inline" method="POST">
24dd6b2bfcSGreg Roach            <?= csrf_field() ?>
25dd6b2bfcSGreg Roach            <input type="hidden" name="module_name" value="<?= $module_name ?>">
26dd6b2bfcSGreg Roach            <?= I18N::translate('Preferences exist for the module “%s”, but this module no longer exists.', $module_name) ?>
27dd6b2bfcSGreg Roach            <button type="submit" class="btn btn-secondary text-wrap">
28dd6b2bfcSGreg Roach                <?= I18N::translate('Delete the preferences for this module.') ?>
29dd6b2bfcSGreg Roach            </button>
30dd6b2bfcSGreg Roach            </form>
31dd6b2bfcSGreg Roach    </div>
32dd6b2bfcSGreg Roach<?php endforeach ?>
33dd6b2bfcSGreg Roach
34f70ab68bSGreg Roach<form method="POST">
35dd6b2bfcSGreg Roach    <input type="hidden" name="route" value="admin-update-module-status">
36dd6b2bfcSGreg Roach    <?= csrf_field() ?>
37dd6b2bfcSGreg Roach    <table class="table table-bordered table-hover table-sm table-module-administration" data-info="false" data-paging="false" data-state-save="true">
38dd6b2bfcSGreg Roach        <caption class="sr-only">
39dd6b2bfcSGreg Roach            <?= I18N::translate('Module administration') ?>
40dd6b2bfcSGreg Roach        </caption>
41dd6b2bfcSGreg Roach        <thead>
42dd6b2bfcSGreg Roach            <tr>
43dd6b2bfcSGreg Roach                <th>
44dd6b2bfcSGreg Roach                    <?= I18N::translate('Module') ?>
45dd6b2bfcSGreg Roach                </th>
46dd6b2bfcSGreg Roach                <th>
47dd6b2bfcSGreg Roach                    <?= I18N::translate('Enabled') ?>
48dd6b2bfcSGreg Roach                </th>
490cb66f86SGreg Roach                <th data-orderable="false">
50dd6b2bfcSGreg Roach                    <?= I18N::translate('Description') ?>
51dd6b2bfcSGreg Roach                </th>
520cb66f86SGreg Roach                <th title="<?= I18N::translate('Preferences') ?>">
530cb66f86SGreg Roach                    <?= view('icons/preferences') ?>
540cb66f86SGreg Roach                    <span class="sr-only"><?= I18N::translate('Preferences') ?></span>
55dd6b2bfcSGreg Roach                </th>
560cb66f86SGreg Roach                <th title="<?= I18N::translate('Menus') ?>">
570cb66f86SGreg Roach                    <?= view('icons/menu') ?>
580cb66f86SGreg Roach                    <span class="sr-only"><?= I18N::translate('Menus') ?></span>
59dd6b2bfcSGreg Roach                </th>
600cb66f86SGreg Roach                <th title="<?= I18N::translate('Tabs') ?>">
610cb66f86SGreg Roach                    <?= view('icons/tab') ?>
620cb66f86SGreg Roach                    <span class="sr-only"><?= I18N::translate('Tabs') ?></span>
63dd6b2bfcSGreg Roach                </th>
640cb66f86SGreg Roach                <th title="<?= I18N::translate('Sidebars') ?>">
650cb66f86SGreg Roach                    <?= view('icons/sidebar') ?>
660cb66f86SGreg Roach                    <span class="sr-only"><?= I18N::translate('Sidebars') ?></span>
67dd6b2bfcSGreg Roach                </th>
680cb66f86SGreg Roach                <th title="<?= I18N::translate('Blocks') ?>">
690cb66f86SGreg Roach                    <?= view('icons/block') ?>
700cb66f86SGreg Roach                    <span class="sr-only"><?= I18N::translate('Blocks') ?></span>
71dd6b2bfcSGreg Roach                </th>
720cb66f86SGreg Roach                <th title="<?= I18N::translate('Charts') ?>">
730cb66f86SGreg Roach                    <?= view('icons/chart') ?>
740cb66f86SGreg Roach                    <span class="sr-only"><?= I18N::translate('Charts') ?></span>
75dd6b2bfcSGreg Roach                </th>
760cb66f86SGreg Roach                <th title="<?= I18N::translate('Reports') ?>">
770cb66f86SGreg Roach                    <?= view('icons/report') ?>
780cb66f86SGreg Roach                    <span class="sr-only"><?= I18N::translate('Reports') ?></span>
79dd6b2bfcSGreg Roach                </th>
8033c34396SGreg Roach                <th title="<?= I18N::translate('Footers') ?>">
8133c34396SGreg Roach                    <?= view('icons/footer') ?>
8233c34396SGreg Roach                    <span class="sr-only"><?= I18N::translate('Footers') ?></span>
8333c34396SGreg Roach                </th>
849e5cb8c9SGreg Roach                <th title="<?= I18N::translate('Tracking and analytics') ?>">
859e5cb8c9SGreg Roach                    <?= view('icons/analytics') ?>
869e5cb8c9SGreg Roach                    <span class="sr-only"><?= I18N::translate('Tracking and analytics') ?></span>
879e5cb8c9SGreg Roach                </th>
88*f3244202SGreg Roach                <th title="<?= I18N::translate('Historic events') ?>">
89*f3244202SGreg Roach                    <?= view('icons/history') ?>
90*f3244202SGreg Roach                    <span class="sr-only"><?= I18N::translate('Historic events') ?></span>
91*f3244202SGreg Roach                </th>
920cb66f86SGreg Roach                <th class="d-none" title="<?= I18N::translate('Themes') ?>">
930cb66f86SGreg Roach                    <?= view('icons/theme') ?>
940cb66f86SGreg Roach                    <span class="sr-only"><?= I18N::translate('Themes') ?></span>
95dd6b2bfcSGreg Roach                </th>
96dd6b2bfcSGreg Roach            </tr>
97dd6b2bfcSGreg Roach        </thead>
980cb66f86SGreg Roach
99dd6b2bfcSGreg Roach        <tbody>
10049a243cbSGreg Roach            <?php foreach ($modules as $module) : ?>
101dd6b2bfcSGreg Roach                <tr>
1020cb66f86SGreg Roach                    <th scope="row" dir="auto">
10349a243cbSGreg Roach                        <?= $module->title() ?>
104dd6b2bfcSGreg Roach                    </th>
10549a243cbSGreg Roach                    <td class="text-center" data-sort="<?= $module->isEnabled() ?>">
106677aaceaSGreg Roach                        <?= Bootstrap4::checkbox('', false, ['name' => 'status-' . $module->name(), 'checked' => $module->isEnabled()]) ?>
107dd6b2bfcSGreg Roach                    </td>
1080cb66f86SGreg Roach                    <td>
10949a243cbSGreg Roach                        <?= $module->description() ?>
1109cad7645SGreg Roach                        <?php if ($module instanceof ModuleCustomInterface) : ?>
111dd6b2bfcSGreg Roach                            <br>
112dd6b2bfcSGreg Roach                            <?= view('icons/warning') ?>
113dd6b2bfcSGreg Roach                            <?= I18N::translate('Custom module') ?>
114dd6b2bfcSGreg Roach                            <?php if ($module::CUSTOM_VERSION) : ?>
115dd6b2bfcSGreg Roach                                - <?= I18N::translate('Version') ?> <?= $module::CUSTOM_VERSION ?>
116dd6b2bfcSGreg Roach                            <?php endif ?>
117dd6b2bfcSGreg Roach                            <?php if ($module::CUSTOM_WEBSITE) : ?>
118dd6b2bfcSGreg Roach                                - <a href="<?= $module::CUSTOM_WEBSITE ?>">
119dd6b2bfcSGreg Roach                                    <?= $module::CUSTOM_WEBSITE ?>
120dd6b2bfcSGreg Roach                                </a>
121dd6b2bfcSGreg Roach                            <?php endif ?>
122dd6b2bfcSGreg Roach                        <?php endif ?>
123dd6b2bfcSGreg Roach                    </td>
1240cb66f86SGreg Roach                    <td class="text-center text-muted" title="<?= I18N::translate('Preferences') ?>">
1250cb66f86SGreg Roach                        <?php if ($module instanceof ModuleConfigInterface) : ?>
1260cb66f86SGreg Roach                            <a href="<?= e($module->getConfigLink()) ?>" title="<?= I18N::translate('Preferences') ?>">
1270cb66f86SGreg Roach                                <?= view('icons/preferences') ?>
1280cb66f86SGreg Roach                                <span class="sr-only">
1290cb66f86SGreg Roach                                    <?= I18N::translate('Preferences') ?>
1300cb66f86SGreg Roach                                </span>
1310cb66f86SGreg Roach                            </a>
1320cb66f86SGreg Roach                        <?php endif ?>
1330cb66f86SGreg Roach                    </td>
1340cb66f86SGreg Roach                    <td class="text-center text-muted" title="<?= I18N::translate('Menu') ?>">
135dd6b2bfcSGreg Roach                        <?php if ($module instanceof ModuleMenuInterface) : ?>
136dd6b2bfcSGreg Roach                            <?= view('icons/menu') ?>
137dd6b2bfcSGreg Roach                            <span class="sr-only"><?= I18N::translate('Menu') ?></span>
138dd6b2bfcSGreg Roach                        <?php else : ?>
139dd6b2bfcSGreg Roach                            -
140dd6b2bfcSGreg Roach                        <?php endif ?>
141dd6b2bfcSGreg Roach                    </td>
1420cb66f86SGreg Roach                    <td class="text-center text-muted" title="<?= I18N::translate('Tab') ?>">
143dd6b2bfcSGreg Roach                        <?php if ($module instanceof ModuleTabInterface) : ?>
144dd6b2bfcSGreg Roach                            <?= view('icons/tab') ?>
145dd6b2bfcSGreg Roach                            <span class="sr-only"><?= I18N::translate('Tab') ?></span>
1460cb66f86SGreg Roach                        <?php else : ?>
1470cb66f86SGreg Roach                            -
148dd6b2bfcSGreg Roach                        <?php endif ?>
1490cb66f86SGreg Roach                    </td>
1500cb66f86SGreg Roach                    <td class="text-center text-muted" title="<?= I18N::translate('Sidebar') ?>">
151dd6b2bfcSGreg Roach                        <?php if ($module instanceof ModuleSidebarInterface) : ?>
152dd6b2bfcSGreg Roach                            <?= view('icons/sidebar') ?>
153dd6b2bfcSGreg Roach                            <span class="sr-only"><?= I18N::translate('Sidebar') ?></span>
1540cb66f86SGreg Roach                        <?php else : ?>
1550cb66f86SGreg Roach                            -
156dd6b2bfcSGreg Roach                        <?php endif ?>
1570cb66f86SGreg Roach                    </td>
1580cb66f86SGreg Roach                    <td class="text-center text-muted">
1590cb66f86SGreg Roach                        <?php if ($module instanceof ModuleBlockInterface) : ?>
1600cb66f86SGreg Roach                            <?php if ($module->isUserBlock()) : ?>
1610cb66f86SGreg Roach                                <span title="<?= I18N::translate('My page') ?>">
162dd6b2bfcSGreg Roach                                    <?= view('icons/block-user') ?>
1630cb66f86SGreg Roach                                </span>
1640cb66f86SGreg Roach                                <span class="sr-only">
1650cb66f86SGreg Roach                                    <?= I18N::translate('My page') ?>
1660cb66f86SGreg Roach                                </span>
167dd6b2bfcSGreg Roach                            <?php endif ?>
1680cb66f86SGreg Roach
1690cb66f86SGreg Roach                            <?php if ($module->isTreeBlock()) : ?>
1700cb66f86SGreg Roach                                <span title="<?= I18N::translate('Home page') ?>">
171dd6b2bfcSGreg Roach                                    <?= view('icons/block-tree') ?>
1720cb66f86SGreg Roach                                </span>
1730cb66f86SGreg Roach                                <span class="sr-only">
1740cb66f86SGreg Roach                                    <?= I18N::translate('Home page') ?>
1750cb66f86SGreg Roach                                </span>
176dd6b2bfcSGreg Roach                            <?php endif ?>
1770cb66f86SGreg Roach                        <?php else : ?>
1780cb66f86SGreg Roach                            -
1790cb66f86SGreg Roach                        <?php endif ?>
1800cb66f86SGreg Roach                    </td>
1810cb66f86SGreg Roach                    <td class="text-center text-muted" title="<?= I18N::translate('Chart') ?>">
182dd6b2bfcSGreg Roach                        <?php if ($module instanceof ModuleChartInterface) : ?>
183dd6b2bfcSGreg Roach                            <?= view('icons/chart') ?>
184dd6b2bfcSGreg Roach                            <span class="sr-only"><?= I18N::translate('Chart') ?></span>
1850cb66f86SGreg Roach                        <?php else : ?>
1860cb66f86SGreg Roach                            -
187dd6b2bfcSGreg Roach                        <?php endif ?>
1880cb66f86SGreg Roach                    </td>
1890cb66f86SGreg Roach                    <td class="text-center text-muted" title="<?= I18N::translate('Report') ?>">
190dd6b2bfcSGreg Roach                        <?php if ($module instanceof ModuleReportInterface) : ?>
191dd6b2bfcSGreg Roach                            <?= view('icons/report') ?>
192dd6b2bfcSGreg Roach                            <span class="sr-only"><?= I18N::translate('Report') ?></span>
1930cb66f86SGreg Roach                        <?php else : ?>
1940cb66f86SGreg Roach                            -
195dd6b2bfcSGreg Roach                        <?php endif ?>
1960cb66f86SGreg Roach                    </td>
19733c34396SGreg Roach                    <td class="text-center text-muted" title="<?= I18N::translate('Footer') ?>">
19833c34396SGreg Roach                        <?php if ($module instanceof ModuleFooterInterface) : ?>
19933c34396SGreg Roach                            <?= view('icons/footer') ?>
20033c34396SGreg Roach                            <span class="sr-only"><?= I18N::translate('Footer') ?></span>
20133c34396SGreg Roach                        <?php else : ?>
20233c34396SGreg Roach                            -
20333c34396SGreg Roach                        <?php endif ?>
20433c34396SGreg Roach                    </td>
2059e5cb8c9SGreg Roach                    <td class="text-center text-muted" title="<?= I18N::translate('Tracking and analytics') ?>">
2069e5cb8c9SGreg Roach                        <?php if ($module instanceof ModuleAnalyticsInterface) : ?>
2079e5cb8c9SGreg Roach                            <?= view('icons/analytics') ?>
2089e5cb8c9SGreg Roach                            <span class="sr-only"><?= I18N::translate('Tracking and analytics') ?></span>
2099e5cb8c9SGreg Roach                        <?php else : ?>
2109e5cb8c9SGreg Roach                            -
2119e5cb8c9SGreg Roach                        <?php endif ?>
2129e5cb8c9SGreg Roach                    </td>
213*f3244202SGreg Roach                    <td class="text-center text-muted" title="<?= I18N::translate('Historic events') ?>">
214*f3244202SGreg Roach                        <?php if ($module instanceof ModuleHistoricEventsInterface) : ?>
215*f3244202SGreg Roach                            <?= view('icons/history') ?>
216*f3244202SGreg Roach                            <span class="sr-only"><?= I18N::translate('Historic events') ?></span>
217*f3244202SGreg Roach                        <?php else : ?>
218*f3244202SGreg Roach                            -
219*f3244202SGreg Roach                        <?php endif ?>
220*f3244202SGreg Roach                    </td>
2210cb66f86SGreg Roach                    <td class="text-center text-muted d-none" title="<?= I18N::translate('Theme') ?>">
222dd6b2bfcSGreg Roach                        <?php if ($module instanceof ModuleThemeInterface) : ?>
223dd6b2bfcSGreg Roach                            <?= view('icons/theme') ?>
224dd6b2bfcSGreg Roach                            <span class="sr-only"><?= I18N::translate('Theme') ?></span>
2250cb66f86SGreg Roach                        <?php else : ?>
2260cb66f86SGreg Roach                            -
227dd6b2bfcSGreg Roach                        <?php endif ?>
228dd6b2bfcSGreg Roach                    </td>
229dd6b2bfcSGreg Roach                </tr>
230dd6b2bfcSGreg Roach            <?php endforeach ?>
231dd6b2bfcSGreg Roach        </tbody>
232dd6b2bfcSGreg Roach    </table>
233dd6b2bfcSGreg Roach    <button class="btn btn-primary" type="submit">
234dd6b2bfcSGreg Roach        <?= view('icons/save') ?>
235dd6b2bfcSGreg Roach        <?= I18N::translate('save') ?></button>
236dd6b2bfcSGreg Roach</form>
237dd6b2bfcSGreg Roach
238dd6b2bfcSGreg Roach<?php View::push('javascript') ?>
239dd6b2bfcSGreg Roach<script>
240dd6b2bfcSGreg Roach  'use strict';
241dd6b2bfcSGreg Roach
242dd6b2bfcSGreg Roach  $(".table-module-administration").dataTable({<?= I18N::datatablesI18N() ?>});
243dd6b2bfcSGreg Roach</script>
244dd6b2bfcSGreg Roach<?php View::endpush() ?>
245