summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/Http/Controllers/Admin/ControlPanelController.php2
-rw-r--r--app/Http/Controllers/Admin/ModuleController.php4
-rw-r--r--app/Module/BritishMonarchs.php (renamed from modules_v4/british-monarchs/module.php)34
-rw-r--r--app/Module/BritishPrimeMinisters.php (renamed from modules_v4/british-prime-ministers/module.php)182
-rw-r--r--app/Module/BritishSocialHistory.php67
-rw-r--r--app/Module/USPresidents.php (renamed from modules_v4/historic-events.example/module.php)34
-rw-r--r--app/Services/ModuleService.php214
-rw-r--r--resources/views/admin/components.phtml2
-rw-r--r--resources/views/admin/control-panel.phtml51
-rw-r--r--resources/views/components/badge.phtml12
10 files changed, 372 insertions, 230 deletions
diff --git a/app/Http/Controllers/Admin/ControlPanelController.php b/app/Http/Controllers/Admin/ControlPanelController.php
index 5042b8842b..87579583b1 100644
--- a/app/Http/Controllers/Admin/ControlPanelController.php
+++ b/app/Http/Controllers/Admin/ControlPanelController.php
@@ -100,7 +100,7 @@ class ControlPanelController extends AbstractAdminController
'block_modules_enabled' => $module_service->findByInterface(ModuleBlockInterface::class, false),
'chart_modules_disabled' => $module_service->findByInterface(ModuleChartInterface::class, true),
'chart_modules_enabled' => $module_service->findByInterface(ModuleChartInterface::class, false),
- 'config_modules' => $module_service->configOnlyModules(),
+ 'other_modules' => $module_service->otherModules(true),
'footer_modules_disabled' => $module_service->findByInterface(ModuleFooterInterface::class, true),
'footer_modules_enabled' => $module_service->findByInterface(ModuleFooterInterface::class, false),
'history_modules_disabled' => $module_service->findByInterface(ModuleHistoricEventsInterface::class, true),
diff --git a/app/Http/Controllers/Admin/ModuleController.php b/app/Http/Controllers/Admin/ModuleController.php
index c202a537e9..1a2efda0ea 100644
--- a/app/Http/Controllers/Admin/ModuleController.php
+++ b/app/Http/Controllers/Admin/ModuleController.php
@@ -84,7 +84,7 @@ class ModuleController extends AbstractAdminController
public function list(): Response
{
return $this->viewResponse('admin/modules', [
- 'title' => I18N::translate('Module administration'),
+ 'title' => I18N::translate('All modules'),
'modules' => $this->module_service->all(),
'deleted_modules' => $this->module_service->deletedModules(),
]);
@@ -249,7 +249,7 @@ class ModuleController extends AbstractAdminController
return $this->viewResponse('admin/components', [
'description' => $description,
'interface' => $interface,
- 'modules' => $this->module_service->findByInterface($interface, true),
+ 'modules' => $this->module_service->findByInterface($interface, true, true),
'title' => $title,
'trees' => Tree::all(),
'uses_access' => $uses_access,
diff --git a/modules_v4/british-monarchs/module.php b/app/Module/BritishMonarchs.php
index c4c11a7897..2c8213a6f8 100644
--- a/modules_v4/british-monarchs/module.php
+++ b/app/Module/BritishMonarchs.php
@@ -1,15 +1,29 @@
<?php
+/**
+ * webtrees: online genealogy
+ * Copyright (C) 2019 webtrees development team
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
declare(strict_types=1);
-use Fisharebest\Webtrees\Module\AbstractModule;
-use Fisharebest\Webtrees\Module\ModuleCustomInterface;
-use Fisharebest\Webtrees\Module\ModuleCustomTrait;
-use Fisharebest\Webtrees\Module\ModuleHistoricEventsInterface;
-use Fisharebest\Webtrees\Module\ModuleHistoricEventsTrait;
+namespace Fisharebest\Webtrees\Module;
+
use Illuminate\Support\Collection;
-return new class extends AbstractModule implements ModuleCustomInterface, ModuleHistoricEventsInterface {
- use ModuleCustomTrait;
+/**
+ * Class BritishMonarchs
+ */
+class BritishMonarchs extends AbstractModule implements ModuleHistoricEventsInterface
+{
use ModuleHistoricEventsTrait;
/**
@@ -19,7 +33,7 @@ return new class extends AbstractModule implements ModuleCustomInterface, Module
*/
public function title(): string
{
- return 'British Monarchs';
+ return 'British monarchs';
}
/**
@@ -90,4 +104,6 @@ return new class extends AbstractModule implements ModuleCustomInterface, Module
"1 EVEN Elizabeth II\n2 TYPE British Queen\n2 DATE FROM 06 FEB 1952",
]);
}
-};
+}
+
+;
diff --git a/modules_v4/british-prime-ministers/module.php b/app/Module/BritishPrimeMinisters.php
index cf6f782663..4d5e920fee 100644
--- a/modules_v4/british-prime-ministers/module.php
+++ b/app/Module/BritishPrimeMinisters.php
@@ -1,15 +1,31 @@
<?php
+/**
+ * webtrees: online genealogy
+ * Copyright (C) 2019 webtrees development team
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
declare(strict_types=1);
-use Fisharebest\Webtrees\Module\AbstractModule;
-use Fisharebest\Webtrees\Module\ModuleCustomInterface;
-use Fisharebest\Webtrees\Module\ModuleCustomTrait;
-use Fisharebest\Webtrees\Module\ModuleHistoricEventsInterface;
-use Fisharebest\Webtrees\Module\ModuleHistoricEventsTrait;
+namespace Fisharebest\Webtrees\Module;
+
use Illuminate\Support\Collection;
-return new class extends AbstractModule implements ModuleCustomInterface, ModuleHistoricEventsInterface {
- use ModuleCustomTrait;
+/**
+ * Class BritishPrimeMinisters
+ *
+ * @package Fisharebest\Webtrees\Module
+ */
+class BritishPrimeMinisters extends AbstractModule implements ModuleHistoricEventsInterface
+{
use ModuleHistoricEventsTrait;
/**
@@ -19,7 +35,7 @@ return new class extends AbstractModule implements ModuleCustomInterface, Module
*/
public function title(): string
{
- return 'British Prime Ministers';
+ return 'British prime ministers';
}
/**
@@ -40,79 +56,81 @@ return new class extends AbstractModule implements ModuleCustomInterface, Module
public function historicEventsAll(): Collection
{
return new Collection([
- "1 EVEN Robert Walpole\n2 TYPE Prime Minister\n2 DATE 03 APR 1721",
- "1 EVEN Spencer Compton\n2 TYPE Prime Minister\n2 DATE 16 FEB 1742",
- "1 EVEN Henry Pelham\n2 TYPE Prime Minister\n2 DATE 27 AUG 1743",
- "1 EVEN Thomas Pelham-Holles\n2 TYPE Prime Minister\n2 DATE 16 MAR 1754",
- "1 EVEN William Cavendish\n2 TYPE Prime Minister\n2 DATE 16 NOV 1756",
- "1 EVEN Thomas Pelham-Holles\n2 TYPE Prime Minister\n2 DATE 29 JUN 1757",
- "1 EVEN John Stuart\n2 TYPE Prime Minister\n2 DATE 26 MAY 1762",
- "1 EVEN George Grenville\n2 TYPE Prime Minister\n2 DATE 16 APR 1763",
- "1 EVEN Charles Watson-Wentworth\n2 TYPE Prime Minister\n2 DATE 13 JUL 1765",
- "1 EVEN William Pitt\n2 TYPE Prime Minister\n2 DATE 30 JUL 1766",
- "1 EVEN Augustus FitzRoy\n2 TYPE Prime Minister\n2 DATE 14 OCT 1768",
- "1 EVEN Frederick North\n2 TYPE Prime Minister\n2 DATE 28 JAN 1770",
- "1 EVEN Charles Watson-Wentworth\n2 TYPE Prime Minister\n2 DATE 27 MAR 1782",
- "1 EVEN William Petty\n2 TYPE Prime Minister\n2 DATE 04 JUL 1782",
- "1 EVEN William Cavendish-Bentinck\n2 TYPE Prime Minister\n2 DATE 02 APR 1873",
- "1 EVEN William Pitt the Younger\n2 TYPE Prime Minister\n2 DATE 19 DEC 1783",
- "1 EVEN Henry Addington\n2 TYPE Prime Minister\n2 DATE 17 MAR 1801",
- "1 EVEN William Pitt the Younger\n2 TYPE Prime Minister\n2 DATE 10 MAY 1804",
- "1 EVEN William Grenville\n2 TYPE Prime Minister\n2 DATE 11 FEB 1806",
- "1 EVEN William Cavendish-Bentinck\n2 TYPE Prime Minister\n2 DATE 31 MAR 1807",
- "1 EVEN Spencer Perceval\n2 TYPE Prime Minister\n2 DATE 04 OCT 1809",
- "1 EVEN Robert Jenkinson\n2 TYPE Prime Minister\n2 DATE 08 JUN 1812",
- "1 EVEN George Canning\n2 TYPE Prime Minister\n2 DATE 12 APR 1827",
- "1 EVEN Frederick John Robinson\n2 TYPE Prime Minister\n2 DATE 31 AUG 1827",
- "1 EVEN Arthur Wellesley, Duke of Wellington\n2 TYPE Prime Minister\n2 DATE 22 JAN 1828",
- "1 EVEN Charles Grey\n2 TYPE Prime Minister\n2 DATE 22 NOV 1830",
- "1 EVEN William Lamb\n2 TYPE Prime Minister\n2 DATE 16 JUL 1834",
- "1 EVEN Arthur Wellesley, Duke of Wellington\n2 TYPE Prime Minister\n2 DATE 17 NOV 1834",
- "1 EVEN Robert Peel\n2 TYPE Prime Minister\n2 DATE 10 DEC 1834",
- "1 EVEN William Lamb\n2 TYPE Prime Minister\n2 DATE 18 APR 1835",
- "1 EVEN Robert Peel\n2 TYPE Prime Minister\n2 DATE 30 AUG 1841",
- "1 EVEN John Russell\n2 TYPE Prime Minister\n2 DATE 30 JUN 1846",
- "1 EVEN Edward Smith-Stanley\n2 TYPE Prime Minister\n2 DATE 20 FEB 1852",
- "1 EVEN George Hamilton-Gordon\n2 TYPE Prime Minister\n2 DATE 19 DEC 1852",
- "1 EVEN Henry John Temple\n2 TYPE Prime Minister\n2 DATE 06 FEB 1855",
- "1 EVEN Edward Smith-Stanley\n2 TYPE Prime Minister\n2 DATE 20 FEB 1858",
- "1 EVEN Henry John Temple\n2 TYPE Prime Minister\n2 DATE 12 JUN 1859",
- "1 EVEN John Russell\n2 TYPE Prime Minister\n2 DATE 29 OCT 1865",
- "1 EVEN Edward Smith-Stanley\n2 TYPE Prime Minister\n2 DATE 28 JUN 1866",
- "1 EVEN Benjamin Disraeli\n2 TYPE Prime Minister\n2 DATE 27 FEB 1868",
- "1 EVEN William Ewart Gladstone\n2 TYPE Prime Minister\n2 DATE 03 DEC 1868",
- "1 EVEN Benjamin Disraeli\n2 TYPE Prime Minister\n2 DATE 20 FEB 1874",
- "1 EVEN Robert Gascoyne-Cecil\n2 TYPE Prime Minister\n2 DATE 23 APR 1880",
- "1 EVEN William Ewart Gladstone\n2 TYPE Prime Minister\n2 DATE 01 FEB 1886",
- "1 EVEN Robert Gascoyne-Cecil\n2 TYPE Prime Minister\n2 DATE 25 JUL 1886",
- "1 EVEN William Ewart Gladstone\n2 TYPE Prime Minister\n2 DATE 15 AUG 1892",
- "1 EVEN Archibald Primrose\n2 TYPE Prime Minister\n2 DATE 05 MAR 1894",
- "1 EVEN Robert Gascoyne-Cecil\n2 TYPE Prime Minister\n2 DATE 25 JUN 1895",
- "1 EVEN Arthur Balfour\n2 TYPE Prime Minister\n2 DATE 12 JUL 1902",
- "1 EVEN Henry Campbell-Bannerman\n2 TYPE Prime Minister\n2 DATE 05 DEC 1905",
- "1 EVEN Herbert Henry Asquith\n2 TYPE Prime Minister\n2 DATE 05 APR 1908",
- "1 EVEN David Lloyd George\n2 TYPE Prime Minister\n2 DATE 06 DEC 1916",
- "1 EVEN Bonar Law\n2 TYPE Prime Minister\n2 DATE 23 OCT 1922",
- "1 EVEN Stanley Baldwin\n2 TYPE Prime Minister\n2 DATE 22 MAY 1923",
- "1 EVEN Ramsey MacDonald\n2 TYPE Prime Minister\n2 DATE 22 JAN 1924",
- "1 EVEN Stanley Baldwin\n2 TYPE Prime Minister\n2 DATE 07 JUN 1935",
- "1 EVEN Neville Chamberlain\n2 TYPE Prime Minister\n2 DATE 28 MAY 1937",
- "1 EVEN Winston Churchill\n2 TYPE Prime Minister\n2 DATE 10 MAY 1940",
- "1 EVEN Clement Atlee\n2 TYPE Prime Minister\n2 DATE 26 JUL 1945",
- "1 EVEN Winston Churchill\n2 TYPE Prime Minister\n2 DATE 26 OCT 1951",
- "1 EVEN Anthony Eden\n2 TYPE Prime Minister\n2 DATE 06 APR 1955",
- "1 EVEN Harold Macmillan\n2 TYPE Prime Minister\n2 DATE 10 JAN 1957",
- "1 EVEN Alex Douglas-Home\n2 TYPE Prime Minister\n2 DATE 19 OCT 1963",
- "1 EVEN Harold Wilson\n2 TYPE Prime Minister\n2 DATE 16 OCT 1964",
- "1 EVEN Edward Heath\n2 TYPE Prime Minister\n2 DATE 19 JUN 1970",
- "1 EVEN Harold Wilson\n2 TYPE Prime Minister\n2 DATE 04 MAR 1974",
- "1 EVEN James Callaghan\n2 TYPE Prime Minister\n2 DATE 05 PAR 1976",
- "1 EVEN Margaret Thatcher\n2 TYPE Prime Minister\n2 DATE 04 MAY 1979",
- "1 EVEN John Major\n2 TYPE Prime Minister\n2 DATE 28 NOV 1990",
- "1 EVEN Tony Blair\n2 TYPE Prime Minister\n2 DATE 02 MAY 1997",
- "1 EVEN Gordon Brown\n2 TYPE Prime Minister\n2 DATE 27 JUN 2007",
- "1 EVEN David Cameron\n2 TYPE Prime Minister\n2 DATE 11 MAY 2010",
- "1 EVEN Theresa May\n2 TYPE Prime Minister\n2 DATE 13 JUL 2016",
+ "1 EVEN Robert Walpole\n2 TYPE Prime Minister\n2 DATE FROM 03 APR 1721 TO 16 FEB 1742",
+ "1 EVEN Spencer Compton\n2 TYPE Prime Minister\n2 DATE FROM 16 FEB 1742 TO 27 AUG 1743",
+ "1 EVEN Henry Pelham\n2 TYPE Prime Minister\n2 DATE FROM 27 AUG 1743 TO 16 MAR 1754",
+ "1 EVEN Thomas Pelham-Holles\n2 TYPE Prime Minister\n2 DATE FROM 16 MAR 1754 TO 16 NOV 1756",
+ "1 EVEN William Cavendish\n2 TYPE Prime Minister\n2 DATE FROM 16 NOV 1756 TO 29 JUN 1757",
+ "1 EVEN Thomas Pelham-Holles\n2 TYPE Prime Minister\n2 DATE FROM 29 JUN 1757 TO 26 MAY 1762",
+ "1 EVEN John Stuart\n2 TYPE Prime Minister\n2 DATE FROM 26 MAY 1762 TO 26 MAY 1762",
+ "1 EVEN George Grenville\n2 TYPE Prime Minister\n2 DATE FROM26 MAY 1762 TO 13 JUL 1765",
+ "1 EVEN Charles Watson-Wentworth\n2 TYPE Prime Minister\n2 DATE FROM 13 JUL 1765 TO 30 JUL 1766",
+ "1 EVEN William Pitt\n2 TYPE Prime Minister\n2 DATE FROM 30 JUL 1766 TO 14 OCT 1768",
+ "1 EVEN Augustus FitzRoy\n2 TYPE Prime Minister\n2 DATE FROM 14 OCT 1768 TO 28 JAN 1770",
+ "1 EVEN Frederick North\n2 TYPE Prime Minister\n2 DATE FROM 28 JAN 1770 TO 27 MAR 1782",
+ "1 EVEN Charles Watson-Wentworth\n2 TYPE Prime Minister\n2 DATE FROM 27 MAR 1782 TO 04 JUL 1782",
+ "1 EVEN William Petty\n2 TYPE Prime Minister\n2 DATE FROM 04 JUL 1782 TO 02 APR 1873",
+ "1 EVEN William Cavendish-Bentinck\n2 TYPE Prime Minister\n2 DATE FROM 02 APR 1873 TO 19 DEC 1783",
+ "1 EVEN William Pitt the Younger\n2 TYPE Prime Minister\n2 DATE FROM 19 DEC 1783 TO 17 MAR 1801",
+ "1 EVEN Henry Addington\n2 TYPE Prime Minister\n2 DATE FROM 17 MAR 1801 TO 10 MAY 1804",
+ "1 EVEN William Pitt the Younger\n2 TYPE Prime Minister\n2 DATE FROM 10 MAY 1804 TO 11 FEB 1806",
+ "1 EVEN William Grenville\n2 TYPE Prime Minister\n2 DATE FROM 11 FEB 1806 TO 31 MAR 1807",
+ "1 EVEN William Cavendish-Bentinck\n2 TYPE Prime Minister\n2 DATE FROM 31 MAR 1807 TO 04 OCT 1809",
+ "1 EVEN Spencer Perceval\n2 TYPE Prime Minister\n2 DATE FROM 04 OCT 1809 TO 08 JUN 1812",
+ "1 EVEN Robert Jenkinson\n2 TYPE Prime Minister\n2 DATE FROM 08 JUN 1812 TO 12 APR 1827",
+ "1 EVEN George Canning\n2 TYPE Prime Minister\n2 DATE FROM 12 APR 1827 TO 31 AUG 1827",
+ "1 EVEN Frederick John Robinson\n2 TYPE Prime Minister\n2 DATE FROM 31 AUG 1827 TO 22 JAN 1828",
+ "1 EVEN Arthur Wellesley, Duke of Wellington\n2 TYPE Prime Minister\n2 DATE FROM 22 JAN 1828 TO 22 NOV 1830",
+ "1 EVEN Charles Grey\n2 TYPE Prime Minister\n2 DATE FROM 22 NOV 1830 TO 16 JUL 1834",
+ "1 EVEN William Lamb\n2 TYPE Prime Minister\n2 DATE FROM 16 JUL 1834 TO 17 NOV 1834",
+ "1 EVEN Arthur Wellesley, Duke of Wellington\n2 TYPE Prime Minister\n2 DATE FROM 17 NOV 1834 TO 10 DEC 1834",
+ "1 EVEN Robert Peel\n2 TYPE Prime Minister\n2 DATE FROM 10 DEC 1834 TO 18 APR 1835",
+ "1 EVEN William Lamb\n2 TYPE Prime Minister\n2 DATE FROM 18 APR 1835 TO 30 AUG 1841",
+ "1 EVEN Robert Peel\n2 TYPE Prime Minister\n2 DATE FROM 30 AUG 1841 TO 30 JUN 1846",
+ "1 EVEN John Russell\n2 TYPE Prime Minister\n2 DATE FROM 30 JUN 1846 TO 20 FEB 1852",
+ "1 EVEN Edward Smith-Stanley\n2 TYPE Prime Minister\n2 DATE FROM 20 FEB 1852 TO 19 DEC 1852",
+ "1 EVEN George Hamilton-Gordon\n2 TYPE Prime Minister\n2 DATE FROM 19 DEC 1852 TO 06 FEB 1855",
+ "1 EVEN Henry John Temple\n2 TYPE Prime Minister\n2 DATE FROM 06 FEB 1855 TO 20 FEB 1858",
+ "1 EVEN Edward Smith-Stanley\n2 TYPE Prime Minister\n2 DATE FROM 20 FEB 1858 TO 12 JUN 1859",
+ "1 EVEN Henry John Temple\n2 TYPE Prime Minister\n2 DATE FROM 12 JUN 1859 TO 29 OCT 1865",
+ "1 EVEN John Russell\n2 TYPE Prime Minister\n2 DATE FROM 29 OCT 1865 TO 28 JUN 1866",
+ "1 EVEN Edward Smith-Stanley\n2 TYPE Prime Minister\n2 DATE FROM 28 JUN 1866 TO 27 FEB 1868",
+ "1 EVEN Benjamin Disraeli\n2 TYPE Prime Minister\n2 DATE FROM 27 FEB 1868 TO 03 DEC 1868",
+ "1 EVEN William Ewart Gladstone\n2 TYPE Prime Minister\n2 DATE FROM 03 DEC 1868 TO 20 FEB 1874",
+ "1 EVEN Benjamin Disraeli\n2 TYPE Prime Minister\n2 DATE FROM 20 FEB 1874 TO 23 APR 1880",
+ "1 EVEN Robert Gascoyne-Cecil\n2 TYPE Prime Minister\n2 DATE FROM 23 APR 1880 TO 01 FEB 1886",
+ "1 EVEN William Ewart Gladstone\n2 TYPE Prime Minister\n2 DATE FROM 01 FEB 1886 TO 25 JUL 1886",
+ "1 EVEN Robert Gascoyne-Cecil\n2 TYPE Prime Minister\n2 DATE FROM 25 JUL 1886 TO 15 AUG 1892",
+ "1 EVEN William Ewart Gladstone\n2 TYPE Prime Minister\n2 DATE FROM 15 AUG 1892 TO 05 MAR 1894",
+ "1 EVEN Archibald Primrose\n2 TYPE Prime Minister\n2 DATE FROM 05 MAR 1894 TO 25 JUN 1895",
+ "1 EVEN Robert Gascoyne-Cecil\n2 TYPE Prime Minister\n2 DATE FROM 25 JUN 1895 TO 12 JUL 1902",
+ "1 EVEN Arthur Balfour\n2 TYPE Prime Minister\n2 DATE FROM 12 JUL 1902 TO 05 DEC 1905",
+ "1 EVEN Henry Campbell-Bannerman\n2 TYPE Prime Minister\n2 DATE FROM 05 DEC 1905 TO 05 APR 1908",
+ "1 EVEN Herbert Henry Asquith\n2 TYPE Prime Minister\n2 DATE FROM 05 APR 1908 TO 06 DEC 1916",
+ "1 EVEN David Lloyd George\n2 TYPE Prime Minister\n2 DATE FROM 06 DEC 1916 TO 23 OCT 1922",
+ "1 EVEN Bonar Law\n2 TYPE Prime Minister\n2 DATE FROM 23 OCT 1922 TO 22 MAY 1923",
+ "1 EVEN Stanley Baldwin\n2 TYPE Prime Minister\n2 DATE FROM 22 MAY 1923 TO 22 JAN 1924",
+ "1 EVEN Ramsey MacDonald\n2 TYPE Prime Minister\n2 DATE FROM 22 JAN 1924 TO 07 JUN 1935",
+ "1 EVEN Stanley Baldwin\n2 TYPE Prime Minister\n2 DATE FROM 07 JUN 1935 TO 28 MAY 1937",
+ "1 EVEN Neville Chamberlain\n2 TYPE Prime Minister\n2 DATE FROM 28 MAY 1937 TO 10 MAY 1940",
+ "1 EVEN Winston Churchill\n2 TYPE Prime Minister\n2 DATE FROM 10 MAY 1940 TO 26 JUL 1945",
+ "1 EVEN Clement Atlee\n2 TYPE Prime Minister\n2 DATE FROM 26 JUL 1945 TO 26 OCT 1951",
+ "1 EVEN Winston Churchill\n2 TYPE Prime Minister\n2 DATE FROM 26 OCT 1951 TO 06 APR 1955",
+ "1 EVEN Anthony Eden\n2 TYPE Prime Minister\n2 DATE FROM 06 APR 1955 TO 10 JAN 1957",
+ "1 EVEN Harold Macmillan\n2 TYPE Prime Minister\n2 DATE FROM 10 JAN 1957 TO 19 OCT 1963",
+ "1 EVEN Alex Douglas-Home\n2 TYPE Prime Minister\n2 DATE FROM 19 OCT 1963 TO 19 OCT 1963",
+ "1 EVEN Harold Wilson\n2 TYPE Prime Minister\n2 DATE FROM 19 OCT 1963 TO 19 OCT 1963",
+ "1 EVEN Edward Heath\n2 TYPE Prime Minister\n2 DATE FROM 19 OCT 1963 TO 04 MAR 1974",
+ "1 EVEN Harold Wilson\n2 TYPE Prime Minister\n2 DATE FROM 04 MAR 1974 TO 05 PAR 1976",
+ "1 EVEN James Callaghan\n2 TYPE Prime Minister\n2 DATE FROM 05 PAR 1976 TO 04 MAY 1979",
+ "1 EVEN Margaret Thatcher\n2 TYPE Prime Minister\n2 DATE FROM 04 MAY 1979 TO 28 NOV 1990",
+ "1 EVEN John Major\n2 TYPE Prime Minister\n2 DATE FROM 28 NOV 1990 TO 02 MAY 1997",
+ "1 EVEN Tony Blair\n2 TYPE Prime Minister\n2 DATE FROM 02 MAY 1997 TO 27 JUN 2007",
+ "1 EVEN Gordon Brown\n2 TYPE Prime Minister\n2 DATE FROM 27 JUN 2007 TO 11 MAY 2010",
+ "1 EVEN David Cameron\n2 TYPE Prime Minister\n2 DATE FROM 11 MAY 2010 TO 13 JUL 2016",
+ "1 EVEN Theresa May\n2 TYPE Prime Minister\n2 DATE FROM 13 JUL 2016",
]);
}
-};
+}
+
+;
diff --git a/app/Module/BritishSocialHistory.php b/app/Module/BritishSocialHistory.php
new file mode 100644
index 0000000000..f53a6df699
--- /dev/null
+++ b/app/Module/BritishSocialHistory.php
@@ -0,0 +1,67 @@
+<?php
+/**
+ * webtrees: online genealogy
+ * Copyright (C) 2019 webtrees development team
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+declare(strict_types=1);
+
+namespace Fisharebest\Webtrees\Module;
+
+use Illuminate\Support\Collection;
+
+/**
+ * Class BritishSocialHistory
+ *
+ * @package Fisharebest\Webtrees\Module
+ */
+class BritishSocialHistory extends AbstractModule implements ModuleHistoricEventsInterface
+{
+ use ModuleHistoricEventsTrait;
+
+ /**
+ * How should this module be labelled on tabs, menus, etc.?
+ *
+ * @return string
+ */
+ public function title(): string
+ {
+ return 'British social history';
+ }
+
+ /**
+ * Should this module be enabled when it is first installed?
+ *
+ * @return bool
+ */
+ public function isEnabledByDefault(): bool
+ {
+ return false;
+ }
+
+ /**
+ * All events provided by this module.
+ *
+ * @return Collection|string[]
+ */
+ public function historicEventsAll(): Collection
+ {
+ return new Collection([
+ "1 EVEN Games of the IV Olympiad\n2 TYPE Olympic games\n2 DATE FROM 27 APR 1908 TO 31 OCT 1908\n2 PLAC London, England",
+ "1 EVEN\n2 TYPE National Health Service\n2 DATE FROM 5 JUL 1948",
+ "1 EVEN Games of the XIV Olympiad\n2 TYPE Olympic games\n2 DATE FROM 29 JUL 1948 TO 14 AUG 1948\n2 PLAC London, England",
+ "1 EVEN Games of the XXX Olympiad\n2 TYPE Olympic games\n2 DATE FROM 27 JUL 2012 TO 12 AUG 2012\n2 PLAC London, England",
+ ]);
+ }
+}
+
+;
diff --git a/modules_v4/historic-events.example/module.php b/app/Module/USPresidents.php
index 8950f7d85c..bc868695ac 100644
--- a/modules_v4/historic-events.example/module.php
+++ b/app/Module/USPresidents.php
@@ -1,15 +1,29 @@
<?php
+/**
+ * webtrees: online genealogy
+ * Copyright (C) 2019 webtrees development team
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
declare(strict_types=1);
-use Fisharebest\Webtrees\Module\AbstractModule;
-use Fisharebest\Webtrees\Module\ModuleCustomInterface;
-use Fisharebest\Webtrees\Module\ModuleCustomTrait;
-use Fisharebest\Webtrees\Module\ModuleHistoricEventsInterface;
-use Fisharebest\Webtrees\Module\ModuleHistoricEventsTrait;
+namespace Fisharebest\Webtrees\Module;
+
use Illuminate\Support\Collection;
-return new class extends AbstractModule implements ModuleCustomInterface, ModuleHistoricEventsInterface {
- use ModuleCustomTrait;
+/**
+ * Class USPresidents
+ */
+class USPresidents extends AbstractModule implements ModuleHistoricEventsInterface
+{
use ModuleHistoricEventsTrait;
/**
@@ -19,7 +33,7 @@ return new class extends AbstractModule implements ModuleCustomInterface, Module
*/
public function title(): string
{
- return 'Presidents of the United States';
+ return 'United States presidents';
}
/**
@@ -87,4 +101,6 @@ return new class extends AbstractModule implements ModuleCustomInterface, Module
"1 EVEN Donald Trump\n2 TYPE 45th President of the United States\n2 DATE 20 JAN 2017",
]);
}
-};
+}
+
+;
diff --git a/app/Services/ModuleService.php b/app/Services/ModuleService.php
index e3fa176363..d4fdc57325 100644
--- a/app/Services/ModuleService.php
+++ b/app/Services/ModuleService.php
@@ -30,6 +30,9 @@ use Fisharebest\Webtrees\Module\BingWebmasterToolsModule;
use Fisharebest\Webtrees\Module\BirthDeathMarriageReportModule;
use Fisharebest\Webtrees\Module\BirthReportModule;
use Fisharebest\Webtrees\Module\BranchesListModule;
+use Fisharebest\Webtrees\Module\BritishMonarchs;
+use Fisharebest\Webtrees\Module\BritishPrimeMinisters;
+use Fisharebest\Webtrees\Module\BritishSocialHistory;
use Fisharebest\Webtrees\Module\CalendarMenuModule;
use Fisharebest\Webtrees\Module\CemeteryReportModule;
use Fisharebest\Webtrees\Module\CensusAssistantModule;
@@ -47,7 +50,6 @@ use Fisharebest\Webtrees\Module\DeathReportModule;
use Fisharebest\Webtrees\Module\DescendancyChartModule;
use Fisharebest\Webtrees\Module\DescendancyModule;
use Fisharebest\Webtrees\Module\DescendancyReportModule;
-use Fisharebest\Webtrees\Module\IndividualMetadataModule;
use Fisharebest\Webtrees\Module\FabTheme;
use Fisharebest\Webtrees\Module\FactSourcesReportModule;
use Fisharebest\Webtrees\Module\FamilyBookChartModule;
@@ -67,6 +69,7 @@ use Fisharebest\Webtrees\Module\HtmlBlockModule;
use Fisharebest\Webtrees\Module\IndividualFactsTabModule;
use Fisharebest\Webtrees\Module\IndividualFamiliesReportModule;
use Fisharebest\Webtrees\Module\IndividualListModule;
+use Fisharebest\Webtrees\Module\IndividualMetadataModule;
use Fisharebest\Webtrees\Module\IndividualReportModule;
use Fisharebest\Webtrees\Module\InteractiveTreeModule;
use Fisharebest\Webtrees\Module\LifespansChartModule;
@@ -131,6 +134,7 @@ use Fisharebest\Webtrees\Module\UserFavoritesModule;
use Fisharebest\Webtrees\Module\UserJournalModule;
use Fisharebest\Webtrees\Module\UserMessagesModule;
use Fisharebest\Webtrees\Module\UserWelcomeModule;
+use Fisharebest\Webtrees\Module\USPresidents;
use Fisharebest\Webtrees\Module\WebtreesTheme;
use Fisharebest\Webtrees\Module\WelcomeBlockModule;
use Fisharebest\Webtrees\Module\XeneaTheme;
@@ -166,104 +170,108 @@ class ModuleService
// Array keys are module names, and should match module names from earlier versions of webtrees.
private const CORE_MODULES = [
- 'GEDFact_assistant' => CensusAssistantModule::class,
- 'ahnentafel_report' => AhnentafelReportModule::class,
- 'ancestors_chart' => AncestorsChartModule::class,
- 'batch_update' => BatchUpdateModule::class,
- 'bdm_report' => BirthDeathMarriageReportModule::class,
- 'bing-webmaster-tools' => BingWebmasterToolsModule::class,
- 'birth_report' => BirthReportModule::class,
- 'branches_list' => BranchesListModule::class,
- 'calendar-menu' => CalendarMenuModule::class,
- 'cemetery_report' => CemeteryReportModule::class,
- 'change_report' => ChangeReportModule::class,
- 'charts' => ChartsBlockModule::class,
- 'charts-menu' => ChartsMenuModule::class,
- 'ckeditor' => CkeditorModule::class,
- 'clippings' => ClippingsCartModule::class,
- 'clouds' => CloudsTheme::class,
- 'colors' => ColorsTheme::class,
- 'compact-chart' => CompactTreeChartModule::class,
- 'contact-links' => ContactsFooterModule::class,
- 'cookie-warning' => CookieWarningModule::class,
- 'death_report' => DeathReportModule::class,
- 'descendancy' => DescendancyModule::class,
- 'descendancy_chart' => DescendancyChartModule::class,
- 'descendancy_report' => DescendancyReportModule::class,
- 'extra_info' => IndividualMetadataModule::class,
- 'fab' => FabTheme::class,
- 'fact_sources' => FactSourcesReportModule::class,
- 'family_book_chart' => FamilyBookChartModule::class,
- 'family_group_report' => FamilyGroupReportModule::class,
- 'family_list' => FamilyListModule::class,
- 'family_nav' => FamilyNavigatorModule::class,
- 'fan_chart' => FanChartModule::class,
- 'faq' => FrequentlyAskedQuestionsModule::class,
- 'gedcom_block' => WelcomeBlockModule::class,
- 'gedcom_favorites' => FamilyTreeFavoritesModule::class,
- 'gedcom_news' => FamilyTreeNewsModule::class,
- 'gedcom_stats' => FamilyTreeStatisticsModule::class,
- 'google-analytics' => GoogleAnalyticsModule::class,
- 'google-webmaster-tools' => GoogleWebmasterToolsModule::class,
- 'hit-counter' => HitCountFooterModule::class,
- 'hourglass_chart' => HourglassChartModule::class,
- 'html' => HtmlBlockModule::class,
- 'individual_ext_report' => IndividualFamiliesReportModule::class,
- 'individual_list' => IndividualListModule::class,
- 'individual_report' => IndividualReportModule::class,
- 'lifespans_chart' => LifespansChartModule::class,
- 'lightbox' => AlbumModule::class,
- 'lists-menu' => ListsMenuModule::class,
- 'logged_in' => LoggedInUsersModule::class,
- 'login_block' => LoginBlockModule::class,
- 'marriage_report' => MarriageReportModule::class,
- 'matomo-analytics' => MatomoAnalyticsModule::class,
- 'media' => MediaTabModule::class,
- 'media_list' => MediaListModule::class,
- 'minimal' => MinimalTheme::class,
- 'missing_facts_report' => MissingFactsReportModule::class,
- 'notes' => NotesTabModule::class,
- 'note_list' => NoteListModule::class,
- 'occupation_report' => OccupationReportModule::class,
- 'pedigree-map' => PedigreeMapModule::class,
- 'pedigree_chart' => PedigreeChartModule::class,
- 'pedigree_report' => PedigreeReportModule::class,
- 'personal_facts' => IndividualFactsTabModule::class,
- 'places' => PlacesModule::class,
- 'places_list' => PlaceHierarchyListModule::class,
- 'powered-by-webtrees' => PoweredByWebtreesModule::class,
- 'random_media' => SlideShowModule::class,
- 'recent_changes' => RecentChangesModule::class,
- 'relationships_chart' => RelationshipsChartModule::class,
- 'relative_ext_report' => RelatedIndividualsReportModule::class,
- 'relatives' => RelativesTabModule::class,
- 'reports-menu' => ReportsMenuModule::class,
- 'repository_list' => RepositoryListModule::class,
- 'review_changes' => ReviewChangesModule::class,
- 'search-menu' => SearchMenuModule::class,
- 'sitemap' => SiteMapModule::class,
- 'source_list' => SourceListModule::class,
- 'sources_tab' => SourcesTabModule::class,
- 'statcounter' => StatcounterModule::class,
- 'statistics_chart' => StatisticsChartModule::class,
- 'stories' => StoriesModule::class,
- 'theme_select' => ThemeSelectModule::class,
- 'timeline_chart' => TimelineChartModule::class,
- 'todays_events' => OnThisDayModule::class,
- 'todo' => ResearchTaskModule::class,
- 'top10_givnnames' => TopGivenNamesModule::class,
- 'top10_pageviews' => TopPageViewsModule::class,
- 'top10_surnames' => TopSurnamesModule::class,
- 'tree' => InteractiveTreeModule::class,
- 'trees-menu' => TreesMenuModule::class,
- 'upcoming_events' => UpcomingAnniversariesModule::class,
- 'user_blog' => UserJournalModule::class,
- 'user_favorites' => UserFavoritesModule::class,
- 'user_messages' => UserMessagesModule::class,
- 'user_welcome' => UserWelcomeModule::class,
- 'webtrees' => WebtreesTheme::class,
- 'xenea' => XeneaTheme::class,
- 'yahrzeit' => YahrzeitModule::class,
+ 'GEDFact_assistant' => CensusAssistantModule::class,
+ 'ahnentafel_report' => AhnentafelReportModule::class,
+ 'ancestors_chart' => AncestorsChartModule::class,
+ 'batch_update' => BatchUpdateModule::class,
+ 'bdm_report' => BirthDeathMarriageReportModule::class,
+ 'bing-webmaster-tools' => BingWebmasterToolsModule::class,
+ 'birth_report' => BirthReportModule::class,
+ 'branches_list' => BranchesListModule::class,
+ 'british-monarchs' => BritishMonarchs::class,
+ 'british-prime-ministers' => BritishPrimeMinisters::class,
+ 'british-social-history' => BritishSocialHistory::class,
+ 'calendar-menu' => CalendarMenuModule::class,
+ 'cemetery_report' => CemeteryReportModule::class,
+ 'change_report' => ChangeReportModule::class,
+ 'charts' => ChartsBlockModule::class,
+ 'charts-menu' => ChartsMenuModule::class,
+ 'ckeditor' => CkeditorModule::class,
+ 'clippings' => ClippingsCartModule::class,
+ 'clouds' => CloudsTheme::class,
+ 'colors' => ColorsTheme::class,
+ 'compact-chart' => CompactTreeChartModule::class,
+ 'contact-links' => ContactsFooterModule::class,
+ 'cookie-warning' => CookieWarningModule::class,
+ 'death_report' => DeathReportModule::class,
+ 'descendancy' => DescendancyModule::class,
+ 'descendancy_chart' => DescendancyChartModule::class,
+ 'descendancy_report' => DescendancyReportModule::class,
+ 'extra_info' => IndividualMetadataModule::class,
+ 'fab' => FabTheme::class,
+ 'fact_sources' => FactSourcesReportModule::class,
+ 'family_book_chart' => FamilyBookChartModule::class,
+ 'family_group_report' => FamilyGroupReportModule::class,
+ 'family_list' => FamilyListModule::class,
+ 'family_nav' => FamilyNavigatorModule::class,
+ 'fan_chart' => FanChartModule::class,
+ 'faq' => FrequentlyAskedQuestionsModule::class,
+ 'gedcom_block' => WelcomeBlockModule::class,
+ 'gedcom_favorites' => FamilyTreeFavoritesModule::class,
+ 'gedcom_news' => FamilyTreeNewsModule::class,
+ 'gedcom_stats' => FamilyTreeStatisticsModule::class,
+ 'google-analytics' => GoogleAnalyticsModule::class,
+ 'google-webmaster-tools' => GoogleWebmasterToolsModule::class,
+ 'hit-counter' => HitCountFooterModule::class,
+ 'hourglass_chart' => HourglassChartModule::class,
+ 'html' => HtmlBlockModule::class,
+ 'individual_ext_report' => IndividualFamiliesReportModule::class,
+ 'individual_list' => IndividualListModule::class,
+ 'individual_report' => IndividualReportModule::class,
+ 'lifespans_chart' => LifespansChartModule::class,
+ 'lightbox' => AlbumModule::class,
+ 'lists-menu' => ListsMenuModule::class,
+ 'logged_in' => LoggedInUsersModule::class,
+ 'login_block' => LoginBlockModule::class,
+ 'marriage_report' => MarriageReportModule::class,
+ 'matomo-analytics' => MatomoAnalyticsModule::class,
+ 'media' => MediaTabModule::class,
+ 'media_list' => MediaListModule::class,
+ 'minimal' => MinimalTheme::class,
+ 'missing_facts_report' => MissingFactsReportModule::class,
+ 'notes' => NotesTabModule::class,
+ 'note_list' => NoteListModule::class,
+ 'occupation_report' => OccupationReportModule::class,
+ 'pedigree-map' => PedigreeMapModule::class,
+ 'pedigree_chart' => PedigreeChartModule::class,
+ 'pedigree_report' => PedigreeReportModule::class,
+ 'personal_facts' => IndividualFactsTabModule::class,
+ 'places' => PlacesModule::class,
+ 'places_list' => PlaceHierarchyListModule::class,
+ 'powered-by-webtrees' => PoweredByWebtreesModule::class,
+ 'random_media' => SlideShowModule::class,
+ 'recent_changes' => RecentChangesModule::class,
+ 'relationships_chart' => RelationshipsChartModule::class,
+ 'relative_ext_report' => RelatedIndividualsReportModule::class,
+ 'relatives' => RelativesTabModule::class,
+ 'reports-menu' => ReportsMenuModule::class,
+ 'repository_list' => RepositoryListModule::class,
+ 'review_changes' => ReviewChangesModule::class,
+ 'search-menu' => SearchMenuModule::class,
+ 'sitemap' => SiteMapModule::class,
+ 'source_list' => SourceListModule::class,
+ 'sources_tab' => SourcesTabModule::class,
+ 'statcounter' => StatcounterModule::class,
+ 'statistics_chart' => StatisticsChartModule::class,
+ 'stories' => StoriesModule::class,
+ 'theme_select' => ThemeSelectModule::class,
+ 'timeline_chart' => TimelineChartModule::class,
+ 'todays_events' => OnThisDayModule::class,
+ 'todo' => ResearchTaskModule::class,
+ 'top10_givnnames' => TopGivenNamesModule::class,
+ 'top10_pageviews' => TopPageViewsModule::class,
+ 'top10_surnames' => TopSurnamesModule::class,
+ 'tree' => InteractiveTreeModule::class,
+ 'trees-menu' => TreesMenuModule::class,
+ 'upcoming_events' => UpcomingAnniversariesModule::class,
+ 'us-presidents' => USPresidents::class,
+ 'user_blog' => UserJournalModule::class,
+ 'user_favorites' => UserFavoritesModule::class,
+ 'user_messages' => UserMessagesModule::class,
+ 'user_welcome' => UserWelcomeModule::class,
+ 'webtrees' => WebtreesTheme::class,
+ 'xenea' => XeneaTheme::class,
+ 'yahrzeit' => YahrzeitModule::class,
];
/**
@@ -565,12 +573,14 @@ class ModuleService
* Configuration settings are available through the various "module component" pages.
* For modules that do not provide a component, we need to list them separately.
*
+ * @param bool $include_disabled
+ *
* @return Collection|ModuleConfigInterface[]
*/
- public function configOnlyModules(): Collection
+ public function otherModules(bool $include_disabled = false): Collection
{
- return $this->findByInterface(ModuleConfigInterface::class)
- ->filter(function (ModuleConfigInterface $module): bool {
+ return $this->all($include_disabled)
+ ->filter(function (ModuleInterface $module): bool {
foreach (self::COMPONENTS as $interface) {
if ($module instanceof $interface) {
return false;
diff --git a/resources/views/admin/components.phtml b/resources/views/admin/components.phtml
index 76d5fba5e5..543aa87685 100644
--- a/resources/views/admin/components.phtml
+++ b/resources/views/admin/components.phtml
@@ -5,7 +5,7 @@
<?php use Fisharebest\Webtrees\Module\ModuleConfigInterface; ?>
<?php use Fisharebest\Webtrees\View; ?>
-<?= view('components/breadcrumbs', ['links' => [route('admin-control-panel') => I18N::translate('Control panel'), route('modules') => I18N::translate('Modules'), $title]]) ?>
+<?= view('components/breadcrumbs', ['links' => [route('admin-control-panel') => I18N::translate('Control panel'), route('modules') => I18N::translate('All modules'), $title]]) ?>
<h1><?= $title ?></h1>
diff --git a/resources/views/admin/control-panel.phtml b/resources/views/admin/control-panel.phtml
index 969a496b6a..d4c4d36636 100644
--- a/resources/views/admin/control-panel.phtml
+++ b/resources/views/admin/control-panel.phtml
@@ -1,5 +1,6 @@
<?php use Fisharebest\Webtrees\I18N; ?>
-<?php use Fisharebest\Webtrees\Webtrees; ?>
+<?php use Fisharebest\Webtrees\Module\ModuleConfigInterface;
+use Fisharebest\Webtrees\Webtrees; ?>
<h1><?= $title ?></h1>
@@ -300,6 +301,7 @@
<h3>
<?= I18N::translate('Genealogy') ?>
</h3>
+
<ul class="fa-ul">
<li>
<span class="fa-li"><?= view('icons/menu') ?></span>
@@ -330,9 +332,11 @@
<?= view('components/badge', ['count' => $report_modules_enabled->count(), 'total' => $report_modules_disabled->count(), 'context' => 'primary']) ?>
</li>
</ul>
+
<h3>
<?= I18N::translate('Website') ?>
</h3>
+
<ul class="fa-ul">
<li>
<span class="fa-li"><?= view('icons/footer') ?></span>
@@ -363,11 +367,27 @@
<?= view('components/badge', ['count' => $language_modules_enabled->count(), 'total' => $language_modules_disabled->count(), 'context' => 'primary']) ?>
</li>
</ul>
+
+ <h3>
+ <?= I18N::translate('Home page') ?>
+ </h3>
+
+ <ul class="fa-ul">
+ <li>
+ <span class="fa-li"><?= view('icons/block') ?></span>
+ <a href="<?= e(route('blocks')) ?>">
+ <?= I18N::translate('Blocks') ?>
+ </a>
+ <?= view('components/badge', ['count' => $block_modules_enabled->count(), 'total' => $block_modules_disabled->count(), 'context' => 'primary']) ?>
+ </li>
+ </ul>
</div>
+
<div class="col-sm-6">
<h3>
<?= I18N::translate('Individual page') ?>
</h3>
+
<ul class="fa-ul">
<li>
<span class="fa-li"><?= view('icons/tab') ?></span>
@@ -391,28 +411,25 @@
<?= view('components/badge', ['count' => $history_modules_enabled->count(), 'total' => $history_modules_disabled->count(), 'context' => 'primary']) ?>
</li>
</ul>
- <h3>
- <?= I18N::translate('Home page') ?>
- </h3>
- <ul class="fa-ul">
- <li>
- <span class="fa-li"><?= view('icons/block') ?></span>
- <a href="<?= e(route('blocks')) ?>">
- <?= I18N::translate('Blocks') ?>
- </a>
- <?= view('components/badge', ['count' => $block_modules_enabled->count(), 'total' => $block_modules_disabled->count(), 'context' => 'primary']) ?>
- </li>
- </ul>
+
<h3>
<?= I18N::translate('Other') ?>
</h3>
+
<ul class="fa-ul">
- <?php foreach ($config_modules as $module) : ?>
+ <?php foreach ($other_modules as $module) : ?>
<li>
- <span class="fa-li"><?= view('icons/preferences') ?></span>
- <a href="<?= e($module->getConfigLink()) ?>">
+ <span class="fa-li"><?= view('icons/module') ?></span>
+ <?php if ($module->isEnabled() && $module instanceof ModuleConfigInterface): ?>
+ <a href="<?= e($module->getConfigLink()) ?>">
+ <?= $module->title() ?>
+ <span class="fa"><?= view('icons/preferences') ?></span>
+ </a>
+ <?php elseif ($module->isEnabled()) :?>
<?= $module->title() ?>
- </a>
+ <?php else :?>
+ <del class="text-muted"><?= $module->title() ?></del>
+ <?php endif ?>
</li>
<?php endforeach ?>
</ul>
diff --git a/resources/views/components/badge.phtml b/resources/views/components/badge.phtml
index 29baaf8948..82a341c656 100644
--- a/resources/views/components/badge.phtml
+++ b/resources/views/components/badge.phtml
@@ -1,10 +1,8 @@
<?php use Fisharebest\Webtrees\I18N; ?>
-<?php if ($count > 0) : ?>
- <span class="badge badge-<?= $context ?? 'secondary' ?>">
+<span class="badge badge-<?= $context ?? 'secondary' ?>">
<?= I18N::number($count) ?>
- <?php if (($total ?? $count) > $count) : ?>
- / <?= I18N::number($total) ?>
- <?php endif ?>
- </span>
-<?php endif ?>
+ <?php if (($total ?? $count) > $count) : ?>
+ / <?= I18N::number($total) ?>
+ <?php endif ?>
+</span>