From 1a4e00bd6351912efa2c3f168af7df114c73b3ec Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 21 Mar 2004 21:20:05 +0000 Subject: [PATCH] added a (optional) language-select-box, eg. for demo-sites --- login.php | 25 +++++++++++++++++++++++++ phpgwapi/templates/idots/login.tpl | 10 +++++++--- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/login.php b/login.php index 623fd3fc47..e3b86b0341 100755 --- a/login.php +++ b/login.php @@ -216,6 +216,11 @@ } else { + if ($_POST['lang'] && preg_match('/^[a-z]{2}(-[a-z]{2}){0,1}$/',$_POST['lang']) && + $_POST['lang'] != $GLOBALS['phpgw_info']['user']['preferences']['common']['lang']) + { + $GLOBALS['phpgw']->preferences->add('common','lang',$_POST['lang'],'session'); + } $forward = get_var('phpgw_forward', array('GET', 'POST'), 0); if($forward) { @@ -369,6 +374,26 @@ $var['logo_title'] = $GLOBALS['phpgw_info']['server']['login_logo_title']?$GLOBALS['phpgw_info']['server']['login_logo_title']:'www.eGroupWare.org'; $tmpl->set_var($var); + if (@$GLOBALS['phpgw_info']['server']['login_show_language_selection']) + { + $select_lang = '\n"; + $tmpl->set_var(array( + 'lang_language' => lang('Language'), + 'select_language' => $select_lang, + )); + } + else + { + $tmpl->set_block('login_form','language_select'); + $tmpl->set_var('language_select',''); + } + $tmpl->set_var('autocomplete', ($GLOBALS['phpgw_info']['server']['autocomplete_login'] ? 'autocomplete="off"' : '')); $tmpl->pfp('loginout','login_form'); diff --git a/phpgwapi/templates/idots/login.tpl b/phpgwapi/templates/idots/login.tpl index 9c9c5298d5..6890cca109 100755 --- a/phpgwapi/templates/idots/login.tpl +++ b/phpgwapi/templates/idots/login.tpl @@ -97,10 +97,14 @@   + - -   - + {lang_language}:  + {select_language} + + + +