8 function theme_content(&$a){
12 $font_size = get_pconfig(local_user(), 'diabook', 'font_size' );
13 $line_height = get_pconfig(local_user(), 'diabook', 'line_height' );
14 $resolution = get_pconfig(local_user(), 'diabook', 'resolution' );
15 $color = get_pconfig(local_user(), 'diabook', 'color' );
17 return diabook_form($a,$font_size, $line_height, $resolution, $color);
20 function theme_post(&$a){
24 if (isset($_POST['diabook-settings-submit'])){
25 set_pconfig(local_user(), 'diabook', 'font_size', $_POST['diabook_font_size']);
26 set_pconfig(local_user(), 'diabook', 'line_height', $_POST['diabook_line_height']);
27 set_pconfig(local_user(), 'diabook', 'resolution', $_POST['diabook_resolution']);
28 set_pconfig(local_user(), 'diabook', 'color', $_POST['diabook_color']);
33 function theme_admin(&$a){
34 $font_size = get_config('diabook', 'font_size' );
35 $line_height = get_config('diabook', 'line_height' );
36 $resolution = get_config('diabook', 'resolution' );
37 $color = get_config('diabook', 'color' );
39 return diabook_form($a,$font_size, $line_height, $resolution, $color);
42 function theme_admin_post(&$a){
43 if (isset($_POST['diabook-settings-submit'])){
44 set_config('diabook', 'font_size', $_POST['diabook_font_size']);
45 set_config('diabook', 'line_height', $_POST['diabook_line_height']);
46 set_config('diabook', 'resolution', $_POST['diabook_resolution']);
47 set_config('diabook', 'color', $_POST['diabook_color']);
52 function diabook_form(&$a, $font_size, $line_height, $resolution, $color){
53 $line_heights = array(
89 $t = file_get_contents( dirname(__file__). "/theme_settings.tpl" );
90 $o .= replace_macros($t, array(
91 '$submit' => t('Submit'),
92 '$baseurl' => $a->get_baseurl(),
93 '$title' => t("Theme settings"),
94 '$font_size' => array('diabook_font_size', t('Set font-size for posts and comments'), $font_size, '', $font_sizes),
95 '$line_height' => array('diabook_line_height', t('Set line-height for posts and comments'), $line_height, '', $line_heights),
96 '$resolution' => array('diabook_resolution', t('Set resolution for middle column'), $resolution, '', $resolutions),
97 '$color' => array('diabook_color', t('Set color scheme'), $color, '', $colors),