2014-02-23 15:57:27 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Theme settings
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function theme_content(&$a){
|
|
|
|
if(!local_user())
|
|
|
|
return;
|
|
|
|
|
|
|
|
$style = get_pconfig(local_user(), 'vier', 'style');
|
|
|
|
|
2014-06-16 00:00:05 +02:00
|
|
|
if ($style == "")
|
|
|
|
$style = get_config('vier', 'style');
|
|
|
|
|
2015-02-21 09:44:13 +01:00
|
|
|
if ($style == "")
|
|
|
|
$style = "plus";
|
|
|
|
|
2014-02-23 15:57:27 +01:00
|
|
|
return vier_form($a,$style);
|
|
|
|
}
|
|
|
|
|
|
|
|
function theme_post(&$a){
|
|
|
|
if(! local_user())
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (isset($_POST['vier-settings-submit'])){
|
|
|
|
set_pconfig(local_user(), 'vier', 'style', $_POST['vier_style']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function theme_admin(&$a){
|
|
|
|
$style = get_config('vier', 'style');
|
|
|
|
return vier_form($a,$style);
|
|
|
|
}
|
|
|
|
|
|
|
|
function theme_admin_post(&$a){
|
|
|
|
if (isset($_POST['vier-settings-submit'])){
|
|
|
|
set_config('vier', 'style', $_POST['vier_style']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function vier_form(&$a, $style){
|
|
|
|
$styles = array(
|
2015-02-21 09:44:13 +01:00
|
|
|
"plus"=>"Plus",
|
|
|
|
"breathe"=>"Breathe",
|
|
|
|
"dark"=>"Dark",
|
2014-02-23 15:57:27 +01:00
|
|
|
"shadow"=>"Shadow",
|
2014-06-15 00:19:38 +02:00
|
|
|
"netcolour"=>"Coloured Networks",
|
2015-02-21 09:44:13 +01:00
|
|
|
"flat"=>"Flat"
|
2014-02-23 15:57:27 +01:00
|
|
|
);
|
|
|
|
$t = get_markup_template("theme_settings.tpl" );
|
|
|
|
$o .= replace_macros($t, array(
|
|
|
|
'$submit' => t('Submit'),
|
|
|
|
'$baseurl' => $a->get_baseurl(),
|
|
|
|
'$title' => t("Theme settings"),
|
|
|
|
'$style' => array('vier_style',t ('Set style'),$style,'',$styles),
|
|
|
|
));
|
|
|
|
return $o;
|
|
|
|
}
|