improved default preferences

- setting country from lang
- setting dateformat for lang != en to 'd.m.Y'
- setting curreny for lang != en to 'EUR'
- also setting spellcheck_lang (no idea why this is a separate option)
This commit is contained in:
Ralf Becker 2009-06-14 10:39:31 +00:00
parent d9a1970fe8
commit c1da9e199b

View File

@ -137,6 +137,10 @@ else
// give admin access to default apps, not yet set for the default group // give admin access to default apps, not yet set for the default group
function insert_default_prefs($accountid) function insert_default_prefs($accountid)
{ {
$lang = get_var('ConfigLang',Array('POST','COOKIE'),'en');
list(,$country) = explode('-',$lang);
if (empty($country)) $country = $lang;
$defaultprefs = array( $defaultprefs = array(
'common' => array( 'common' => array(
'maxmatchs' => 15, 'maxmatchs' => 15,
@ -144,11 +148,13 @@ else
'theme' => 'idots', 'theme' => 'idots',
'navbar_format' => 'icons', 'navbar_format' => 'icons',
'tz_offset' => 0, 'tz_offset' => 0,
'dateformat' => 'Y/m/d', 'dateformat' => $lang == 'en' ? 'Y/m/d' : 'd.m.Y',
'timeformat' => '24', 'timeformat' => '24',
'lang' => get_var('ConfigLang',Array('POST','COOKIE'),'en'), 'lang' => $lang,
'spellchecker_lang' => $lang,
'country' => strtoupper($country),
'default_app' => 'calendar', 'default_app' => 'calendar',
'currency' => '$', 'currency' => $lang == 'en' ? '$' : 'EUR',
'show_help' => True, 'show_help' => True,
'max_icons' => 12, 'max_icons' => 12,
), ),