]> git.mxchange.org Git - friendica.git/blob - view/theme/vier/config.php
Merge remote-tracking branch 'upstream/develop' into 1409-shadow-items
[friendica.git] / view / theme / vier / config.php
1 <?php
2 /**
3  * Theme settings
4  */
5
6
7
8 function theme_content(&$a){
9         if(!local_user())
10                 return;
11
12         $style = get_pconfig(local_user(), 'vier', 'style');
13
14         if ($style == "")
15                 $style = get_config('vier', 'style');
16
17         return vier_form($a,$style);
18 }
19
20 function theme_post(&$a){
21         if(! local_user())
22                 return;
23
24         if (isset($_POST['vier-settings-submit'])){
25                 set_pconfig(local_user(), 'vier', 'style', $_POST['vier_style']);
26         }
27 }
28
29
30 function theme_admin(&$a){
31         $style = get_config('vier', 'style');
32         return vier_form($a,$style);
33 }
34
35 function theme_admin_post(&$a){
36         if (isset($_POST['vier-settings-submit'])){
37                 set_config('vier', 'style', $_POST['vier_style']);
38         }
39 }
40
41
42 function vier_form(&$a, $style){
43         $styles = array(
44                 "shadow"=>"Shadow",
45                 "flat"=>"Flat",
46                 "netcolour"=>"Coloured Networks",
47                 "breathe"=>"Breathe",
48                 "plus"=>"Plus"
49         );
50         $t = get_markup_template("theme_settings.tpl" );
51         $o .= replace_macros($t, array(
52                 '$submit' => t('Submit'),
53                 '$baseurl' => $a->get_baseurl(),
54                 '$title' => t("Theme settings"),
55                 '$style' => array('vier_style',t ('Set style'),$style,'',$styles),
56         ));
57         return $o;
58 }