6 function theme_content(&$a) {
7 if(!local_user()) { return; }
9 $font_size = get_pconfig(local_user(),'dispy', 'font_size' );
10 $line_height = get_pconfig(local_user(), 'dispy', 'line_height' );
11 $colour = get_pconfig(local_user(), 'dispy', 'colour' );
13 return dispy_form($a, $font_size, $line_height, $colour);
16 function theme_post(&$a) {
17 if(!local_user()) { return; }
19 if (isset($_POST['dispy-settings-submit'])) {
20 set_pconfig(local_user(), 'dispy', 'font_size', $_POST['dispy_font_size']);
21 set_pconfig(local_user(), 'dispy', 'line_height', $_POST['dispy_line_height']);
22 set_pconfig(local_user(), 'dispy', 'colour', $_POST['dispy_colour']);
26 function theme_admin(&$a) {
27 $font_size = get_config('dispy', 'font_size' );
28 $line_height = get_config('dispy', 'line_height' );
29 $colour = get_config('dispy', 'colour' );
31 return dispy_form($a, $font_size, $line_height, $colour);
34 function theme_admin_post(&$a) {
35 if (isset($_POST['dispy-settings-submit'])) {
36 set_config('dispy', 'font_size', $_POST['dispy_font_size']);
37 set_config('dispy', 'line_height', $_POST['dispy_line_height']);
38 set_config('dispy', 'colour', $_POST['dispy_colour']);
42 function dispy_form(&$a, $font_size, $line_height, $colour) {
43 $line_heights = array(
68 //$t = file_get_contents( dirname(__file__). "/theme_settings.tpl" );
69 $t = get_markup_template("theme_settings.tpl" );
72 '$field_select' => 'field_select.tpl',
74 $includes = set_template_includes($a->theme['template_engine'], $includes);
76 $o .= replace_macros($t, $includes + array(
77 '$submit' => t('Submit'),
78 '$baseurl' => $a->get_baseurl(),
79 '$title' => t("Theme settings"),
80 '$font_size' => array('dispy_font_size', t('Set font-size for posts and comments'), $font_size, '', $font_sizes),
81 '$line_height' => array('dispy_line_height', t('Set line-height for posts and comments'), $line_height, '', $line_heights),
82 '$colour' => array('dispy_colour', t('Set colour scheme'), $colour, '', $colours),