xref: /webtrees/app/Module/FamilyNavigatorModule.php (revision b2dd3be6317810cbb439bcfcb5e03e2cf038e314)
1<?php
2/**
3 * webtrees: online genealogy
4 * Copyright (C) 2018 webtrees development team
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16namespace Fisharebest\Webtrees\Module;
17
18use Fisharebest\Webtrees\Family;
19use Fisharebest\Webtrees\Functions\Functions;
20use Fisharebest\Webtrees\I18N;
21use Fisharebest\Webtrees\Individual;
22use Fisharebest\Webtrees\Menu;
23
24/**
25 * Class FamilyNavigatorModule
26 */
27class FamilyNavigatorModule extends AbstractModule implements ModuleSidebarInterface {
28	/** {@inheritdoc} */
29	public function getTitle() {
30		return /* I18N: Name of a module/sidebar */ I18N::translate('Family navigator');
31	}
32
33	/** {@inheritdoc} */
34	public function getDescription() {
35		return /* I18N: Description of the “Family navigator” module */ I18N::translate('A sidebar showing an individual’s close families and relatives.');
36	}
37
38	/** {@inheritdoc} */
39	public function defaultSidebarOrder() {
40		return 20;
41	}
42
43	/** {@inheritdoc} */
44	public function hasSidebarContent(Individual $individual) {
45		return true;
46	}
47
48	/** {@inheritdoc} */
49	public function getSidebarAjaxContent() {
50		return '';
51	}
52
53	/**
54	 * Load this sidebar synchronously.
55	 *
56	 * @param Individual $individual
57	 *
58	 * @return string
59	 */
60	public function getSidebarContent(Individual $individual) {
61		return view('sidebars/family-navigator', ['individual' => $individual]);
62	}
63}
64