7 use Friendica\Core\Config;
8 use Friendica\Core\L10n;
9 use Friendica\Core\PConfig;
10 use Friendica\Core\System;
12 function theme_content(App $a) {
17 $align = PConfig::get(local_user(), 'quattro', 'align' );
18 $color = PConfig::get(local_user(), 'quattro', 'color' );
19 $tfs = PConfig::get(local_user(),"quattro","tfs");
20 $pfs = PConfig::get(local_user(),"quattro","pfs");
22 return quattro_form($a,$align, $color, $tfs, $pfs);
25 function theme_post(App $a) {
30 if (isset($_POST['quattro-settings-submit'])){
31 PConfig::set(local_user(), 'quattro', 'align', $_POST['quattro_align']);
32 PConfig::set(local_user(), 'quattro', 'color', $_POST['quattro_color']);
33 PConfig::set(local_user(), 'quattro', 'tfs', $_POST['quattro_tfs']);
34 PConfig::set(local_user(), 'quattro', 'pfs', $_POST['quattro_pfs']);
38 function theme_admin(App $a) {
39 $align = Config::get('quattro', 'align' );
40 $color = Config::get('quattro', 'color' );
41 $tfs = Config::get("quattro","tfs");
42 $pfs = Config::get("quattro","pfs");
44 return quattro_form($a,$align, $color, $tfs, $pfs);
47 function theme_admin_post(App $a) {
48 if (isset($_POST['quattro-settings-submit'])){
49 Config::set('quattro', 'align', $_POST['quattro_align']);
50 Config::set('quattro', 'color', $_POST['quattro_color']);
51 Config::set('quattro', 'tfs', $_POST['quattro_tfs']);
52 Config::set('quattro', 'pfs', $_POST['quattro_pfs']);
56 /// @TODO $a is no longer used here
57 function quattro_form(App $a, $align, $color, $tfs, $pfs) {
71 $t = get_markup_template("theme_settings.tpl" );
72 $o = replace_macros($t, [
73 '$submit' => L10n::t('Submit'),
74 '$baseurl' => System::baseUrl(),
75 '$title' => L10n::t("Theme settings"),
76 '$align' => ['quattro_align', L10n::t('Alignment'), $align, '', ['left' => L10n::t('Left'), 'center' => L10n::t('Center')]],
77 '$color' => ['quattro_color', L10n::t('Color scheme'), $color, '', $colors],
78 '$pfs' => ['quattro_pfs', L10n::t('Posts font size'), $pfs],
79 '$tfs' => ['quattro_tfs', L10n::t('Textareas font size'), $tfs],