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