xref: /webtrees/app/Module/RelatedIndividualsReportModule.php (revision c1010eda29c0909ed4d5d463f32d32bfefdd4dfe)
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;
21dc809433SGreg Roachuse Fisharebest\Webtrees\Tree;
228c2e8227SGreg Roach
238c2e8227SGreg Roach/**
248c2e8227SGreg Roach * Class RelatedIndividualsReportModule
258c2e8227SGreg Roach */
26*c1010edaSGreg Roachclass RelatedIndividualsReportModule extends AbstractModule implements ModuleReportInterface
27*c1010edaSGreg Roach{
288c2e8227SGreg Roach    /** {@inheritdoc} */
29*c1010edaSGreg Roach    public function getTitle()
30*c1010edaSGreg Roach    {
318c2e8227SGreg Roach        // This text also appears in the .XML file - update both together
32*c1010edaSGreg Roach        return /* I18N: Name of a report */
33*c1010edaSGreg Roach            I18N::translate('Related individuals');
348c2e8227SGreg Roach    }
358c2e8227SGreg Roach
368c2e8227SGreg Roach    /** {@inheritdoc} */
37*c1010edaSGreg Roach    public function getDescription()
38*c1010edaSGreg Roach    {
398c2e8227SGreg Roach        // This text also appears in the .XML file - update both together
40*c1010edaSGreg Roach        return /* I18N: Description of the “Related individuals” module */
41*c1010edaSGreg Roach            I18N::translate('A report of the individuals that are closely related to an individual.');
428c2e8227SGreg Roach    }
438c2e8227SGreg Roach
440ee13198SGreg Roach    /**
450ee13198SGreg Roach     * What is the default access level for this module?
460ee13198SGreg Roach     *
470ee13198SGreg Roach     * Some modules are aimed at admins or managers, and are not generally shown to users.
480ee13198SGreg Roach     *
490ee13198SGreg Roach     * @return int
500ee13198SGreg Roach     */
51*c1010edaSGreg Roach    public function defaultAccessLevel()
52*c1010edaSGreg Roach    {
534b9ff166SGreg Roach        return Auth::PRIV_PRIVATE;
548c2e8227SGreg Roach    }
558c2e8227SGreg Roach
560ee13198SGreg Roach    /**
570ee13198SGreg Roach     * Return a menu item for this report.
580ee13198SGreg Roach     *
59dc809433SGreg Roach     * @param Tree $tree
60dc809433SGreg Roach     *
610ee13198SGreg Roach     * @return Menu
620ee13198SGreg Roach     */
63*c1010edaSGreg Roach    public function getReportMenu(Tree $tree): Menu
64*c1010edaSGreg Roach    {
650ee13198SGreg Roach        return new Menu(
668c2e8227SGreg Roach            $this->getTitle(),
67*c1010edaSGreg Roach            route('report-setup', ['ged'    => $tree->getName(),
68*c1010edaSGreg Roach                                   'report' => $this->getName(),
69*c1010edaSGreg Roach            ]),
700ee13198SGreg Roach            'menu-report-' . $this->getName(),
7113abd6f3SGreg Roach            ['rel' => 'nofollow']
728c2e8227SGreg Roach        );
738c2e8227SGreg Roach    }
748c2e8227SGreg Roach}
75