friendica_2021-01/view/theme/quattro/config.php
Roland Häder ace8f753ac added much more curly braces + space between "if" and brace
Signed-off-by: Roland Häder <roland@mxchange.org>

Conflicts:
	mod/bookmarklet.php
	mod/community.php
	mod/contacts.php
	mod/crepair.php
	mod/events.php
	mod/network.php
	mod/suggest.php
	mod/uexport.php
	view/theme/duepuntozero/config.php
	view/theme/frio/config.php
	view/theme/quattro/config.php
	view/theme/vier/config.php
2016-12-20 11:59:13 +01:00

76 lines
2.1 KiB
PHP

<?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' );
$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){
if (! local_user()) {
return;
}
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']);
}
}
function theme_admin(&$a){
$align = get_config('quattro', 'align' );
$color = get_config('quattro', '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']);
}
}
/// @TODO $a is no longer used here
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 = get_markup_template("theme_settings.tpl" );
$o .= replace_macros($t, array(
'$submit' => t('Submit'),
'$baseurl' => App::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),
'$pfs' => array('quattro_pfs', t('Posts font size'), $pfs),
'$tfs' => array('quattro_tfs',t('Textareas font size'), $tfs),
));
return $o;
}