xref: /webtrees/app/Module/ModuleSidebarInterface.php (revision d11be7027e34e3121be11cc025421873364403f9)
1a25f0a04SGreg Roach<?php
23976b470SGreg Roach
3a25f0a04SGreg Roach/**
4a25f0a04SGreg Roach * webtrees: online genealogy
5*d11be702SGreg Roach * Copyright (C) 2023 webtrees development team
6a25f0a04SGreg Roach * This program is free software: you can redistribute it and/or modify
7a25f0a04SGreg Roach * it under the terms of the GNU General Public License as published by
8a25f0a04SGreg Roach * the Free Software Foundation, either version 3 of the License, or
9a25f0a04SGreg Roach * (at your option) any later version.
10a25f0a04SGreg Roach * This program is distributed in the hope that it will be useful,
11a25f0a04SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
12a25f0a04SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13a25f0a04SGreg Roach * GNU General Public License for more details.
14a25f0a04SGreg 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/>.
16a25f0a04SGreg Roach */
17fcfa147eSGreg Roach
18e7f56f2aSGreg Roachdeclare(strict_types=1);
19e7f56f2aSGreg Roach
2076692c8bSGreg Roachnamespace Fisharebest\Webtrees\Module;
21a25f0a04SGreg Roach
22225e381fSGreg Roachuse Fisharebest\Webtrees\Individual;
238eaf8709SGreg Roachuse Illuminate\Support\Collection;
24225e381fSGreg Roach
25a25f0a04SGreg Roach/**
26a25f0a04SGreg Roach * Interface ModuleSidebarInterface - Classes and libraries for module system
27a25f0a04SGreg Roach */
2837eb8894SGreg Roachinterface ModuleSidebarInterface extends ModuleInterface
29c1010edaSGreg Roach{
3039402588SGreg Roach    /**
3139402588SGreg Roach     * The text that appears on the sidebar's title.
3239402588SGreg Roach     *
33db39ef31SGreg Roach     * @param Individual $individual
34db39ef31SGreg Roach     *
3539402588SGreg Roach     * @return string
3639402588SGreg Roach     */
37db39ef31SGreg Roach    public function sidebarTitle(Individual $individual): string;
38defb8071SRichard Cissée
39a25f0a04SGreg Roach    /**
4049a243cbSGreg Roach     * Users change change the order of sidebars using the control panel.
4149a243cbSGreg Roach     *
4249a243cbSGreg Roach     * @param int $sidebar_order
4349a243cbSGreg Roach     *
4449a243cbSGreg Roach     * @return void
4549a243cbSGreg Roach     */
4649a243cbSGreg Roach    public function setSidebarOrder(int $sidebar_order): void;
4749a243cbSGreg Roach
4849a243cbSGreg Roach    /**
4949a243cbSGreg Roach     * Users change change the order of sidebars using the control panel.
50a25f0a04SGreg Roach     *
51cbc1590aSGreg Roach     * @return int
52a25f0a04SGreg Roach     */
5349a243cbSGreg Roach    public function getSidebarOrder(): int;
5449a243cbSGreg Roach
5549a243cbSGreg Roach    /**
5649a243cbSGreg Roach     * The default position for this sidebar.  It can be changed in the control panel.
5749a243cbSGreg Roach     *
5849a243cbSGreg Roach     * @return int
5949a243cbSGreg Roach     */
60c1afbf58SGreg Roach    public function defaultSidebarOrder(): int;
61a25f0a04SGreg Roach
62a25f0a04SGreg Roach    /**
63e490cd80SGreg Roach     * Sidebar content.
64cbc1590aSGreg Roach     *
65225e381fSGreg Roach     * @param Individual $individual
66225e381fSGreg Roach     *
67a25f0a04SGreg Roach     * @return string
68a25f0a04SGreg Roach     */
698f53f488SRico Sonntag    public function getSidebarContent(Individual $individual): string;
70a25f0a04SGreg Roach
71a25f0a04SGreg Roach    /**
72a25f0a04SGreg Roach     * Does this sidebar have anything to display for this individual?
73a25f0a04SGreg Roach     *
74962e29c9SGreg Roach     * @param Individual $individual
75225e381fSGreg Roach     *
76cbc1590aSGreg Roach     * @return bool
77a25f0a04SGreg Roach     */
788f53f488SRico Sonntag    public function hasSidebarContent(Individual $individual): bool;
798eaf8709SGreg Roach    /**
808eaf8709SGreg Roach     * This module handles the following facts - so don't show them on the "Facts and events" tab.
818eaf8709SGreg Roach     *
8236779af1SGreg Roach     * @return Collection<int,string>
838eaf8709SGreg Roach     */
848eaf8709SGreg Roach    public function supportedFacts(): Collection;
85a25f0a04SGreg Roach}
86