X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Flanguage-functions.php;h=29e07cf33a87d0b9433429757ec984ac00531e99;hb=4b10617e87d23f8813857c05b6696f6398a23b90;hp=6d5735476904f0c8aaf10e7145e3d8e542958f75;hpb=6fe1347966e72af60b43bce71f70faa4ef7438d7;p=mailer.git diff --git a/inc/language-functions.php b/inc/language-functions.php index 6d57354769..29e07cf33a 100644 --- a/inc/language-functions.php +++ b/inc/language-functions.php @@ -111,10 +111,15 @@ function setCurrentLanguage ($language) { $GLOBALS['language'] = (string) $language; } +// Checks wether current language is set +function isCurrentLanguageSet () { + return (isset($GLOBALS['language'])); +} + // "Getter" for language function getLanguage () { // Do we have cache? - if (!isset($GLOBALS['language'])) { + if (!isCurrentLanguageSet()) { // Default is 'de'. DO NOT CHANGE THIS!!! $ret = 'de'; @@ -124,17 +129,17 @@ function getLanguage () { } // END - if // Is the variable set - if (isGetRequestParameterSet('mx_lang')) { + if (isGetRequestParameterSet('mailer_lang')) { // Accept only first 2 chars - $ret = substr(getRequestParameter('mx_lang'), 0, 2); - } elseif (isset($GLOBALS['language'])) { + $ret = substr(getRequestParameter('mailer_lang'), 0, 2); + } elseif (isCurrentLanguageSet()) { // Use cached $ret = getCurrentLanguage(); - } elseif (isSessionVariableSet('mx_lang')) { + } elseif (isSessionVariableSet('mailer_lang')) { // Return stored value from cookie - $ret = getSession('mx_lang'); + $ret = getSession('mailer_lang'); - // Fixes a warning before the session has the mx_lang constant + // Fixes a warning before the session has the mailer_lang constant if (empty($ret)) { $ret = getDefaultLanguage(); } // END - if @@ -154,7 +159,7 @@ function setLanguage ($lang) { $lang = substr(secureString($lang), 0, 2); // Set cookie - setSession('mx_lang', $lang); + setSession('mailer_lang', $lang); } // Checks wether a language file is there for optional extension