xref: /webtrees/app/Module/DeathReportModule.php (revision 0ee1319888cc0d02945fb962bd91ef97591f55e4)
1<?php
2/**
3 * webtrees: online genealogy
4 * Copyright (C) 2015 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 DeathReportModule
24 */
25class DeathReportModule extends AbstractModule implements ModuleReportInterface {
26	/** {@inheritdoc} */
27	public function getTitle() {
28		// This text also appears in the .XML file - update both together
29		return /* I18N: Name of a module/report */ I18N::translate('Deaths');
30	}
31
32	/** {@inheritdoc} */
33	public function getDescription() {
34		// This text also appears in the .XML file - update both together
35		return /* I18N: Description of the “Deaths” module */ I18N::translate('A report of individuals who died in a given time or place.');
36	}
37
38	/**
39	 * What is the default access level for this module?
40	 *
41	 * Some modules are aimed at admins or managers, and are not generally shown to users.
42	 *
43	 * @return int
44	 */
45	public function defaultAccessLevel() {
46		return Auth::PRIV_PRIVATE;
47	}
48
49	/**
50	 * Return a menu item for this report.
51	 *
52	 * @return Menu
53	 */
54	public function getReportMenu() {
55		global $WT_TREE;
56
57		return new Menu(
58			$this->getTitle(),
59			'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&amp;action=setup&amp;report=' . WT_MODULES_DIR . $this->getName() . '/report.xml',
60			'menu-report-' . $this->getName(),
61			array('rel' => 'nofollow')
62		);
63	}
64}
65