xref: /webtrees/app/Module/PoweredByWebtreesModule.php (revision a992e8c1f5cff3fba48e8b69ec698e4e21142dc8)
133c34396SGreg Roach<?php
23976b470SGreg Roach
333c34396SGreg Roach/**
433c34396SGreg Roach * webtrees: online genealogy
533c34396SGreg Roach * Copyright (C) 2019 webtrees development team
633c34396SGreg Roach * This program is free software: you can redistribute it and/or modify
733c34396SGreg Roach * it under the terms of the GNU General Public License as published by
833c34396SGreg Roach * the Free Software Foundation, either version 3 of the License, or
933c34396SGreg Roach * (at your option) any later version.
1033c34396SGreg Roach * This program is distributed in the hope that it will be useful,
1133c34396SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
1233c34396SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1333c34396SGreg Roach * GNU General Public License for more details.
1433c34396SGreg Roach * You should have received a copy of the GNU General Public License
1533c34396SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>.
1633c34396SGreg Roach */
1733c34396SGreg Roachdeclare(strict_types=1);
1833c34396SGreg Roach
1933c34396SGreg Roachnamespace Fisharebest\Webtrees\Module;
2033c34396SGreg Roach
2133c34396SGreg Roachuse Fisharebest\Webtrees\I18N;
2233c34396SGreg Roachuse Fisharebest\Webtrees\Webtrees;
23*a992e8c1SGreg Roachuse Psr\Http\Message\ServerRequestInterface;
2433c34396SGreg Roach
2533c34396SGreg Roach/**
2633c34396SGreg Roach * Class PoweredByWebtreesModule - provide a link to the project home page.
2733c34396SGreg Roach */
2833c34396SGreg Roachclass PoweredByWebtreesModule extends AbstractModule implements ModuleFooterInterface
2933c34396SGreg Roach{
3033c34396SGreg Roach    use ModuleFooterTrait;
3133c34396SGreg Roach
3233c34396SGreg Roach    /**
3333c34396SGreg Roach     * How should this module be labelled on tabs, footers, etc.?
3433c34396SGreg Roach     *
3533c34396SGreg Roach     * @return string
3633c34396SGreg Roach     */
3733c34396SGreg Roach    public function title(): string
3833c34396SGreg Roach    {
3933c34396SGreg Roach        /* I18N: Name of a module */
4033c34396SGreg Roach        return I18N::translate('Powered by webtrees™');
4133c34396SGreg Roach    }
4233c34396SGreg Roach
4333c34396SGreg Roach    /**
4433c34396SGreg Roach     * A sentence describing what this module does.
4533c34396SGreg Roach     *
4633c34396SGreg Roach     * @return string
4733c34396SGreg Roach     */
4833c34396SGreg Roach    public function description(): string
4933c34396SGreg Roach    {
5033c34396SGreg Roach        /* I18N: Description of the “webtrees” module */
5133c34396SGreg Roach        return I18N::translate('A link to the webtrees home page.');
5233c34396SGreg Roach    }
5333c34396SGreg Roach
5433c34396SGreg Roach    /**
5533c34396SGreg Roach     * The default position for this footer.  It can be changed in the control panel.
5633c34396SGreg Roach     *
5733c34396SGreg Roach     * @return int
5833c34396SGreg Roach     */
5933c34396SGreg Roach    public function defaultFooterOrder(): int
6033c34396SGreg Roach    {
6133c34396SGreg Roach        return 1;
6233c34396SGreg Roach    }
6333c34396SGreg Roach
6433c34396SGreg Roach    /**
6533c34396SGreg Roach     * A footer, to be added at the bottom of every page.
6633c34396SGreg Roach     *
67*a992e8c1SGreg Roach     * @param ServerRequestInterface $request
680c8c69d4SGreg Roach     *
6933c34396SGreg Roach     * @return string
7033c34396SGreg Roach     */
71*a992e8c1SGreg Roach    public function getFooter(ServerRequestInterface $request): string
7233c34396SGreg Roach    {
7333c34396SGreg Roach        return view('modules/powered-by-webtrees/footer', [
7433c34396SGreg Roach            'name' => Webtrees::NAME,
7533c34396SGreg Roach            'url'  => Webtrees::URL,
7633c34396SGreg Roach        ]);
7733c34396SGreg Roach    }
7833c34396SGreg Roach}
79