xref: /webtrees/app/Module/ModuleListInterface.php (revision 1ff45046fabc22237b5d0d8e489c96f031fc598d)
167992b6aSRichard Cissee<?php
23976b470SGreg Roach
367992b6aSRichard Cissee/**
467992b6aSRichard Cissee * webtrees: online genealogy
5d11be702SGreg Roach * Copyright (C) 2023 webtrees development team
667992b6aSRichard Cissee * This program is free software: you can redistribute it and/or modify
767992b6aSRichard Cissee * it under the terms of the GNU General Public License as published by
867992b6aSRichard Cissee * the Free Software Foundation, either version 3 of the License, or
967992b6aSRichard Cissee * (at your option) any later version.
1067992b6aSRichard Cissee * This program is distributed in the hope that it will be useful,
1167992b6aSRichard Cissee * but WITHOUT ANY WARRANTY; without even the implied warranty of
1267992b6aSRichard Cissee * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1367992b6aSRichard Cissee * GNU General Public License for more details.
1467992b6aSRichard Cissee * 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/>.
1667992b6aSRichard Cissee */
17fcfa147eSGreg Roach
1867992b6aSRichard Cisseedeclare(strict_types=1);
1967992b6aSRichard Cissee
2067992b6aSRichard Cisseenamespace Fisharebest\Webtrees\Module;
2167992b6aSRichard Cissee
2267992b6aSRichard Cisseeuse Fisharebest\Webtrees\Menu;
2367992b6aSRichard Cisseeuse Fisharebest\Webtrees\Tree;
2467992b6aSRichard Cissee
2567992b6aSRichard Cissee/**
2667992b6aSRichard Cissee * Interface ModuleListInterface - Classes and libraries for module system
2767992b6aSRichard Cissee */
2867992b6aSRichard Cisseeinterface ModuleListInterface extends ModuleInterface
2967992b6aSRichard Cissee{
3067992b6aSRichard Cissee    /**
3167992b6aSRichard Cissee     * A main menu item for this list, or null if the list is empty.
3267992b6aSRichard Cissee     *
3367992b6aSRichard Cissee     * @param Tree $tree
3467992b6aSRichard Cissee     *
3567992b6aSRichard Cissee     * @return Menu|null
3667992b6aSRichard Cissee     */
37*1ff45046SGreg Roach    public function listMenu(Tree $tree): Menu|null;
3867992b6aSRichard Cissee
3967992b6aSRichard Cissee    /**
4067992b6aSRichard Cissee     * CSS class for the menu.
4167992b6aSRichard Cissee     *
4267992b6aSRichard Cissee     * @return string
4367992b6aSRichard Cissee     */
4467992b6aSRichard Cissee    public function listMenuClass(): string;
4567992b6aSRichard Cissee
4667992b6aSRichard Cissee    /**
4767992b6aSRichard Cissee     * The title for a specific instance of this list.
4867992b6aSRichard Cissee     *
4967992b6aSRichard Cissee     * @return string
5067992b6aSRichard Cissee     */
5167992b6aSRichard Cissee    public function listTitle(): string;
5267992b6aSRichard Cissee
5367992b6aSRichard Cissee    /**
5467992b6aSRichard Cissee     * The URL for a page showing list options.
5567992b6aSRichard Cissee     *
5667992b6aSRichard Cissee     * @param Tree                                      $tree
5776d39c55SGreg Roach     * @param array<bool|int|string|array<string>|null> $parameters
5867992b6aSRichard Cissee     *
5967992b6aSRichard Cissee     * @return string
6067992b6aSRichard Cissee     */
6167992b6aSRichard Cissee    public function listUrl(Tree $tree, array $parameters = []): string;
6267992b6aSRichard Cissee
6367992b6aSRichard Cissee    /**
6467992b6aSRichard Cissee     * Attributes for the URL.
6567992b6aSRichard Cissee     *
6624f2a3afSGreg Roach     * @return array<string>
6767992b6aSRichard Cissee     */
6867992b6aSRichard Cissee    public function listUrlAttributes(): array;
6967992b6aSRichard Cissee
704db4b4a9SGreg Roach    /**
714db4b4a9SGreg Roach     * @param Tree $tree
724db4b4a9SGreg Roach     *
734db4b4a9SGreg Roach     * @return bool
744db4b4a9SGreg Roach     */
7567992b6aSRichard Cissee    public function listIsEmpty(Tree $tree): bool;
7667992b6aSRichard Cissee}
77