don't make documentroot include domain-name by default (forgot on update); remove possible undefined index; beautification for template-forms, thx to monumentum

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2013-03-22 18:51:12 +01:00
parent d5997d5772
commit cce3c0fde3
10 changed files with 96 additions and 101 deletions

View File

@@ -307,21 +307,23 @@ if (isset($userinfo['language']) && isset($languages[$userinfo['language']])) {
) {
$language = $_GET['language'];
} else {
$accept_langs = explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']);
for($i = 0; $i<count($accept_langs); $i++) {
// this only works for most common languages. some (uncommon) languages have a 3 letter iso-code.
// to be able to use these also, we would have to depend on the intl extension for php (using Locale::lookup or similar)
// as long as froxlor does not support any of these languages, we can leave it like that.
if (isset($iso[substr($accept_langs[$i],0,2)])) {
$language=$iso[substr($accept_langs[$i],0,2)];
break;
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
$accept_langs = explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']);
for($i = 0; $i<count($accept_langs); $i++) {
// this only works for most common languages. some (uncommon) languages have a 3 letter iso-code.
// to be able to use these also, we would have to depend on the intl extension for php (using Locale::lookup or similar)
// as long as froxlor does not support any of these languages, we can leave it like that.
if (isset($iso[substr($accept_langs[$i],0,2)])) {
$language=$iso[substr($accept_langs[$i],0,2)];
break;
}
}
}
unset($iso);
unset($iso);
// if HTTP_ACCEPT_LANGUAGES has no valid langs, use default (very unlikely)
if (!strlen($language)>0) {
$language = $settings['panel']['standardlanguage'];
// if HTTP_ACCEPT_LANGUAGES has no valid langs, use default (very unlikely)
if (!strlen($language)>0) {
$language = $settings['panel']['standardlanguage'];
}
}
}
} else {