xref: /webtrees/app/Http/RequestHandlers/CreateNoteModal.php (revision d11be7027e34e3121be11cc025421873364403f9)
1d4265d07SGreg Roach<?php
2d4265d07SGreg Roach
3d4265d07SGreg Roach/**
4d4265d07SGreg Roach * webtrees: online genealogy
5*d11be702SGreg Roach * Copyright (C) 2023 webtrees development team
6d4265d07SGreg Roach * This program is free software: you can redistribute it and/or modify
7d4265d07SGreg Roach * it under the terms of the GNU General Public License as published by
8d4265d07SGreg Roach * the Free Software Foundation, either version 3 of the License, or
9d4265d07SGreg Roach * (at your option) any later version.
10d4265d07SGreg Roach * This program is distributed in the hope that it will be useful,
11d4265d07SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
12d4265d07SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13d4265d07SGreg Roach * GNU General Public License for more details.
14d4265d07SGreg Roach * You should have received a copy of the GNU General Public License
1589f7189bSGreg Roach * along with this program. If not, see <https://www.gnu.org/licenses/>.
16d4265d07SGreg Roach */
17d4265d07SGreg Roach
18d4265d07SGreg Roachdeclare(strict_types=1);
19d4265d07SGreg Roach
20d4265d07SGreg Roachnamespace Fisharebest\Webtrees\Http\RequestHandlers;
21d4265d07SGreg Roach
22b55cbc6bSGreg Roachuse Fisharebest\Webtrees\Validator;
23d4265d07SGreg Roachuse Psr\Http\Message\ResponseInterface;
24d4265d07SGreg Roachuse Psr\Http\Message\ServerRequestInterface;
25d4265d07SGreg Roachuse Psr\Http\Server\RequestHandlerInterface;
26d4265d07SGreg Roach
27d4265d07SGreg Roachuse function response;
28d4265d07SGreg Roachuse function view;
29d4265d07SGreg Roach
30d4265d07SGreg Roach/**
31d4265d07SGreg Roach * Show a form to create a new note object.
32d4265d07SGreg Roach */
33d4265d07SGreg Roachclass CreateNoteModal implements RequestHandlerInterface
34d4265d07SGreg Roach{
35d4265d07SGreg Roach    /**
36d4265d07SGreg Roach     * Show a form to create a new note object.
37d4265d07SGreg Roach     *
38d4265d07SGreg Roach     * @param ServerRequestInterface $request
39d4265d07SGreg Roach     *
40d4265d07SGreg Roach     * @return ResponseInterface
41d4265d07SGreg Roach     */
42d4265d07SGreg Roach    public function handle(ServerRequestInterface $request): ResponseInterface
43d4265d07SGreg Roach    {
44b55cbc6bSGreg Roach        $tree = Validator::attributes($request)->tree();
45d4265d07SGreg Roach
46d4265d07SGreg Roach        return response(view('modals/create-note-object', [
47d4265d07SGreg Roach            'tree' => $tree,
48d4265d07SGreg Roach        ]));
49d4265d07SGreg Roach    }
50d4265d07SGreg Roach}
51