xref: /webtrees/app/Module/FamilyGroupReportModule.php (revision 8fcd0d32e56ee262912bbdb593202cfd1cbc1615)
18c2e8227SGreg Roach<?php
28c2e8227SGreg Roach/**
38c2e8227SGreg Roach * webtrees: online genealogy
4*8fcd0d32SGreg Roach * Copyright (C) 2019 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 */
16e7f56f2aSGreg Roachdeclare(strict_types=1);
17e7f56f2aSGreg Roach
1876692c8bSGreg Roachnamespace Fisharebest\Webtrees\Module;
1976692c8bSGreg Roach
200e62c4b8SGreg Roachuse Fisharebest\Webtrees\Auth;
210e62c4b8SGreg Roachuse Fisharebest\Webtrees\I18N;
222c2c92e6SGreg Roachuse Fisharebest\Webtrees\Individual;
230e62c4b8SGreg Roachuse Fisharebest\Webtrees\Menu;
24dc809433SGreg Roachuse Fisharebest\Webtrees\Tree;
258c2e8227SGreg Roach
268c2e8227SGreg Roach/**
278c2e8227SGreg Roach * Class FamilyGroupReportModule
288c2e8227SGreg Roach */
29c1010edaSGreg Roachclass FamilyGroupReportModule extends AbstractModule implements ModuleReportInterface
30c1010edaSGreg Roach{
318c2e8227SGreg Roach    /** {@inheritdoc} */
328f53f488SRico Sonntag    public function getTitle(): string
33c1010edaSGreg Roach    {
348c2e8227SGreg Roach        // This text also appears in the .XML file - update both together
35bbb76c12SGreg Roach        /* I18N: Name of a module/report */
36bbb76c12SGreg Roach        return I18N::translate('Family');
378c2e8227SGreg Roach    }
388c2e8227SGreg Roach
398c2e8227SGreg Roach    /** {@inheritdoc} */
408f53f488SRico Sonntag    public function getDescription(): string
41c1010edaSGreg Roach    {
428c2e8227SGreg Roach        // This text also appears in the .XML file - update both together
43bbb76c12SGreg Roach        /* I18N: Description of the “Family” module */
44bbb76c12SGreg Roach        return I18N::translate('A report of family members and their details.');
458c2e8227SGreg Roach    }
468c2e8227SGreg Roach
470ee13198SGreg Roach    /**
480ee13198SGreg Roach     * What is the default access level for this module?
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     *
6182ea510dSGreg Roach     * @param Individual $individual
62dc809433SGreg Roach     *
630ee13198SGreg Roach     * @return Menu
640ee13198SGreg Roach     */
652c2c92e6SGreg Roach    public function getReportMenu(Individual $individual): Menu
66c1010edaSGreg Roach    {
670ee13198SGreg Roach        return new Menu(
688c2e8227SGreg Roach            $this->getTitle(),
692c2c92e6SGreg Roach            route('report-setup', [
702c2c92e6SGreg Roach                'ged'    => $individual->tree()->name(),
71c1010edaSGreg Roach                'report' => $this->getName(),
72c1010edaSGreg Roach            ]),
730ee13198SGreg Roach            'menu-report-' . $this->getName(),
7413abd6f3SGreg Roach            ['rel' => 'nofollow']
758c2e8227SGreg Roach        );
768c2e8227SGreg Roach    }
778c2e8227SGreg Roach}
78