xref: /webtrees/app/Module/PedigreeReportModule.php (revision 0e62c4b8d0ec6901bfaffd1dc763db37489518a4)
1<?php
2namespace Fisharebest\Webtrees\Module;
3
4/**
5 * webtrees: online genealogy
6 * Copyright (C) 2015 webtrees development team
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18use Fisharebest\Webtrees\Auth;
19use Fisharebest\Webtrees\I18N;
20use Fisharebest\Webtrees\Menu;
21
22/**
23 * Class PedigreeReportModule
24 */
25class PedigreeReportModule 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 report */ I18N::translate('Pedigree');
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 “Pedigree” module */ I18N::translate('A report of an individual’s ancestors, formatted as a tree.');
36	}
37
38	/** {@inheritdoc} */
39	public function defaultAccessLevel() {
40		return Auth::PRIV_PRIVATE;
41	}
42
43	/** {@inheritdoc} */
44	public function getReportMenus() {
45		global $controller, $WT_TREE;
46
47		$menus = array();
48		$menu  = new Menu(
49			$this->getTitle(),
50			'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&amp;action=setup&amp;report=' . WT_MODULES_DIR . $this->getName() . '/report.xml&amp;pid=' . $controller->getSignificantIndividual()->getXref(),
51			'menu-report-' . $this->getName()
52		);
53		$menus[] = $menu;
54
55		return $menus;
56
57	}
58}
59