public static function choose_language($language = "") { if (empty($language)) { $language = language_support::get_language(); } $supported_languages = language_support::get_supported_languages(); if (!array_key_exists($language, $supported_languages)) { throw new Exception("Language not supported: " . $language . ".", E_PARAMETER); } $_SESSION["LANGUAGE_CHOSEN"] = $language; language_support::initialize($language); }
} else { if (!empty($_SESSION["STYLE"]) && DEVELOPMENT_MODE == TRUE) { $STYLE = $_SESSION["STYLE"]; } } define("PATH_STYLE", PATH_URL . "styles/" . STYLE . "/"); // statistic information if (isset($_GET["statistics_level"])) { $_SESSION["STATISTICS_LEVEL"] = $_GET["statistics_level"]; } if (!isset($_SESSION["STATISTICS_LEVEL"])) { if (defined("STATISTICS_LEVEL")) { $_SESSION["STATISTICS_LEVEL"] = STATISTICS_LEVEL; } else { $_SESSION["STATISTICS_LEVEL"] = 0; } } if ($_SESSION["STATISTICS_LEVEL"] > 1) { $GLOBALS["page_time_start"] = microtime(TRUE); } //setup language support // need to set language in this script explicitely. (was set in language_support too and works for gettext but not for the strftime methods. therefore calling setlocale in this script explicitely as workaround setlocale(LC_ALL, \language_support::get_language()); function secure_gettext($string) { if (is_string($string) && $string != "") { return gettext($string); } else { return ""; } }