4 * Copyright © 2003-2024 The Galette Team
6 * This file is part of Galette (https://galette.eu).
8 * Galette is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
13 * Galette is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with Galette. If not, see <http://www.gnu.org/licenses/>.
22 use Galette\Controllers\Crud
;
23 use Slim\Routing\RouteCollectorProxy
;
25 $app->group('/public', function (RouteCollectorProxy
$app) use ($routeparser) {
28 '/{type:list|trombi}[/{option:page|order}/{value:\d+|\w+}]',
29 [Crud\MembersController
::class, 'publicList']
30 )->setName('publicList');
32 //members list filtering
34 '/{type:list|trombi}/filter[/{from}]',
35 [Crud\MembersController
::class, 'filterPublicList']
36 )->setName('filterPublicList');
39 '/members[/{option:page|order}/{value:\d+|\w+}]',
40 function ($request, $response, string $option = null, string $value = null) use ($routeparser) {
41 $args = ['type' => 'list'];
42 if ($option !== null && $value !== null) {
43 $args['option'] = $option;
44 $args['value'] = $value;
48 ->withHeader('Location', $routeparser->urlFor('publicList', $args));
54 function ($request, $response) use ($routeparser) {
55 $args = ['type' => 'trombi'];
58 ->withHeader('Location', $routeparser->urlFor('publicList', $args));
63 '/documents[/{option:page|order}/{value:\d+|\w+}]',
64 [Crud\DocumentsController
::class, 'publicList']
65 )->setName('documentsPublicList');
66 })->add(\Galette\Middleware\PublicPages
::class);