]> git.mxchange.org Git - friendica.git/blob - view/theme/quattro/theme.php
Merge branch 'master', remote-tracking branch 'remotes/upstream/master'
[friendica.git] / view / theme / quattro / theme.php
1 <?php
2
3 $a->hooks[] = array('plugin_settings', 'view/theme/quattro/theme.php', 'quattro_settings');
4 $a->hooks[] = array('plugin_settings_post', 'view/theme/quattro/theme.php', 'quattro_settings_post');
5
6
7 function quattro_settings(&$a, &$o){
8         if(!local_user())
9                 return;         
10         
11         $align = get_pconfig(local_user(), 'quattro', 'align' );
12         
13         $t = file_get_contents( dirname(__file__). "/theme_settings.tpl" );
14         $o .= replace_macros($t, array(
15                 '$submit' => t('Submit'),
16                 '$baseurl' => $a->get_baseurl(),
17                 '$title' => t("Theme settings"),
18                 '$align' => array('quattro_align', t('Alignment'), $align, '', array('left'=>t('Left'), 'center'=>t('Center'))),
19         ));
20 }
21
22 function quattro_settings_post(&$a){
23         if(! local_user())
24                 return;
25         if (isset($_POST['quattro-settings-submit'])){
26                 set_pconfig(local_user(), 'quattro', 'align', $_POST['quattro_align']);
27         }
28         goaway($a->get_baseurl()."/settings/addon");
29 }
30
31
32 $quattro_align = get_pconfig(local_user(), 'quattro', 'align' );
33
34 if(local_user() && $quattro_align=="center"){
35         
36         $a->page['htmlhead'].="
37         <style>
38                 html { width: 100%; margin:0px; padding:0px; }
39                 body {
40                         margin: 50px auto;
41                         width: 900px;
42                 }
43         </style>
44         ";
45         
46 }