diff --git a/log/register_exception_shortcut.php b/log/autoload_exception_shortcut.inc similarity index 100% rename from log/register_exception_shortcut.php rename to log/autoload_exception_shortcut.inc diff --git a/log/register_result_shortcut.php b/log/autoload_result_shortcut.inc similarity index 100% rename from log/register_result_shortcut.php rename to log/autoload_result_shortcut.inc diff --git a/system/HEADER.php b/system/HEADER.php index 77cd9cf..92ac5ff 100644 --- a/system/HEADER.php +++ b/system/HEADER.php @@ -1,6 +1,19 @@ locale = $lang; - \SYSTEM\SQL\SYS_LOCALE_SET_LOCALE::Q1(array($lang, $user->id)); + if($user->locale != $lang){ + $user->locale = $lang; + \SYSTEM\SQL\SYS_LOCALE_SET_LOCALE::Q1(array($lang, $user->id));} } - return true; } + /** + * Get the Session language + * If no language is saved in the Session it is set to the + * System-Default-Session defined in the config. + * + * @return string Returns Session Language + */ public static function get(){ $value = \SYSTEM\SECURITY\security::load(self::SESSION_KEY); if($value == NULL){ return \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_LANG);} - return $value; } + /** + * Checks Language against languages defined in the config. + * + * @param string $lang Language to be checked + * @return bool Returns true if Language is within the configured Languages + */ public static function isLang($lang){ if(!\in_array($lang, \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_LANGS))){ return false;} diff --git a/system/qq/SYS_LOCALE_SET_LOCALE.php b/system/qq/SYS_LOCALE_SET_LOCALE.php index 3894a63..c349e8e 100644 --- a/system/qq/SYS_LOCALE_SET_LOCALE.php +++ b/system/qq/SYS_LOCALE_SET_LOCALE.php @@ -1,5 +1,19 @@