]> git.mxchange.org Git - friendica.git/blob - config.php
first files - move to Version 0.1
[friendica.git] / config.php
1 <?php
2 require_once('view/theme/frio/php/Image.php');
3
4 function theme_content(&$a) {
5         if(!local_user()) { return;}
6         $arr = array();
7
8         $arr["schema"]          = get_pconfig(local_user(),'frio', 'schema');
9         $arr["nav_bg"]          = get_pconfig(local_user(),'frio', 'nav_bg' );
10         $arr["nav_icon_color"]  = get_pconfig(local_user(),'frio', 'nav_icon_color' );
11         $arr["link_color"]      = get_pconfig(local_user(),'frio', 'link_color' );
12         $arr["bgcolor"]         = get_pconfig(local_user(),'frio', 'background_color' );
13         $arr["contentbg_transp"] = get_pconfig(local_user(),'frio', 'contentbg_transp' );
14         $arr["background_image"] = get_pconfig(local_user(),'frio', 'background_image' );
15         $arr["bg_image_option"] = get_pconfig(local_user(),'frio', 'bg_image_option' );
16
17         return frio_form($a, $arr);
18 }
19
20 function theme_post(&$a) {
21         if(!local_user()) { return;}
22         if (isset($_POST['frio-settings-submit'])) {
23                 set_pconfig(local_user(), 'frio', 'schema',             $_POST["frio_schema"]);
24                 set_pconfig(local_user(), 'frio', 'nav_bg',             $_POST["frio_nav_bg"]);
25                 set_pconfig(local_user(), 'frio', 'nav_icon_color',     $_POST["frio_nav_icon_color"]);
26                 set_pconfig(local_user(), 'frio', 'link_color',         $_POST["frio_link_color"]);
27                 set_pconfig(local_user(), 'frio', 'background_color',   $_POST["frio_background_color"]);
28                 set_pconfig(local_user(), 'frio', 'contentbg_transp',   $_POST["frio_contentbg_transp"]);
29                 set_pconfig(local_user(), 'frio', 'background_image',   $_POST["frio_background_image"]);
30                 set_pconfig(local_user(), 'frio', 'bg_image_option',    $_POST["frio_bg_image_option"]);
31         }
32 }
33
34 function frio_form(&$a, $arr) {
35         $scheme_choices = array();
36         $scheme_choices["---"] = t("Default");
37         $files = glob('view/theme/frio/schema/*.php');
38         if($files) {
39                 foreach($files as $file) {
40                         $f = basename($file, ".php");
41                         if($f != 'default') {
42                                 $scheme_name = $f;
43                                 $scheme_choices[$f] = $scheme_name;
44                         }
45                 }
46         }
47
48
49         $t = get_markup_template('theme_settings.tpl');
50         $o .= replace_macros($t, array(
51                 '$submit'               => t('Submit'),
52                 '$baseurl'              => $a->get_baseurl(),
53                 '$title'                => t("Theme settings"),
54                 '$schema'               => array('frio_schema',         t("Select scheme"),                     $arr["schema"], '', $scheme_choices),
55                 '$nav_bg'               => array('frio_nav_bg',         t('Navigation bar background color'),   $arr['nav_bg']),
56                 '$nav_icon_color'       => array('frio_nav_icon_color', t('Navigation bar icon color '),        $arr['nav_icon_color']),
57                 '$link_color'           => array('frio_link_color',     t('Link color'),                        $arr['link_color'],             '', $link_colors),
58                 '$bgcolor'              => array('frio_background_color', t('Set the background color'),        $arr['bgcolor']),
59                 '$contentbg_transp'     => array('frio_contentbg_transp', t("Content background transparency"), ($arr["contentbg_transp"] ? $arr["contentbg_transp"] : 0 )),
60                 '$background_image'     => array('frio_background_image', t('Set the background image'),        $arr['background_image']),
61                 '$bg_image_options'     => Image::get_options($arr),
62         ));
63
64         return $o;
65 }