xref: /webtrees/app/Module/AhnentafelReportModule.php (revision dc809433c88836dc8210543ebbe3c78e35d80084)
18c2e8227SGreg Roach<?php
28c2e8227SGreg Roach/**
38c2e8227SGreg Roach * webtrees: online genealogy
41062a142SGreg Roach * Copyright (C) 2018 webtrees development team
58c2e8227SGreg Roach * This program is free software: you can redistribute it and/or modify
68c2e8227SGreg Roach * it under the terms of the GNU General Public License as published by
78c2e8227SGreg Roach * the Free Software Foundation, either version 3 of the License, or
88c2e8227SGreg Roach * (at your option) any later version.
98c2e8227SGreg Roach * This program is distributed in the hope that it will be useful,
108c2e8227SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
118c2e8227SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
128c2e8227SGreg Roach * GNU General Public License for more details.
138c2e8227SGreg Roach * You should have received a copy of the GNU General Public License
148c2e8227SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>.
158c2e8227SGreg Roach */
1676692c8bSGreg Roachnamespace Fisharebest\Webtrees\Module;
1776692c8bSGreg Roach
180e62c4b8SGreg Roachuse Fisharebest\Webtrees\Auth;
190e62c4b8SGreg Roachuse Fisharebest\Webtrees\I18N;
200e62c4b8SGreg Roachuse Fisharebest\Webtrees\Menu;
21*dc809433SGreg Roachuse Fisharebest\Webtrees\Tree;
228c2e8227SGreg Roach
238c2e8227SGreg Roach/**
248c2e8227SGreg Roach * Class AhnentafelReportModule
258c2e8227SGreg Roach */
26e2a378d3SGreg Roachclass AhnentafelReportModule extends AbstractModule implements ModuleReportInterface {
2776692c8bSGreg Roach	/**
2876692c8bSGreg Roach	 * How should this module be labelled on tabs, menus, etc.?
2976692c8bSGreg Roach	 *
3076692c8bSGreg Roach	 * @return string
3176692c8bSGreg Roach	 */
328c2e8227SGreg Roach	public function getTitle() {
338c2e8227SGreg Roach		// This text also appears in the .XML file - update both together
348c2e8227SGreg Roach		return /* I18N: Name of a module/report */ I18N::translate('Ancestors');
358c2e8227SGreg Roach	}
368c2e8227SGreg Roach
3776692c8bSGreg Roach	/**
3876692c8bSGreg Roach	 * A sentence describing what this module does.
3976692c8bSGreg Roach	 *
4076692c8bSGreg Roach	 * @return string
4176692c8bSGreg Roach	 */
428c2e8227SGreg Roach	public function getDescription() {
438c2e8227SGreg Roach		// This text also appears in the .XML file - update both together
448c2e8227SGreg Roach		return /* I18N: Description of the “Ancestors” module */ I18N::translate('A report of an individual’s ancestors, in a narrative style.');
458c2e8227SGreg Roach	}
468c2e8227SGreg Roach
4776692c8bSGreg Roach	/**
4876692c8bSGreg Roach	 * What is the default access level for this module?
4976692c8bSGreg Roach	 *
5076692c8bSGreg Roach	 * Some modules are aimed at admins or managers, and are not generally shown to users.
5176692c8bSGreg Roach	 *
5276692c8bSGreg Roach	 * @return int
5376692c8bSGreg Roach	 */
548c2e8227SGreg Roach	public function defaultAccessLevel() {
554b9ff166SGreg Roach		return Auth::PRIV_PRIVATE;
568c2e8227SGreg Roach	}
578c2e8227SGreg Roach
5876692c8bSGreg Roach	/**
590ee13198SGreg Roach	 * Return a menu item for this report.
6076692c8bSGreg Roach	 *
61*dc809433SGreg Roach	 * @param Tree $tree
62*dc809433SGreg Roach	 *
630ee13198SGreg Roach	 * @return Menu
6476692c8bSGreg Roach	 */
65*dc809433SGreg Roach	public function getReportMenu(Tree $tree): Menu {
660ee13198SGreg Roach		return new Menu(
678c2e8227SGreg Roach			$this->getTitle(),
68*dc809433SGreg Roach			e(route('report-setup', ['ged' => $tree->getName(), 'report' => $this->getName()])),
690ee13198SGreg Roach			'menu-report-' . $this->getName(),
7013abd6f3SGreg Roach			['rel' => 'nofollow']
718c2e8227SGreg Roach		);
728c2e8227SGreg Roach	}
738c2e8227SGreg Roach}
74