xref: /webtrees/app/Module/ModuleConfigTrait.php (revision fcfa147e10aaa6c7ff580c29bd6e5b88666befc1)
149a243cbSGreg Roach<?php
23976b470SGreg Roach
349a243cbSGreg Roach/**
449a243cbSGreg Roach * webtrees: online genealogy
549a243cbSGreg Roach * Copyright (C) 2019 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
1549a243cbSGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>.
1649a243cbSGreg Roach */
17*fcfa147eSGreg 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    /**
28e284d69fSGreg Roach     * @return string
29e284d69fSGreg Roach     */
30e284d69fSGreg Roach    abstract public function name(): string;
31e284d69fSGreg Roach
32e284d69fSGreg Roach    /**
3349a243cbSGreg Roach     * The URL to a page where the user can modify the configuration of this module.
3449a243cbSGreg Roach     *
3549a243cbSGreg Roach     * @return string
3649a243cbSGreg Roach     */
3749a243cbSGreg Roach    public function getConfigLink(): string
3849a243cbSGreg Roach    {
3949a243cbSGreg Roach        return route('module', [
4026684e68SGreg Roach            'module' => $this->name(),
4149a243cbSGreg Roach            'action' => 'Admin',
4249a243cbSGreg Roach        ]);
4349a243cbSGreg Roach    }
4449a243cbSGreg Roach}
45