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