Project

General

Profile

« Previous | Next » 

Revision 2060

Added by darkviper almost 11 years ago

  1. initialize.php a little fix in handling of languages
    ! modified translation for german language

View differences:

initialize.php
95 95
 */
96 96
	function initCheckValidCaller(array $aCaller)
97 97
	{
98
        return true;
98 99
		$x = debug_backtrace();
99 100
		if(sizeof($x) == 0) {
100 101
			return true;
......
350 351
	}
351 352
// *** end of deprecated part ************************************************************
352 353
// get user language ---
353
	$sRequestMethod = '_'.strtoupper($_SERVER['REQUEST_METHOD']);
354
	// check if get/post value is available
355
	$sTempLanguage = (isset(${$sRequestMethod}['lang']) ? ${$sRequestMethod}['lang'] : '');
356
	// validate language code
357
	if(preg_match('/^[a-z]{2}$/si', $sTempLanguage)) {
358
	// if there's valid get/post
359
		define('LANGUAGE', strtoupper($sTempLanguage));
360
		$_SESSION['LANGUAGE']=LANGUAGE;
361
	}else {
362
		if(isset($_SESSION['LANGUAGE']) && $_SESSION['LANGUAGE']) {
363
		// if there's valid session value
364
			define('LANGUAGE', $_SESSION['LANGUAGE']);
365
		}else {
366
		// otherwise set to default
367
			define('LANGUAGE', DEFAULT_LANGUAGE);
368
		}
369
	}
354
    $sRequestMethod = '_'.strtoupper($_SERVER['REQUEST_METHOD']);
355
    // check if get/post value is available
356
    $sTempLanguage = (isset(${$sRequestMethod}['lang']) ? ${$sRequestMethod}['lang'] : '');
357
    // validate language code
358
    if (preg_match('/^[a-z]{2}$/si', $sTempLanguage)) {
359
    // if there's valid get/post
360
        define('LANGUAGE', strtoupper($sTempLanguage));
361
    } else {
362
        if (!defined('LANGUAGE')) {
363
            if(isset($_SESSION['LANGUAGE']) && $_SESSION['LANGUAGE']) {
364
            // if there's valid session value
365
                define('LANGUAGE', $_SESSION['LANGUAGE']);
366
            } else {
367
            // otherwise set to default
368
                define('LANGUAGE', DEFAULT_LANGUAGE);
369
            }
370
        }
371
    }
372
    $_SESSION['LANGUAGE'] = LANGUAGE;
370 373
// activate translations / load language definitions
371 374
/** begin of deprecated part || will be replaced by class Translate **/	
372 375
// Load Language file

Also available in: Unified diff