diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/Http/Controllers/Admin/ControlPanelController.php | 2 | ||||
| -rw-r--r-- | app/Http/Controllers/Admin/ModuleController.php | 4 | ||||
| -rw-r--r-- | app/Module/BritishMonarchs.php | 109 | ||||
| -rw-r--r-- | app/Module/BritishPrimeMinisters.php | 136 | ||||
| -rw-r--r-- | app/Module/BritishSocialHistory.php | 67 | ||||
| -rw-r--r-- | app/Module/USPresidents.php | 106 | ||||
| -rw-r--r-- | app/Services/ModuleService.php | 214 |
7 files changed, 533 insertions, 105 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/app/Module/BritishMonarchs.php b/app/Module/BritishMonarchs.php new file mode 100644 index 0000000000..2c8213a6f8 --- /dev/null +++ b/app/Module/BritishMonarchs.php @@ -0,0 +1,109 @@ +<?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 BritishMonarchs + */ +class BritishMonarchs extends AbstractModule implements ModuleHistoricEventsInterface +{ + use ModuleHistoricEventsTrait; + + /** + * How should this module be labelled on tabs, menus, etc.? + * + * @return string + */ + public function title(): string + { + return 'British monarchs'; + } + + /** + * 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 William I, William the Conqueror\n2 TYPE English King\n2 DATE FROM @#DJULIAN@ 25 DEC 1066 TO @#DJULIAN@ 09 SEP 1087", + "1 EVEN William II\n2 TYPE English King\n2 DATE FROM @#DJULIAN@ 26 SEP 1087 TO @#DJULIAN@ 02 AUG 1100", + "1 EVEN Henry I\n2 TYPE English King\n2 DATE FROM @#DJULIAN@ 05 AUG 1100 TO @#DJULIAN@ 01 DEC 1135", + "1 EVEN Stephen\n2 TYPE English King\n2 DATE FROM @#DJULIAN@ 22 DEC 1135 TO @#DJULIAN@ 25 OCT 1154", + "1 EVEN Henry II\n2 TYPE English King\n2 DATE FROM @#DJULIAN@ 19 DEC 1154 TO @#DJULIAN@ 06 JUL 1189", + "1 EVEN Richard I, Richard the Lionheart\n2 TYPE English King\n2 DATE FROM @#DJULIAN@ 03 SEP 1189 TO @#DJULIAN@ 06 APR 1199", + "1 EVEN John\n2 TYPE English King\n2 DATE FROM @#DJULIAN@ 27 MAY 1199 TO @#DJULIAN@ 19 OCT 1216", + "1 EVEN Louis VIII\n2 TYPE Disputed English King\n2 DATE FROM @#DJULIAN@ NOV 1216 TO @#DJULIAN@ 22 SEP 1217", + "1 EVEN Henry III\n2 TYPE English King\n2 DATE FROM @#DJULIAN@ 28 OCT 1216 TO @#DJULIAN@ 16 NOV 1272", + "1 EVEN Edward I\n2 TYPE English King\n2 DATE FROM @#DJULIAN@ 20 NOV 1272 TO @#DJULIAN@ 07 JUL 1307", + "1 EVEN Edward II\n2 TYPE English King\n2 DATE FROM @#DJULIAN@ 08 JUL 1307 TO @#DJULIAN@ 20 JAN 1327", + "1 EVEN Edward III\n2 TYPE English King\n2 DATE FROM @#DJULIAN@ 25 JAN 1327 TO @#DJULIAN@ 21 JUN 1377", + "1 EVEN Richard II\n2 TYPE English King\n2 DATE FROM @#DJULIAN@ 22 JUN 1377 TO @#DJULIAN@ 29 SEP 1399", + "1 EVEN Henry IV\n2 TYPE English King\n2 DATE FROM @#DJULIAN@ 30 SEP 1399 TO @#DJULIAN@ 21 MAR 1413", + "1 EVEN Henry V\n2 TYPE English King\n2 DATE FROM @#DJULIAN@ 21 MAR 1413 TO @#DJULIAN@ 01 SEP 1422", + "1 EVEN Henry VI\n2 TYPE English King\n2 DATE FROM @#DJULIAN@ 01 SEP 1422 TO @#DJULIAN@ 04 MAR 1461", + "1 EVEN Edward IV\n2 TYPE English King\n2 DATE FROM @#DJULIAN@ 04 MAR 1461 TO @#DJULIAN@ 03 OCT 1470", + "1 EVEN Henry VI\n2 TYPE English King\n2 DATE FROM @#DJULIAN@ 03 OCT 1470 TO @#DJULIAN@ 11 APR 1471", + "1 EVEN Edward IV\n2 TYPE English King\n2 DATE FROM @#DJULIAN@ 11 APR 1471 TO @#DJULIAN@ 09 APR 1483", + "1 EVEN Richard III\n2 TYPE English King\n2 DATE FROM @#DJULIAN@ 09 APR 1483 TO @#DJULIAN@ 22 AUG 1485", + "1 EVEN Henry VI\n2 TYPE English King\n2 DATE FROM @#DJULIAN@ 22 AUG 1485 TO @#DJULIAN@ 22 APR 1509", + "1 EVEN Henry VII\n2 TYPE English King\n2 DATE FROM @#DJULIAN@ 22 APR 1509 TO @#DJULIAN@ 28 JAN 1547", + "1 EVEN Edward VI\n2 TYPE English King\n2 DATE FROM @#DJULIAN@ 28 JAN 1547 TO @#DJULIAN@ 10 JUL 1553", + "1 EVEN Lady Jane Grey\n2 TYPE Disputed English Queen\n2 DATE FROM @#DJULIAN@ 10 JUL 1553 TO @#DJULIAN@ 19 JUL 1553", + "1 EVEN Mary I\n2 TYPE English Queen\n2 DATE FROM @#DJULIAN@ 19 JUL 1553 TO @#DJULIAN@ 17 NOV 1558", + "1 EVEN Philip\n2 TYPE English King\n2 DATE FROM @#DJULIAN@ 25 JUL 1554 TO @#DJULIAN@ 17 NOV 1558", + "1 EVEN Elizabeth I\n2 TYPE English King\n2 DATE FROM @#DJULIAN@ 17 NOV 1558 TO @#DJULIAN@ 24 MAR 1603", + "1 EVEN James I\n2 TYPE English King\n2 DATE FROM @#DJULIAN@ 24 MAR 1603 TO @#DJULIAN@ 27 MAR 1625", + "1 EVEN Charles I\n2 TYPE English King\n2 DATE FROM @#DJULIAN@ 27 MAR 1625 TO @#DJULIAN@ 30 JAN 1649", + "1 EVEN Oliver Cromwell\n2 TYPE Lord Protector\n2 DATE FROM @#DJULIAN@ 16 DEC 1653 TO @#DJULIAN@ 03 SEP 1658", + "1 EVEN Richard Cromwell\n2 TYPE Lord Protector\n2 DATE FROM @#DJULIAN@ 03 SEP 1658 TO @#DJULIAN@ 07 MAY 1659", + "1 EVEN Charles II\n2 TYPE English King\n2 DATE FROM @#DJULIAN@ 29 MAY 1660 TO @#DJULIAN@ 06 FEB 1685", + "1 EVEN James II\n2 TYPE English King\n2 DATE FROM @#DJULIAN@ 06 FEB 1685 TO @#DJULIAN@ 13 FEB 1689", + "1 EVEN Mary II\n2 TYPE English Queen\n2 DATE FROM @#DJULIAN@ 13 FEB 1689 TO @#DJULIAN@ 13 FEB 1689", + "1 EVEN William II\n2 TYPE English King\n2 DATE FROM @#DJULIAN@ 13 FEB 1689 TO @#DJULIAN@ 08 MAR 1702", + "1 EVEN Anne\n2 TYPE English Queen\n2 DATE FROM @#DJULIAN@ 08 MAR 1702 TO @#DJULIAN@ 01 MAY 1707", + "1 EVEN Anne\n2 TYPE British Queen\n2 DATE FROM @#DJULIAN@ 01 MAY 1707 TO @#DJULIAN@ 01 AUG 1714", + "1 EVEN George I\n2 TYPE British King\n2 DATE FROM @#DJULIAN@ 01 AUG 1714 TO @#DJULIAN@ 11 JUN 1727", + "1 EVEN George II\n2 TYPE British King\n2 DATE FROM @#DJULIAN@ 11 JUN 1727 TO 25 OCT 1760", + "1 EVEN George III\n2 TYPE British King\n2 DATE FROM 25 OCT 1760 TO 29 JAN 1820", + "1 EVEN George IV\n2 TYPE British King\n2 DATE FROM 29 JAN 1820 TO 26 JUN 1830", + "1 EVEN William IV\n2 TYPE British King\n2 DATE FROM 26 JUN 1830 TO 20 JUN 1837", + "1 EVEN Victoria\n2 TYPE British Queen\n2 DATE FROM 20 JUN 1837 TO 22 JAN 1901", + "1 EVEN Edward VII\n2 TYPE British King\n2 DATE FROM 22 JAN 1901 TO 06 MAY 1910", + "1 EVEN George V\n2 TYPE British King\n2 DATE FROM 06 MAY 1910 TO 20 JAN 1936", + "1 EVEN Edward VII\n2 TYPE British King\n2 DATE FROM 20 JAN 1936 TO 11 DEC 1936", + "1 EVEN George VI\n2 TYPE British King\n2 DATE FROM 11 DEC 1936 TO 06 FEB 1952", + "1 EVEN Elizabeth II\n2 TYPE British Queen\n2 DATE FROM 06 FEB 1952", + ]); + } +} + +; diff --git a/app/Module/BritishPrimeMinisters.php b/app/Module/BritishPrimeMinisters.php new file mode 100644 index 0000000000..4d5e920fee --- /dev/null +++ b/app/Module/BritishPrimeMinisters.php @@ -0,0 +1,136 @@ +<?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 BritishPrimeMinisters + * + * @package Fisharebest\Webtrees\Module + */ +class BritishPrimeMinisters extends AbstractModule implements ModuleHistoricEventsInterface +{ + use ModuleHistoricEventsTrait; + + /** + * How should this module be labelled on tabs, menus, etc.? + * + * @return string + */ + public function title(): string + { + return 'British prime ministers'; + } + + /** + * 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 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/app/Module/USPresidents.php b/app/Module/USPresidents.php new file mode 100644 index 0000000000..bc868695ac --- /dev/null +++ b/app/Module/USPresidents.php @@ -0,0 +1,106 @@ +<?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 USPresidents + */ +class USPresidents extends AbstractModule implements ModuleHistoricEventsInterface +{ + use ModuleHistoricEventsTrait; + + /** + * How should this module be labelled on tabs, menus, etc.? + * + * @return string + */ + public function title(): string + { + return 'United States presidents'; + } + + /** + * 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 George Washington\n2 TYPE 1st President of the United States\n2 DATE 30 APR 1789", + "1 EVEN John Adams\n2 TYPE 2nd President of the United States\n2 DATE 4 MAR 1797", + "1 EVEN Thomas Jefferson\n2 TYPE 3rd President of the United States\n2 DATE 4 MAR 1801", + "1 EVEN James Madison\n2 TYPE 4th President of the United States\n2 DATE 4 MAR 1809", + "1 EVEN James Monroe\n2 TYPE 5th President of the United States\n2 DATE 4 MAR 1817", + "1 EVEN John Quincy Adams\n2 TYPE 6th President of the United States\n2 DATE 4 MAR 1825", + "1 EVEN Andrew Jackson\n2 TYPE 7th President of the United States\n2 DATE 4 MAR 1829", + "1 EVEN Martin Van Buren\n2 TYPE 8th President of the United States\n2 DATE 4 MAR 1837", + "1 EVEN William Henry Harrison\n2 TYPE 9th President of the United States\n2 DATE 4 MAR 1841", + "1 EVEN John Tyler\n2 TYPE 10th President of the United States\n2 DATE 4 APR 1841", + "1 EVEN James K Polk\n2 TYPE 11th President of the United States\n2 DATE 4 MAR 1845", + "1 EVEN Zachary Taylor\n2 TYPE 12th President of the United States\n2 DATE 4 MAR 1849", + "1 EVEN Millard Fillmore\n2 TYPE 13th President of the United States\n2 DATE 9 JUL 1850", + "1 EVEN Franklin Pierce\n2 TYPE 14th President of the United States\n2 DATE 4 MAR 1853", + "1 EVEN James Buchanan\n2 TYPE 15th President of the United States\n2 DATE 4 MAR 1857", + "1 EVEN Abraham Lincoln\n2 TYPE 16th President of the United States\n2 DATE 4 MAR 1861", + "1 EVEN Andrew Johnson\n2 TYPE 17th President of the United States\n2 DATE 15 APR 1865", + "1 EVEN Ulysses S Grant\n2 TYPE 18th President of the United States\n2 DATE 4 MAR 1869", + "1 EVEN Rutherford B Hayes\n2 TYPE 19th President of the United States\n2 DATE 4 MAR 1877", + "1 EVEN James A Garfield\n2 TYPE 20th President of the United States\n2 DATE 4 MAR 1881", + "1 EVEN Chester A Arthur\n2 TYPE 21st President of the United States\n2 DATE 19 SEP 1881", + "1 EVEN Grover Cleveland\n2 TYPE 22nd President of the United States\n2 DATE 4 MAR 1885", + "1 EVEN Benjamin Harrison\n2 TYPE 23rd President of the United States\n2 DATE 4 MAR 1889", + "1 EVEN Grover Cleveland\n2 TYPE 24th President of the United States\n2 DATE 4 MAR 1893", + "1 EVEN William McKinley\n2 TYPE 25th President of the United States\n2 DATE 4 MAR 1897", + "1 EVEN Theodore Roosevelt\n2 TYPE 26th President of the United States\n2 DATE 14 SEP 1901", + "1 EVEN William Howard Taft\n2 TYPE 27th President of the United States\n2 DATE 4 MAR 1909", + "1 EVEN Woodrow Wilson\n2 TYPE 28th President of the United States\n2 DATE 4 MAR 1913", + "1 EVEN Warren G Harding\n2 TYPE 29th President of the United States\n2 DATE 4 MAR 1921", + "1 EVEN Calvin Coolidge\n2 TYPE 30th President of the United States\n2 DATE 2 AUG 1923", + "1 EVEN Herbert Hoover\n2 TYPE 31st President of the United States\n2 DATE 4 MAR 1929", + "1 EVEN Franklin D Roosevelt\n2 TYPE 32nd President of the United States\n2 DATE 4 MAR 1933", + "1 EVEN Harry S Truman\n2 TYPE 33rd President of the United States\n2 DATE 12 APR 1945", + "1 EVEN Dwight D Eisenhower\n2 TYPE 34th President of the United States\n2 DATE 20 JAN 1953", + "1 EVEN John F Kennedy\n2 TYPE 35th President of the United States\n2 DATE 20 JAN 1961", + "1 EVEN Lyndon B Johnson\n2 TYPE 36th President of the United States\n2 DATE 22 NOV 1963", + "1 EVEN Richard Nixon\n2 TYPE 37th President of the United States\n2 DATE 20 JAN 1969", + "1 EVEN Gerald Ford\n2 TYPE 38th President of the United States\n2 DATE 9 AUG 1974", + "1 EVEN Jimmy Carter\n2 TYPE 39th President of the United States\n2 DATE 20 JAN 1977", + "1 EVEN Ronald Reagan\n2 TYPE 40th President of the United States\n2 DATE 20 JAN 1981", + "1 EVEN George H W Bush\n2 TYPE 41st President of the United States\n2 DATE 20 JAN 1989", + "1 EVEN Bill Clinton\n2 TYPE 42nd President of the United States\n2 DATE 20 JAN 1993", + "1 EVEN George W Bush\n2 TYPE 43rd President of the United States\n2 DATE 20 JAN 2001", + "1 EVEN Barack Obama\n2 TYPE 44th President of the United States\n2 DATE 20 JAN 2009", + "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; |
