xref: /webtrees/app/Module/FamilyNavigatorModule.php (revision 1e3dc5600dd51eb89325a4497367d793ff23fb6b)
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\I18N;
19use Fisharebest\Webtrees\Individual;
20
21/**
22 * Class FamilyNavigatorModule
23 */
24class FamilyNavigatorModule extends AbstractModule implements ModuleSidebarInterface {
25	/** {@inheritdoc} */
26	public function getTitle() {
27		return /* I18N: Name of a module/sidebar */ I18N::translate('Family navigator');
28	}
29
30	/** {@inheritdoc} */
31	public function getDescription() {
32		return /* I18N: Description of the “Family navigator” module */ I18N::translate('A sidebar showing an individual’s close families and relatives.');
33	}
34
35	/** {@inheritdoc} */
36	public function defaultSidebarOrder() {
37		return 20;
38	}
39
40	/** {@inheritdoc} */
41	public function hasSidebarContent(Individual $individual) {
42		return true;
43	}
44
45	/**
46	 * Load this sidebar synchronously.
47	 *
48	 * @param Individual $individual
49	 *
50	 * @return string
51	 */
52	public function getSidebarContent(Individual $individual) {
53		return view('modules/family_nav/sidebar', ['individual' => $individual]);
54	}
55}
56