xref: /webtrees/app/Module/RelatedIndividualsReportModule.php (revision e7f56f2af615447ab1a7646851f88b465ace9e04)
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 */
16*e7f56f2aSGreg Roachdeclare(strict_types=1);
17*e7f56f2aSGreg Roach
1876692c8bSGreg Roachnamespace Fisharebest\Webtrees\Module;
1976692c8bSGreg Roach
200e62c4b8SGreg Roachuse Fisharebest\Webtrees\Auth;
210e62c4b8SGreg Roachuse Fisharebest\Webtrees\I18N;
220e62c4b8SGreg Roachuse Fisharebest\Webtrees\Menu;
23dc809433SGreg Roachuse Fisharebest\Webtrees\Tree;
248c2e8227SGreg Roach
258c2e8227SGreg Roach/**
268c2e8227SGreg Roach * Class RelatedIndividualsReportModule
278c2e8227SGreg Roach */
28c1010edaSGreg Roachclass RelatedIndividualsReportModule extends AbstractModule implements ModuleReportInterface
29c1010edaSGreg Roach{
308c2e8227SGreg Roach    /** {@inheritdoc} */
318f53f488SRico Sonntag    public function getTitle(): string
32c1010edaSGreg Roach    {
338c2e8227SGreg Roach        // This text also appears in the .XML file - update both together
34bbb76c12SGreg Roach        /* I18N: Name of a report */
35bbb76c12SGreg Roach        return I18N::translate('Related individuals');
368c2e8227SGreg Roach    }
378c2e8227SGreg Roach
388c2e8227SGreg Roach    /** {@inheritdoc} */
398f53f488SRico Sonntag    public function getDescription(): string
40c1010edaSGreg Roach    {
418c2e8227SGreg Roach        // This text also appears in the .XML file - update both together
42bbb76c12SGreg Roach        /* I18N: Description of the “Related individuals” module */
43bbb76c12SGreg Roach        return I18N::translate('A report of the individuals that are closely related to an individual.');
448c2e8227SGreg Roach    }
458c2e8227SGreg Roach
460ee13198SGreg Roach    /**
470ee13198SGreg Roach     * What is the default access level for this module?
480ee13198SGreg Roach     *
490ee13198SGreg Roach     * Some modules are aimed at admins or managers, and are not generally shown to users.
500ee13198SGreg Roach     *
510ee13198SGreg Roach     * @return int
520ee13198SGreg Roach     */
538f53f488SRico Sonntag    public function defaultAccessLevel(): int
54c1010edaSGreg Roach    {
554b9ff166SGreg Roach        return Auth::PRIV_PRIVATE;
568c2e8227SGreg Roach    }
578c2e8227SGreg Roach
580ee13198SGreg Roach    /**
590ee13198SGreg Roach     * Return a menu item for this report.
600ee13198SGreg Roach     *
61dc809433SGreg Roach     * @param Tree $tree
62dc809433SGreg Roach     *
630ee13198SGreg Roach     * @return Menu
640ee13198SGreg Roach     */
65c1010edaSGreg Roach    public function getReportMenu(Tree $tree): Menu
66c1010edaSGreg Roach    {
670ee13198SGreg Roach        return new Menu(
688c2e8227SGreg Roach            $this->getTitle(),
69c1010edaSGreg Roach            route('report-setup', ['ged'    => $tree->getName(),
70c1010edaSGreg Roach                                   'report' => $this->getName(),
71c1010edaSGreg Roach            ]),
720ee13198SGreg Roach            'menu-report-' . $this->getName(),
7313abd6f3SGreg Roach            ['rel' => 'nofollow']
748c2e8227SGreg Roach        );
758c2e8227SGreg Roach    }
768c2e8227SGreg Roach}
77