-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.php
91 lines (77 loc) · 3.16 KB
/
config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php
/**
* Theme settings
*/
function theme_content(&$a){
if(!local_user())
return;
$bgcolor = get_pconfig( local_user(), 'clean', 'background-color');
$bgimg = get_pconfig( local_user(), 'clean', 'background-image');
$colorset = get_pconfig( local_user(), 'clean', 'colorset');
$fontsize = get_pconfig( local_user(), 'clean', 'fontsize');
$user = true;
return clean_form($a,$bgcolor, $bgimg, $colorset, $fontsize, $user);
}
function theme_post(&$a){
if(! local_user())
return;
if (isset($_POST['clean-settings-submit'])){
set_pconfig(local_user(), 'clean', 'background-color', $_POST['clean_bgcolor']);
set_pconfig(local_user(), 'clean', 'background-image', $_POST['clean_bgimg']);
set_pconfig(local_user(), 'clean', 'fontsize', $_POST['clean_fontsize']);
set_pconfig(local_user(), 'clean', 'colorset', $_POST['clean_colorset']);
}
}
function theme_admin(&$a){
$bgcolor = get_config( 'clean', 'background-color');
$bgimg = get_config( 'clean', 'background-image');
$colorset = get_config( 'clean', 'colorset');
$fontsize = get_config( 'clean', 'fontsize');
$user = false;
return clean_form($a,$bgcolor, $bgimg, $colorset, $fontsize, $user);
}
function theme_admin_post(&$a){
if (isset($_POST['clean-settings-submit'])){
set_config('clean', 'background-color', $_POST['clean_bgcolor']);
set_config('clean', 'background-image', $_POST['clean_bgimg']);
set_config('clean', 'fontsize', $_POST['clean_fontsize']);
set_config('clean', 'colorset', $_POST['clean_colorset']);
}
}
function clean_form(&$a, &$bgcolor, &$bgimg, &$colorset, &$fontsize, $user){
$colorset = array(
'default'=>t('default'),
'dark'=>t('Midnight'),
'black'=>t('Bootstrap'),
'pink'=>t('Shades of Pink'),
'lime'=>t('Lime and Orange'),
'geo'=>t('GeoCities Retro'),
);
$fs = array (
"10"=>"10pt",
"11"=>"11pt",
"12"=>"12pt",
"14"=>"14pt",
"16"=>"16pt",
"18"=>"18pt",
);
//$bgimg = get_pconfig(local_user(),'clean','background-image');
//$bgcolor = get_pconfig(local_user(),'clean', 'background-color');
if ($user) {
$color = get_pconfig(local_user(), 'clean', 'colorset');
} else {
$color = get_config( 'clean', 'colorset');
}
//$fs = get_pconfig( local_user(), 'clean', 'fontsize');
$t = get_markup_template("theme_settings.tpl" );
$o .= replace_macros($t, array(
'$submit' => t('Submit'),
'$baseurl' => $a->get_baseurl(),
'$title' => t("Theme settings"),
'$bgimg' => array('clean_bgimg', t('Background Image'), $bgimg, t('The URL to a picture (e.g. from your photo album) that should be used as background image.'),''),
'$bgcolor' => array('clean_bgcolor', t('Background Color'), $bgcolor, t('HEX value for the background color. Don\'t include the #'),''),
'$colorset' => array('clean_colorset', t('Color scheme'), $color, '', $colorset),
'$fontsize' => array('clean_fontsize', t('font size'), $fontsize, t('base font size for your interface'), $fs),
));
return $o;
}