xref: /webtrees/app/Http/RequestHandlers/ModulesMapAutocompleteAction.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\ModuleMapAutocompleteInterface;
25*c9c6f2ecSGreg Roachuse Psr\Http\Message\ResponseInterface;
26*c9c6f2ecSGreg Roachuse Psr\Http\Message\ServerRequestInterface;
27*c9c6f2ecSGreg Roach
28*c9c6f2ecSGreg Roachuse function redirect;
29*c9c6f2ecSGreg Roachuse function route;
30*c9c6f2ecSGreg Roach
31*c9c6f2ecSGreg Roach/**
32*c9c6f2ecSGreg Roach * Update a list of modules.
33*c9c6f2ecSGreg Roach */
34*c9c6f2ecSGreg Roachclass ModulesMapAutocompleteAction extends AbstractModuleComponentAction
35*c9c6f2ecSGreg Roach{
36*c9c6f2ecSGreg Roach    /**
37*c9c6f2ecSGreg Roach     * @param ServerRequestInterface $request
38*c9c6f2ecSGreg Roach     *
39*c9c6f2ecSGreg Roach     * @return ResponseInterface
40*c9c6f2ecSGreg Roach     */
41*c9c6f2ecSGreg Roach    public function handle(ServerRequestInterface $request): ResponseInterface
42*c9c6f2ecSGreg Roach    {
43*c9c6f2ecSGreg Roach        $this->updateStatus(ModuleMapAutocompleteInterface::class, $request);
44*c9c6f2ecSGreg Roach
45*c9c6f2ecSGreg Roach        FlashMessages::addMessage(I18N::translate('The website preferences have been updated.'), 'success');
46*c9c6f2ecSGreg Roach
47*c9c6f2ecSGreg Roach        return redirect(route(ControlPanel::class));
48*c9c6f2ecSGreg Roach    }
49*c9c6f2ecSGreg Roach}
50