xref: /webtrees/app/Module/ModuleConfigTrait.php (revision d11be7027e34e3121be11cc025421873364403f9)
149a243cbSGreg Roach<?php
23976b470SGreg Roach
349a243cbSGreg Roach/**
449a243cbSGreg Roach * webtrees: online genealogy
5*d11be702SGreg Roach * Copyright (C) 2023 webtrees development team
649a243cbSGreg Roach * This program is free software: you can redistribute it and/or modify
749a243cbSGreg Roach * it under the terms of the GNU General Public License as published by
849a243cbSGreg Roach * the Free Software Foundation, either version 3 of the License, or
949a243cbSGreg Roach * (at your option) any later version.
1049a243cbSGreg Roach * This program is distributed in the hope that it will be useful,
1149a243cbSGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
1249a243cbSGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1349a243cbSGreg Roach * GNU General Public License for more details.
1449a243cbSGreg Roach * You should have received a copy of the GNU General Public License
1589f7189bSGreg Roach * along with this program. If not, see <https://www.gnu.org/licenses/>.
1649a243cbSGreg Roach */
17fcfa147eSGreg Roach
1849a243cbSGreg Roachdeclare(strict_types=1);
1949a243cbSGreg Roach
2049a243cbSGreg Roachnamespace Fisharebest\Webtrees\Module;
2149a243cbSGreg Roach
2249a243cbSGreg Roach/**
2349a243cbSGreg Roach * Trait ModuleConfigTrait - default implementation of ModuleConfigInterface
2449a243cbSGreg Roach */
2549a243cbSGreg Roachtrait ModuleConfigTrait
2649a243cbSGreg Roach{
2749a243cbSGreg Roach    /**
28bfed30e4SGreg Roach     * A unique internal name for this module (based on the installation folder).
29bfed30e4SGreg Roach     *
30bfed30e4SGreg Roach     * @return string
31bfed30e4SGreg Roach     */
32bfed30e4SGreg Roach    abstract public function name(): string;
33bfed30e4SGreg Roach
34bfed30e4SGreg Roach    /**
3549a243cbSGreg Roach     * The URL to a page where the user can modify the configuration of this module.
3649a243cbSGreg Roach     *
3749a243cbSGreg Roach     * @return string
3849a243cbSGreg Roach     */
3949a243cbSGreg Roach    public function getConfigLink(): string
4049a243cbSGreg Roach    {
4149a243cbSGreg Roach        return route('module', [
4226684e68SGreg Roach            'module' => $this->name(),
4349a243cbSGreg Roach            'action' => 'Admin',
4449a243cbSGreg Roach        ]);
4549a243cbSGreg Roach    }
4649a243cbSGreg Roach}
47