1853f2b8aSGreg Roach<?php 2853f2b8aSGreg Roach 3853f2b8aSGreg Roach/** 4853f2b8aSGreg Roach * webtrees: online genealogy 5853f2b8aSGreg Roach * Copyright (C) 20 webtrees development team 6853f2b8aSGreg Roach * This program is free software: you can redistribute it and/or modify 7853f2b8aSGreg Roach * it under the terms of the GNU General Public License as published by 8853f2b8aSGreg Roach * the Free Software Foundation, either version 3 of the License, or 9853f2b8aSGreg Roach * (at your option) any later version. 10853f2b8aSGreg Roach * This program is distributed in the hope that it will be useful, 11853f2b8aSGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of 12853f2b8aSGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13853f2b8aSGreg Roach * GNU General Public License for more details. 14853f2b8aSGreg Roach * You should have received a copy of the GNU General Public License 15853f2b8aSGreg Roach * along with this program. If not, see <https://www.gnu.org/licenses/>. 16853f2b8aSGreg Roach */ 17853f2b8aSGreg Roach 18853f2b8aSGreg Roachdeclare(strict_types=1); 19853f2b8aSGreg Roach 20853f2b8aSGreg Roachnamespace Fisharebest\Webtrees\Http\RequestHandlers; 21853f2b8aSGreg Roach 22853f2b8aSGreg Roachuse Fisharebest\Webtrees\FlashMessages; 23853f2b8aSGreg Roachuse Fisharebest\Webtrees\I18N; 248a1a28d7SGreg Roachuse Fisharebest\Webtrees\Module\ModuleShareInterface; 25853f2b8aSGreg Roachuse Psr\Http\Message\ResponseInterface; 26853f2b8aSGreg Roachuse Psr\Http\Message\ServerRequestInterface; 27853f2b8aSGreg Roach 28853f2b8aSGreg Roachuse function redirect; 29853f2b8aSGreg Roachuse function route; 30853f2b8aSGreg Roach 31853f2b8aSGreg Roach/** 32853f2b8aSGreg Roach * Update a list of modules. 33853f2b8aSGreg Roach */ 348a1a28d7SGreg Roachclass ModulesSharesAction extends AbstractModuleComponentAction 35853f2b8aSGreg Roach{ 36853f2b8aSGreg Roach /** 37853f2b8aSGreg Roach * @param ServerRequestInterface $request 38853f2b8aSGreg Roach * 39853f2b8aSGreg Roach * @return ResponseInterface 40853f2b8aSGreg Roach */ 41853f2b8aSGreg Roach public function handle(ServerRequestInterface $request): ResponseInterface 42853f2b8aSGreg Roach { 438a1a28d7SGreg Roach $this->updateStatus(ModuleShareInterface::class, $request); 44853f2b8aSGreg Roach 45853f2b8aSGreg Roach FlashMessages::addMessage(I18N::translate('The website preferences have been updated.'), 'success'); 46853f2b8aSGreg Roach 47*914ea12fSGreg Roach return redirect(route(ModulesSharesPage::class)); 48853f2b8aSGreg Roach } 49853f2b8aSGreg Roach} 50