xref: /webtrees/app/Module/FactSourcesReportModule.php (revision 26684e686fb5ab50ecb57e7e6c6a0a55852d2203)
18c2e8227SGreg Roach<?php
28c2e8227SGreg Roach/**
38c2e8227SGreg Roach * webtrees: online genealogy
48fcd0d32SGreg 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;
248c2e8227SGreg Roach
258c2e8227SGreg Roach/**
268c2e8227SGreg Roach * Class FactSourcesReportModule
278c2e8227SGreg Roach */
2849a243cbSGreg Roachclass FactSourcesReportModule extends AbstractModule implements ModuleInterface, ModuleReportInterface
29c1010edaSGreg Roach{
3049a243cbSGreg Roach    use ModuleReportTrait;
3149a243cbSGreg Roach
3249a243cbSGreg Roach    /** @var int The default access level for this module.  It can be changed in the control panel. */
3349a243cbSGreg Roach    protected $access_level = Auth::PRIV_USER;
3449a243cbSGreg Roach
35961ec755SGreg Roach    /**
36961ec755SGreg Roach     * How should this module be labelled on tabs, menus, etc.?
37961ec755SGreg Roach     *
38961ec755SGreg Roach     * @return string
39961ec755SGreg Roach     */
4049a243cbSGreg Roach    public function title(): string
41c1010edaSGreg Roach    {
428c2e8227SGreg Roach        // This text also appears in the .XML file - update both together
43bbb76c12SGreg Roach        /* I18N: Name of a module/report */
44bbb76c12SGreg Roach        return I18N::translate('Source');
458c2e8227SGreg Roach    }
468c2e8227SGreg Roach
47961ec755SGreg Roach    /**
48961ec755SGreg Roach     * A sentence describing what this module does.
49961ec755SGreg Roach     *
50961ec755SGreg Roach     * @return string
51961ec755SGreg Roach     */
5249a243cbSGreg Roach    public function description(): string
53c1010edaSGreg Roach    {
548c2e8227SGreg Roach        // This text also appears in the .XML file - update both together
55bbb76c12SGreg Roach        /* I18N: Description of the “Source” module */
56bbb76c12SGreg Roach        return I18N::translate('A report of the information provided by a source.');
578c2e8227SGreg Roach    }
588c2e8227SGreg Roach
590ee13198SGreg Roach    /**
600ee13198SGreg Roach     * Return a menu item for this report.
610ee13198SGreg Roach     *
622c2c92e6SGreg Roach     * @param Individual $individual
63dc809433SGreg Roach     *
640ee13198SGreg Roach     * @return Menu
650ee13198SGreg Roach     */
662c2c92e6SGreg Roach    public function getReportMenu(Individual $individual): Menu
67c1010edaSGreg Roach    {
680ee13198SGreg Roach        return new Menu(
6949a243cbSGreg Roach            $this->title(),
702c2c92e6SGreg Roach            route('report-setup', [
712c2c92e6SGreg Roach                'ged'    => $individual->tree()->name(),
72*26684e68SGreg Roach                'report' => $this->name(),
73c1010edaSGreg Roach            ]),
74*26684e68SGreg Roach            'menu-report-' . $this->name(),
7513abd6f3SGreg Roach            ['rel' => 'nofollow']
768c2e8227SGreg Roach        );
778c2e8227SGreg Roach    }
788c2e8227SGreg Roach}
79