3 * @copyright Copyright (C) 2020, Friendica
5 * @license GNU AGPL version 3 or any later version
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Affero General Public License as
9 * published by the Free Software Foundation, either version 3 of the
10 * License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Affero General Public License for more details.
17 * You should have received a copy of the GNU Affero General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22 namespace Friendica\Module;
24 use Friendica\BaseModule;
25 use Friendica\Content\Feature;
26 use Friendica\Core\Renderer;
29 class BaseSettings extends BaseModule
31 public static function content(array $parameters = [])
35 $tpl = Renderer::getMarkupTemplate('settings/head.tpl');
36 DI::page()['htmlhead'] .= Renderer::replaceMacros($tpl, [
37 '$ispublic' => DI::l10n()->t('everybody')
43 'label' => DI::l10n()->t('Account'),
45 'selected' => (($a->argc == 1) && ($a->argv[0] === 'settings') ? 'active' : ''),
50 'label' => DI::l10n()->t('Two-factor authentication'),
51 'url' => 'settings/2fa',
52 'selected' => (($a->argc > 1) && ($a->argv[1] === '2fa') ? 'active' : ''),
57 'label' => DI::l10n()->t('Profile'),
58 'url' => 'settings/profile',
59 'selected' => (($a->argc > 1) && ($a->argv[1] === 'profile') ? 'active' : ''),
65 'label' => DI::l10n()->t('Additional features'),
66 'url' => 'settings/features',
67 'selected' => (($a->argc > 1) && ($a->argv[1] === 'features') ? 'active' : ''),
73 'label' => DI::l10n()->t('Display'),
74 'url' => 'settings/display',
75 'selected' => (($a->argc > 1) && ($a->argv[1] === 'display') ? 'active' : ''),
80 'label' => DI::l10n()->t('Social Networks'),
81 'url' => 'settings/connectors',
82 'selected' => (($a->argc > 1) && ($a->argv[1] === 'connectors') ? 'active' : ''),
87 'label' => DI::l10n()->t('Addons'),
88 'url' => 'settings/addon',
89 'selected' => (($a->argc > 1) && ($a->argv[1] === 'addon') ? 'active' : ''),
94 'label' => DI::l10n()->t('Manage Accounts'),
95 'url' => 'settings/delegation',
96 'selected' => (($a->argc > 1) && ($a->argv[1] === 'delegation') ? 'active' : ''),
101 'label' => DI::l10n()->t('Connected apps'),
102 'url' => 'settings/oauth',
103 'selected' => (($a->argc > 1) && ($a->argv[1] === 'oauth') ? 'active' : ''),
108 'label' => DI::l10n()->t('Export personal data'),
109 'url' => 'settings/userexport',
110 'selected' => (($a->argc > 1) && ($a->argv[1] === 'userexport') ? 'active' : ''),
115 'label' => DI::l10n()->t('Remove account'),
117 'selected' => (($a->argc == 1) && ($a->argv[0] === 'removeme') ? 'active' : ''),
122 $tabtpl = Renderer::getMarkupTemplate("generic_links_widget.tpl");
123 DI::page()['aside'] = Renderer::replaceMacros($tabtpl, [
124 '$title' => DI::l10n()->t('Settings'),
125 '$class' => 'settings-widget',