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)
18 if (!function_exists('get_vier_config')) {
22 $style = PConfig::get(local_user(), 'vier', 'style');
25 $style = Config::get('vier', 'style');
32 $show_pages = get_vier_config('show_pages', true);
33 $show_profiles = get_vier_config('show_profiles', true);
34 $show_helpers = get_vier_config('show_helpers', true);
35 $show_services = get_vier_config('show_services', true);
36 $show_friends = get_vier_config('show_friends', true);
37 $show_lastusers = get_vier_config('show_lastusers', true);
39 return vier_form($a,$style, $show_pages, $show_profiles, $show_helpers,
40 $show_services, $show_friends, $show_lastusers);
43 function theme_post(App $a)
49 if (isset($_POST['vier-settings-submit'])) {
50 PConfig::set(local_user(), 'vier', 'style', $_POST['vier_style']);
51 PConfig::set(local_user(), 'vier', 'show_pages', $_POST['vier_show_pages']);
52 PConfig::set(local_user(), 'vier', 'show_profiles', $_POST['vier_show_profiles']);
53 PConfig::set(local_user(), 'vier', 'show_helpers', $_POST['vier_show_helpers']);
54 PConfig::set(local_user(), 'vier', 'show_services', $_POST['vier_show_services']);
55 PConfig::set(local_user(), 'vier', 'show_friends', $_POST['vier_show_friends']);
56 PConfig::set(local_user(), 'vier', 'show_lastusers', $_POST['vier_show_lastusers']);
61 function theme_admin(App $a) {
63 if (!function_exists('get_vier_config'))
66 $style = Config::get('vier', 'style');
68 $helperlist = Config::get('vier', 'helperlist');
70 if ($helperlist == "")
71 $helperlist = "https://forum.friendi.ca/profile/helpers";
73 $t = get_markup_template("theme_admin_settings.tpl");
74 $o .= replace_macros($t, [
75 '$helperlist' => ['vier_helperlist', L10n::t('Comma separated list of helper forums'), $helperlist, '', ''],
78 $show_pages = get_vier_config('show_pages', true, true);
79 $show_profiles = get_vier_config('show_profiles', true, true);
80 $show_helpers = get_vier_config('show_helpers', true, true);
81 $show_services = get_vier_config('show_services', true, true);
82 $show_friends = get_vier_config('show_friends', true, true);
83 $show_lastusers = get_vier_config('show_lastusers', true, true);
84 $o .= vier_form($a,$style, $show_pages, $show_profiles, $show_helpers, $show_services,
85 $show_friends, $show_lastusers);
90 function theme_admin_post(App $a) {
91 if (isset($_POST['vier-settings-submit'])){
92 Config::set('vier', 'style', $_POST['vier_style']);
93 Config::set('vier', 'show_pages', $_POST['vier_show_pages']);
94 Config::set('vier', 'show_profiles', $_POST['vier_show_profiles']);
95 Config::set('vier', 'show_helpers', $_POST['vier_show_helpers']);
96 Config::set('vier', 'show_services', $_POST['vier_show_services']);
97 Config::set('vier', 'show_friends', $_POST['vier_show_friends']);
98 Config::set('vier', 'show_lastusers', $_POST['vier_show_lastusers']);
99 Config::set('vier', 'helperlist', $_POST['vier_helperlist']);
103 /// @TODO $a is no longer used
104 function vier_form(App $a, $style, $show_pages, $show_profiles, $show_helpers, $show_services, $show_friends, $show_lastusers) {
106 "breathe"=>"Breathe",
107 "netcolour"=>"Coloured Networks",
111 "plusminus"=>"Plus Minus",
115 $show_or_not = ['0' => L10n::t("don't show"), '1' => L10n::t("show"),];
117 $t = get_markup_template("theme_settings.tpl");
118 $o .= replace_macros($t, [
119 '$submit' => L10n::t('Submit'),
120 '$baseurl' => System::baseUrl(),
121 '$title' => L10n::t("Theme settings"),
122 '$style' => ['vier_style', L10n::t('Set style'), $style, '', $styles],
123 '$show_pages' => ['vier_show_pages', L10n::t('Community Pages'), $show_pages, '', $show_or_not],
124 '$show_profiles' => ['vier_show_profiles', L10n::t('Community Profiles'), $show_profiles, '', $show_or_not],
125 '$show_helpers' => ['vier_show_helpers', L10n::t('Help or @NewHere ?'), $show_helpers, '', $show_or_not],
126 '$show_services' => ['vier_show_services', L10n::t('Connect Services'), $show_services, '', $show_or_not],
127 '$show_friends' => ['vier_show_friends', L10n::t('Find Friends'), $show_friends, '', $show_or_not],
128 '$show_lastusers' => ['vier_show_lastusers', L10n::t('Last users'), $show_lastusers, '', $show_or_not]