xref: /webtrees/app/Http/RequestHandlers/ModulesMapProvidersAction.php (revision c9c6f2ec6e88594e58f14a6418e0de5aaa1484bd)
1*c9c6f2ecSGreg Roach<?php
2*c9c6f2ecSGreg Roach
3*c9c6f2ecSGreg Roach/**
4*c9c6f2ecSGreg Roach * webtrees: online genealogy
5*c9c6f2ecSGreg Roach * Copyright (C) 20 webtrees development team
6*c9c6f2ecSGreg Roach * This program is free software: you can redistribute it and/or modify
7*c9c6f2ecSGreg Roach * it under the terms of the GNU General Public License as published by
8*c9c6f2ecSGreg Roach * the Free Software Foundation, either version 3 of the License, or
9*c9c6f2ecSGreg Roach * (at your option) any later version.
10*c9c6f2ecSGreg Roach * This program is distributed in the hope that it will be useful,
11*c9c6f2ecSGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
12*c9c6f2ecSGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13*c9c6f2ecSGreg Roach * GNU General Public License for more details.
14*c9c6f2ecSGreg Roach * You should have received a copy of the GNU General Public License
15*c9c6f2ecSGreg Roach * along with this program. If not, see <https://www.gnu.org/licenses/>.
16*c9c6f2ecSGreg Roach */
17*c9c6f2ecSGreg Roach
18*c9c6f2ecSGreg Roachdeclare(strict_types=1);
19*c9c6f2ecSGreg Roach
20*c9c6f2ecSGreg Roachnamespace Fisharebest\Webtrees\Http\RequestHandlers;
21*c9c6f2ecSGreg Roach
22*c9c6f2ecSGreg Roachuse Fisharebest\Webtrees\FlashMessages;
23*c9c6f2ecSGreg Roachuse Fisharebest\Webtrees\I18N;
24*c9c6f2ecSGreg Roachuse Fisharebest\Webtrees\Module\ModuleMapLinkInterface;
25*c9c6f2ecSGreg Roachuse Fisharebest\Webtrees\Module\ModuleMapProviderInterface;
26*c9c6f2ecSGreg Roachuse Psr\Http\Message\ResponseInterface;
27*c9c6f2ecSGreg Roachuse Psr\Http\Message\ServerRequestInterface;
28*c9c6f2ecSGreg Roach
29*c9c6f2ecSGreg Roachuse function redirect;
30*c9c6f2ecSGreg Roachuse function route;
31*c9c6f2ecSGreg Roach
32*c9c6f2ecSGreg Roach/**
33*c9c6f2ecSGreg Roach * Update a list of modules.
34*c9c6f2ecSGreg Roach */
35*c9c6f2ecSGreg Roachclass ModulesMapProvidersAction extends AbstractModuleComponentAction
36*c9c6f2ecSGreg Roach{
37*c9c6f2ecSGreg Roach    /**
38*c9c6f2ecSGreg Roach     * @param ServerRequestInterface $request
39*c9c6f2ecSGreg Roach     *
40*c9c6f2ecSGreg Roach     * @return ResponseInterface
41*c9c6f2ecSGreg Roach     */
42*c9c6f2ecSGreg Roach    public function handle(ServerRequestInterface $request): ResponseInterface
43*c9c6f2ecSGreg Roach    {
44*c9c6f2ecSGreg Roach        $this->updateStatus(ModuleMapProviderInterface::class, $request);
45*c9c6f2ecSGreg Roach
46*c9c6f2ecSGreg Roach        FlashMessages::addMessage(I18N::translate('The website preferences have been updated.'), 'success');
47*c9c6f2ecSGreg Roach
48*c9c6f2ecSGreg Roach        return redirect(route(ControlPanel::class));
49*c9c6f2ecSGreg Roach    }
50*c9c6f2ecSGreg Roach}
51