friendica_2021-01/view/theme/quattro/config.php

40 lines
951 B
PHP
Raw Normal View History

2012-03-30 15:45:23 +02:00
<?php
/**
* Theme settings
*/
function theme_content(&$a){
if(!local_user())
return;
$align = get_pconfig(local_user(), 'quattro', 'align' );
$color = get_pconfig(local_user(), 'quattro', 'color' );
$colors = array(
"dark"=>"Quattro",
"green"=>"Green"
);
2012-03-30 15:45:23 +02:00
$t = file_get_contents( dirname(__file__). "/theme_settings.tpl" );
$o .= replace_macros($t, array(
'$submit' => t('Submit'),
'$baseurl' => $a->get_baseurl(),
'$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),
2012-03-30 15:45:23 +02:00
));
return $o;
}
function theme_post(&$a){
if(! local_user())
return;
2012-03-30 15:45:23 +02:00
if (isset($_POST['quattro-settings-submit'])){
set_pconfig(local_user(), 'quattro', 'align', $_POST['quattro_align']);
set_pconfig(local_user(), 'quattro', 'color', $_POST['quattro_color']);
2012-03-30 15:45:23 +02:00
}
}