xref: /webtrees/app/Module/AhnentafelReportModule.php (revision 299d100d2d85cd31f10efd927570655dd165b510)
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\Auth;
19use Fisharebest\Webtrees\I18N;
20use Fisharebest\Webtrees\Menu;
21
22/**
23 * Class AhnentafelReportModule
24 */
25class AhnentafelReportModule extends AbstractModule implements ModuleReportInterface {
26	/**
27	 * How should this module be labelled on tabs, menus, etc.?
28	 *
29	 * @return string
30	 */
31	public function getTitle() {
32		// This text also appears in the .XML file - update both together
33		return /* I18N: Name of a module/report */ I18N::translate('Ancestors');
34	}
35
36	/**
37	 * A sentence describing what this module does.
38	 *
39	 * @return string
40	 */
41	public function getDescription() {
42		// This text also appears in the .XML file - update both together
43		return /* I18N: Description of the “Ancestors” module */ I18N::translate('A report of an individual’s ancestors, in a narrative style.');
44	}
45
46	/**
47	 * What is the default access level for this module?
48	 *
49	 * Some modules are aimed at admins or managers, and are not generally shown to users.
50	 *
51	 * @return int
52	 */
53	public function defaultAccessLevel() {
54		return Auth::PRIV_PRIVATE;
55	}
56
57	/**
58	 * Return a menu item for this report.
59	 *
60	 * @return Menu
61	 */
62	public function getReportMenu() {
63		global $WT_TREE;
64
65		return new Menu(
66			$this->getTitle(),
67			e(route('report-setup', ['ged' => $WT_TREE->getName(), 'report' => $this->getName()])),
68			'menu-report-' . $this->getName(),
69			['rel' => 'nofollow']
70		);
71	}
72}
73