-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.php
58 lines (44 loc) · 1.19 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
<?php
/**
* Theme settings for Bohe.me
*/
function theme_content(&$a){
if(!local_user())
return;
$icon_style = get_pconfig(local_user(), 'boheme', 'icon_style');
if ($icon_style == "")
$icon_style = get_config('boheme', 'icon_style');
if ($icon_style == "")
$icon_style = "default";
return boheme_form($a, $icon_style);
}
function theme_post(&$a){
if(! local_user())
return;
if (isset($_POST['boheme-settings-submit'])){
set_pconfig(local_user(), 'boheme', 'icon_style', $_POST['icon_style']);
}
}
function theme_admin(&$a){
$style = get_config('boheme', 'icon_style');
return boheme_form($a, $icon_style);
}
function theme_admin_post(&$a){
if (isset($_POST['boheme-settings-submit'])){
set_config('boheme', 'icon_style', $_POST['icon_style']);
}
}
function boheme_form(&$a, $icon_style){
$styles = array(
"default" => "Default (Ionicons)",
"shashape" => "ShaShape (αlpha)"
);
$t = get_markup_template("theme_settings.tpl" );
$o .= replace_macros($t, array(
'$submit' => t('Submit'),
'$baseurl' => $a->get_baseurl(),
'$title' => t("Theme settings"),
'$icon_style' => array('icon_style',t ('Set Icon-style'), $icon_style, '' , $styles)
));
return $o;
}