7 use Friendica\Core\Config;
8 use Friendica\Core\L10n;
9 use Friendica\Core\Renderer;
12 function theme_content(App $a)
18 $colorset = DI::pConfig()->get(local_user(), 'duepuntozero', 'colorset');
21 return clean_form($a, $colorset, $user);
24 function theme_post(App $a)
30 if (isset($_POST['duepuntozero-settings-submit'])) {
31 DI::pConfig()->set(local_user(), 'duepuntozero', 'colorset', $_POST['duepuntozero_colorset']);
35 function theme_admin(App $a)
37 $colorset = Config::get('duepuntozero', 'colorset');
40 return clean_form($a, $colorset, $user);
43 function theme_admin_post(App $a)
45 if (isset($_POST['duepuntozero-settings-submit'])) {
46 Config::set('duepuntozero', 'colorset', $_POST['duepuntozero_colorset']);
50 /// @TODO $a is no longer used
51 function clean_form(App $a, &$colorset, $user)
54 'default' => DI::l10n()->t('default'),
55 'greenzero' => DI::l10n()->t('greenzero'),
56 'purplezero' => DI::l10n()->t('purplezero'),
57 'easterbunny' => DI::l10n()->t('easterbunny'),
58 'darkzero' => DI::l10n()->t('darkzero'),
59 'comix' => DI::l10n()->t('comix'),
60 'slackr' => DI::l10n()->t('slackr'),
64 $color = DI::pConfig()->get(local_user(), 'duepuntozero', 'colorset');
66 $color = Config::get('duepuntozero', 'colorset');
69 $t = Renderer::getMarkupTemplate("theme_settings.tpl");
70 $o = Renderer::replaceMacros($t, [
71 '$submit' => DI::l10n()->t('Submit'),
72 '$title' => DI::l10n()->t("Theme settings"),
73 '$colorset' => ['duepuntozero_colorset', DI::l10n()->t('Variations'), $color, '', $colorset],