xref: /webtrees/app/Module/FamilyNavigatorModule.php (revision 8fcd0d32e56ee262912bbdb593202cfd1cbc1615)
18c2e8227SGreg Roach<?php
28c2e8227SGreg Roach/**
38c2e8227SGreg Roach * webtrees: online genealogy
4*8fcd0d32SGreg Roach * Copyright (C) 2019 webtrees development team
58c2e8227SGreg Roach * This program is free software: you can redistribute it and/or modify
68c2e8227SGreg Roach * it under the terms of the GNU General Public License as published by
78c2e8227SGreg Roach * the Free Software Foundation, either version 3 of the License, or
88c2e8227SGreg Roach * (at your option) any later version.
98c2e8227SGreg Roach * This program is distributed in the hope that it will be useful,
108c2e8227SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
118c2e8227SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
128c2e8227SGreg Roach * GNU General Public License for more details.
138c2e8227SGreg Roach * You should have received a copy of the GNU General Public License
148c2e8227SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>.
158c2e8227SGreg Roach */
16e7f56f2aSGreg Roachdeclare(strict_types=1);
17e7f56f2aSGreg Roach
1876692c8bSGreg Roachnamespace Fisharebest\Webtrees\Module;
1976692c8bSGreg Roach
200e62c4b8SGreg Roachuse Fisharebest\Webtrees\I18N;
210e62c4b8SGreg Roachuse Fisharebest\Webtrees\Individual;
228c2e8227SGreg Roach
238c2e8227SGreg Roach/**
248c2e8227SGreg Roach * Class FamilyNavigatorModule
258c2e8227SGreg Roach */
26c1010edaSGreg Roachclass FamilyNavigatorModule extends AbstractModule implements ModuleSidebarInterface
27c1010edaSGreg Roach{
288c2e8227SGreg Roach    /** {@inheritdoc} */
298f53f488SRico Sonntag    public function getTitle(): string
30c1010edaSGreg Roach    {
31bbb76c12SGreg Roach        /* I18N: Name of a module/sidebar */
32bbb76c12SGreg Roach        return I18N::translate('Family navigator');
338c2e8227SGreg Roach    }
348c2e8227SGreg Roach
358c2e8227SGreg Roach    /** {@inheritdoc} */
368f53f488SRico Sonntag    public function getDescription(): string
37c1010edaSGreg Roach    {
38bbb76c12SGreg Roach        /* I18N: Description of the “Family navigator” module */
39bbb76c12SGreg Roach        return I18N::translate('A sidebar showing an individual’s close families and relatives.');
408c2e8227SGreg Roach    }
418c2e8227SGreg Roach
428c2e8227SGreg Roach    /** {@inheritdoc} */
438f53f488SRico Sonntag    public function defaultSidebarOrder(): int
44c1010edaSGreg Roach    {
458c2e8227SGreg Roach        return 20;
468c2e8227SGreg Roach    }
478c2e8227SGreg Roach
488c2e8227SGreg Roach    /** {@inheritdoc} */
498f53f488SRico Sonntag    public function hasSidebarContent(Individual $individual): bool
50c1010edaSGreg Roach    {
5138a9583bSGreg Roach        return true;
528c2e8227SGreg Roach    }
538c2e8227SGreg Roach
5476692c8bSGreg Roach    /**
5576692c8bSGreg Roach     * Load this sidebar synchronously.
5676692c8bSGreg Roach     *
57225e381fSGreg Roach     * @param Individual $individual
58225e381fSGreg Roach     *
5976692c8bSGreg Roach     * @return string
6076692c8bSGreg Roach     */
618f53f488SRico Sonntag    public function getSidebarContent(Individual $individual): string
62c1010edaSGreg Roach    {
63a8cd57e1SGreg Roach        return view('modules/family_nav/sidebar', ['individual' => $individual]);
648c2e8227SGreg Roach    }
658c2e8227SGreg Roach}
66