]> git.mxchange.org Git - friendica.git/blob - view/theme/vier/config.php
Vier: Added config.php
[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         return vier_form($a,$style);
15 }
16
17 function theme_post(&$a){
18         if(! local_user())
19                 return;
20
21         if (isset($_POST['vier-settings-submit'])){
22                 set_pconfig(local_user(), 'vier', 'style', $_POST['vier_style']);
23         }
24 }
25
26
27 function theme_admin(&$a){
28         $style = get_config('vier', 'style');
29         return vier_form($a,$style);
30 }
31
32 function theme_admin_post(&$a){
33         if (isset($_POST['vier-settings-submit'])){
34                 set_config('vier', 'style', $_POST['vier_style']);
35         }
36 }
37
38
39 function vier_form(&$a, $style){
40         $styles = array(
41                 "shadow"=>"Shadow",
42                 "flat"=>"Flat"
43         );
44         $t = get_markup_template("theme_settings.tpl" );
45         $o .= replace_macros($t, array(
46                 '$submit' => t('Submit'),
47                 '$baseurl' => $a->get_baseurl(),
48                 '$title' => t("Theme settings"),
49                 '$style' => array('vier_style',t ('Set style'),$style,'',$styles),
50         ));
51         return $o;
52 }