xref: /webtrees/app/Module/ModuleSidebarInterface.php (revision 74512d6ac146245d47cbb558ff0cd343f0619ee7)
1<?php
2
3/**
4 * webtrees: online genealogy
5 * Copyright (C) 2021 webtrees development team
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18declare(strict_types=1);
19
20namespace Fisharebest\Webtrees\Module;
21
22use Fisharebest\Webtrees\Individual;
23use Illuminate\Support\Collection;
24
25/**
26 * Interface ModuleSidebarInterface - Classes and libraries for module system
27 */
28interface ModuleSidebarInterface extends ModuleInterface
29{
30    /**
31     * The text that appears on the sidebar's title.
32     *
33     * @param Individual $individual
34     *
35     * @return string
36     */
37    public function sidebarTitle(Individual $individual): string;
38
39    /**
40     * Users change change the order of sidebars using the control panel.
41     *
42     * @param int $sidebar_order
43     *
44     * @return void
45     */
46    public function setSidebarOrder(int $sidebar_order): void;
47
48    /**
49     * Users change change the order of sidebars using the control panel.
50     *
51     * @return int
52     */
53    public function getSidebarOrder(): int;
54
55    /**
56     * The default position for this sidebar.  It can be changed in the control panel.
57     *
58     * @return int
59     */
60    public function defaultSidebarOrder(): int;
61
62    /**
63     * Sidebar content.
64     *
65     * @param Individual $individual
66     *
67     * @return string
68     */
69    public function getSidebarContent(Individual $individual): string;
70
71    /**
72     * Does this sidebar have anything to display for this individual?
73     *
74     * @param Individual $individual
75     *
76     * @return bool
77     */
78    public function hasSidebarContent(Individual $individual): bool;
79    /**
80     * This module handles the following facts - so don't show them on the "Facts and events" tab.
81     *
82     * @return Collection<int,string>
83     */
84    public function supportedFacts(): Collection;
85}
86