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