|
|
|
@ -11,8 +11,10 @@ function theme_content(&$a){
|
|
|
|
|
|
|
|
|
|
$align = get_pconfig(local_user(), 'quattro', 'align' ); |
|
|
|
|
$color = get_pconfig(local_user(), 'quattro', 'color' ); |
|
|
|
|
|
|
|
|
|
return quattro_form($a,$align, $color); |
|
|
|
|
$tfs = get_pconfig(local_user(),"quattro","tfs"); |
|
|
|
|
$pfs = get_pconfig(local_user(),"quattro","pfs"); |
|
|
|
|
|
|
|
|
|
return quattro_form($a,$align, $color, $tfs, $pfs); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function theme_post(&$a){ |
|
|
|
@ -22,6 +24,8 @@ function theme_post(&$a){
|
|
|
|
|
if (isset($_POST['quattro-settings-submit'])){ |
|
|
|
|
set_pconfig(local_user(), 'quattro', 'align', $_POST['quattro_align']); |
|
|
|
|
set_pconfig(local_user(), 'quattro', 'color', $_POST['quattro_color']); |
|
|
|
|
set_pconfig(local_user(), 'quattro', 'tfs', $_POST['quattro_tfs']); |
|
|
|
|
set_pconfig(local_user(), 'quattro', 'pfs', $_POST['quattro_pfs']); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -29,25 +33,32 @@ function theme_post(&$a){
|
|
|
|
|
function theme_admin(&$a){ |
|
|
|
|
$align = get_config('quattro', 'align' ); |
|
|
|
|
$color = get_config('quattro', 'color' ); |
|
|
|
|
|
|
|
|
|
return quattro_form($a,$align, $color); |
|
|
|
|
$tfs = get_config("quattro","tfs"); |
|
|
|
|
$pfs = get_config("quattro","pfs"); |
|
|
|
|
|
|
|
|
|
return quattro_form($a,$align, $color, $tfs, $pfs); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function theme_admin_post(&$a){ |
|
|
|
|
if (isset($_POST['quattro-settings-submit'])){ |
|
|
|
|
set_config('quattro', 'align', $_POST['quattro_align']); |
|
|
|
|
set_config('quattro', 'color', $_POST['quattro_color']); |
|
|
|
|
set_config('quattro', 'tfs', $_POST['quattro_tfs']); |
|
|
|
|
set_config('quattro', 'pfs', $_POST['quattro_pfs']); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function quattro_form(&$a, $align, $color){ |
|
|
|
|
function quattro_form(&$a, $align, $color, $tfs, $pfs){ |
|
|
|
|
$colors = array( |
|
|
|
|
"dark"=>"Quattro", |
|
|
|
|
"lilac"=>"Lilac", |
|
|
|
|
"green"=>"Green" |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($tfs===false) $tfs="20"; |
|
|
|
|
if ($pfs===false) $pfs="12"; |
|
|
|
|
|
|
|
|
|
$t = file_get_contents( dirname(__file__). "/theme_settings.tpl" ); |
|
|
|
|
$o .= replace_macros($t, array( |
|
|
|
|
'$submit' => t('Submit'), |
|
|
|
@ -55,6 +66,8 @@ function quattro_form(&$a, $align, $color){
|
|
|
|
|
'$title' => t("Theme settings"), |
|
|
|
|
'$align' => array('quattro_align', t('Alignment'), $align, '', array('left'=>t('Left'), 'center'=>t('Center'))), |
|
|
|
|
'$color' => array('quattro_color', t('Color scheme'), $color, '', $colors), |
|
|
|
|
'$pfs' => array('quattro_pfs', t('Posts font size'), $pfs), |
|
|
|
|
'$tfs' => array('quattro_tfs',t('Textareas font size'), $tfs), |
|
|
|
|
)); |
|
|
|
|
return $o; |
|
|
|
|
} |
|
|
|
|