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' );
16 $TSearchTerm = get_pconfig(local_user(), 'diabook', 'TSearchTerm' );
17 $ELZoom = get_pconfig(local_user(), 'diabook', 'ELZoom' );
18 $ELPosX = get_pconfig(local_user(), 'diabook', 'ELPosX' );
19 $ELPosY = get_pconfig(local_user(), 'diabook', 'ELPosY' );
21 return diabook_form($a,$font_size, $line_height, $resolution, $color, $TSearchTerm, $ELZoom, $ELPosX, $ELPosY);
24 function theme_post(&$a){
28 if (isset($_POST['diabook-settings-submit'])){
29 set_pconfig(local_user(), 'diabook', 'font_size', $_POST['diabook_font_size']);
30 set_pconfig(local_user(), 'diabook', 'line_height', $_POST['diabook_line_height']);
31 set_pconfig(local_user(), 'diabook', 'resolution', $_POST['diabook_resolution']);
32 set_pconfig(local_user(), 'diabook', 'color', $_POST['diabook_color']);
33 set_pconfig(local_user(), 'diabook', 'TSearchTerm', $_POST['diabook_TSearchTerm']);
34 set_pconfig(local_user(), 'diabook', 'ELZoom', $_POST['diabook_ELZoom']);
35 set_pconfig(local_user(), 'diabook', 'ELPosX', $_POST['diabook_ELPosX']);
36 set_pconfig(local_user(), 'diabook', 'ELPosY', $_POST['diabook_ELPosY']);
41 function theme_admin(&$a){
42 $font_size = get_config('diabook', 'font_size' );
43 $line_height = get_config('diabook', 'line_height' );
44 $resolution = get_config('diabook', 'resolution' );
45 $color = get_config('diabook', 'color' );
46 $TSearchTerm = get_config('diabook', 'TSearchTerm' );
47 $ELZoom = get_config('diabook', 'ELZoom' );
48 $ELPosX = get_config('diabook', 'ELPosX' );
49 $ELPosY = get_config('diabook', 'ELPosY' );
51 return diabook_form($a,$font_size, $line_height, $resolution, $color, $TSearchTerm, $ELZoom, $ELPosX, $ELPosY);
54 function theme_admin_post(&$a){
55 if (isset($_POST['diabook-settings-submit'])){
56 set_config('diabook', 'font_size', $_POST['diabook_font_size']);
57 set_config('diabook', 'line_height', $_POST['diabook_line_height']);
58 set_config('diabook', 'resolution', $_POST['diabook_resolution']);
59 set_config('diabook', 'color', $_POST['diabook_color']);
60 set_config('diabook', 'TSearchTerm', $_POST['diabook_TSearchTerm']);
61 set_config('diabook', 'ELZoom', $_POST['diabook_ELZoom']);
62 set_config('diabook', 'ELPosX', $_POST['diabook_ELPosX']);
63 set_config('diabook', 'ELPosY', $_POST['diabook_ELPosY']);
68 function diabook_form(&$a, $font_size, $line_height, $resolution, $color, $TSearchTerm, $ELZoom, $ELPosX, $ELPosY){
69 $line_heights = array(
105 $t = file_get_contents( dirname(__file__). "/theme_settings.tpl" );
106 $o .= replace_macros($t, array(
107 '$submit' => t('Submit'),
108 '$baseurl' => $a->get_baseurl(),
109 '$title' => t("Theme settings"),
110 '$font_size' => array('diabook_font_size', t('Set font-size for posts and comments'), $font_size, '', $font_sizes),
111 '$line_height' => array('diabook_line_height', t('Set line-height for posts and comments'), $line_height, '', $line_heights),
112 '$resolution' => array('diabook_resolution', t('Set resolution for middle column'), $resolution, '', $resolutions),
113 '$color' => array('diabook_color', t('Set color scheme'), $color, '', $colors),
114 '$TSearchTerm' => array('diabook_TSearchTerm', t('Set twitter search term'), $TSearchTerm, '', $TSearchTerm),
115 '$ELZoom' => array('diabook_ELZoom', t('Set zoomfactor for Earth Layer'), $ELZoom, '', $ELZoom),
116 '$ELPosX' => array('diabook_ELPosX', t('Set longitude (X) for Earth Layer'), $ELPosX, '', $ELPosX),
117 '$ELPosY' => array('diabook_ELPosY', t('Set latitude (Y) for Earth Layer'), $ELPosY, '', $ELPosY),