]> git.mxchange.org Git - friendica.git/blob - view/theme/duepuntozero/config.php
updating config files for duepuntozero
[friendica.git] / view / theme / duepuntozero / 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     $colorset = get_pconfig( local_user(), 'duepuntozero', 'colorset');
13     $user = true;
14
15     return clean_form($a, $colorset, $user);
16 }
17
18 function theme_post(&$a){
19     if(! local_user())
20         return;
21     
22     if (isset($_POST['duepuntozero-settings-submit'])){
23         set_pconfig(local_user(), 'duepuntozero', 'colorset', $_POST['duepuntozero_colorset']);
24     }
25 }
26
27
28 function theme_admin(&$a){
29     $colorset = get_config( 'duepuntozero', 'colorset');
30     $user = false;
31
32     return clean_form($a, $colorset, $user);
33 }
34
35 function theme_admin_post(&$a){
36     if (isset($_POST['duepuntozero-settings-submit'])){
37         set_config('duepuntozero', 'colorset', $_POST['duepuntozero_colorset']);
38     }
39 }
40
41
42 function clean_form(&$a, &$colorset, $user){
43     $colorset = array(
44         'default'=>t('default'), 
45         'greenzero'=>t('greenzero'),
46         'purplezero'=>t('purplezero'),
47         'easterbunny'=>t('easterbunny'),
48         'darkzero'=>t('darkzero'),
49         'comix'=>t('comix'),
50         'slackr'=>t('slackr'),
51     );
52     if ($user) {
53         $color = get_pconfig(local_user(), 'duepuntozero', 'colorset');
54     } else {
55         $color = get_config( 'duepuntozero', 'colorset');
56     }
57     $t = get_markup_template("theme_settings.tpl" );
58     $o .= replace_macros($t, array(
59         '$submit' => t('Submit'),
60         '$baseurl' => $a->get_baseurl(),
61         '$title' => t("Theme settings"),
62         '$colorset' => array('duepuntozero_colorset', t('Variations'), $color, '', $colorset),
63     ));
64     return $o;
65 }