xref: /webtrees/app/Module/PoweredByWebtreesModule.php (revision 33c343964203a24deeb34413eac7f48bee172865)
1*33c34396SGreg Roach<?php
2*33c34396SGreg Roach/**
3*33c34396SGreg Roach * webtrees: online genealogy
4*33c34396SGreg Roach * Copyright (C) 2019 webtrees development team
5*33c34396SGreg Roach * This program is free software: you can redistribute it and/or modify
6*33c34396SGreg Roach * it under the terms of the GNU General Public License as published by
7*33c34396SGreg Roach * the Free Software Foundation, either version 3 of the License, or
8*33c34396SGreg Roach * (at your option) any later version.
9*33c34396SGreg Roach * This program is distributed in the hope that it will be useful,
10*33c34396SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
11*33c34396SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12*33c34396SGreg Roach * GNU General Public License for more details.
13*33c34396SGreg Roach * You should have received a copy of the GNU General Public License
14*33c34396SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>.
15*33c34396SGreg Roach */
16*33c34396SGreg Roachdeclare(strict_types=1);
17*33c34396SGreg Roach
18*33c34396SGreg Roachnamespace Fisharebest\Webtrees\Module;
19*33c34396SGreg Roach
20*33c34396SGreg Roachuse Fisharebest\Webtrees\I18N;
21*33c34396SGreg Roachuse Fisharebest\Webtrees\Footer;
22*33c34396SGreg Roachuse Fisharebest\Webtrees\Tree;
23*33c34396SGreg Roachuse Fisharebest\Webtrees\User;
24*33c34396SGreg Roachuse Fisharebest\Webtrees\Webtrees;
25*33c34396SGreg Roachuse Symfony\Component\HttpFoundation\Request;
26*33c34396SGreg Roach
27*33c34396SGreg Roach/**
28*33c34396SGreg Roach * Class PoweredByWebtreesModule - provide a link to the project home page.
29*33c34396SGreg Roach */
30*33c34396SGreg Roachclass PoweredByWebtreesModule extends AbstractModule implements ModuleFooterInterface
31*33c34396SGreg Roach{
32*33c34396SGreg Roach    use ModuleFooterTrait;
33*33c34396SGreg Roach
34*33c34396SGreg Roach    /**
35*33c34396SGreg Roach     * How should this module be labelled on tabs, footers, etc.?
36*33c34396SGreg Roach     *
37*33c34396SGreg Roach     * @return string
38*33c34396SGreg Roach     */
39*33c34396SGreg Roach    public function title(): string
40*33c34396SGreg Roach    {
41*33c34396SGreg Roach        /* I18N: Name of a module */
42*33c34396SGreg Roach        return I18N::translate('Powered by webtrees™');
43*33c34396SGreg Roach    }
44*33c34396SGreg Roach
45*33c34396SGreg Roach    /**
46*33c34396SGreg Roach     * A sentence describing what this module does.
47*33c34396SGreg Roach     *
48*33c34396SGreg Roach     * @return string
49*33c34396SGreg Roach     */
50*33c34396SGreg Roach    public function description(): string
51*33c34396SGreg Roach    {
52*33c34396SGreg Roach        /* I18N: Description of the “webtrees” module */
53*33c34396SGreg Roach        return I18N::translate('A link to the webtrees home page.');
54*33c34396SGreg Roach    }
55*33c34396SGreg Roach
56*33c34396SGreg Roach    /**
57*33c34396SGreg Roach     * The default position for this footer.  It can be changed in the control panel.
58*33c34396SGreg Roach     *
59*33c34396SGreg Roach     * @return int
60*33c34396SGreg Roach     */
61*33c34396SGreg Roach    public function defaultFooterOrder(): int
62*33c34396SGreg Roach    {
63*33c34396SGreg Roach        return 1;
64*33c34396SGreg Roach    }
65*33c34396SGreg Roach
66*33c34396SGreg Roach    /**
67*33c34396SGreg Roach     * A footer, to be added at the bottom of every page.
68*33c34396SGreg Roach     *
69*33c34396SGreg Roach     * @return string
70*33c34396SGreg Roach     */
71*33c34396SGreg Roach    public function getFooter(): string
72*33c34396SGreg Roach    {
73*33c34396SGreg Roach        return view('modules/powered-by-webtrees/footer', [
74*33c34396SGreg Roach            'name' => Webtrees::NAME,
75*33c34396SGreg Roach            'url' => Webtrees::URL,
76*33c34396SGreg Roach        ]);
77*33c34396SGreg Roach    }
78*33c34396SGreg Roach}
79