X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Flanguage.php;h=3239912168adcbe1c2b13d0c78f77e215ff5b07b;hp=4516d20bec9fe07bdd1caf60f82e77ea556fc0d6;hb=e32b39ab4a4cd504b2e27a238dac38b1a3c9d560;hpb=b5912168d72ae511eb623c3d92540c82d31b93c5 diff --git a/inc/language.php b/inc/language.php index 4516d20bec..3239912168 100644 --- a/inc/language.php +++ b/inc/language.php @@ -10,7 +10,12 @@ * -------------------------------------------------------------------- * * Kurzbeschreibung : Sprache-Lader * * -------------------------------------------------------------------- * - * * + * $Revision:: $ * + * $Date:: $ * + * $Tag:: 0.2.1-FINAL $ * + * $Author:: $ * + * Needs to be in all Files and every File needs "svn propset * + * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2008 by Roland Haeder * * For more information visit: http://www.mxchange.org * @@ -32,34 +37,43 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } -if (empty($mx_lang)) $mx_lang = DEFAULT_LANG; +// Try to get language from session +$mx_lang = get_session('mx_lang'); + +// Set default language if it is not (yet) set +if (is_null($mx_lang)) $mx_lang = constant('DEFAULT_LANG'); + +// Generate filename +$INC = sprintf("inc/language/%s.php", SQL_ESCAPE($mx_lang)); + +// Generate FQFN +$FQFN = constant('PATH') . $INC; // Look for file -$file = sprintf(PATH."inc/language/%s.php", $mx_lang); -if (!file_exists($file)) -{ +if (!FILE_READABLE($FQFN)) { // Switch to default (DO NOT CHANGE!!!) - set_session("mx_lang", "de"); - $mx_lang = "de"; - $file = sprintf(PATH."inc/language/%s.php", $mx_lang); -} + $mx_lang = constant('DEFAULT_LANG'); + set_session('mx_lang', $mx_lang); + $INC = sprintf("inc/language/%s.php", $mx_lang); +} // END - if // Load language file -require($file); -unset($file); +LOAD_INC_ONCE($INC); // Check for installation mode -if (!mxchange_installed) -{ +if ((isInstalling()) || (!isInstalled()) || (!isAdminRegistered())) { // Load matching language file - require(PATH."inc/language/install_".$mx_lang.".php"); + LOAD_INC("inc/language/install_".$mx_lang.".php"); } +// Remove no more needed variables +unset($mx_lang); +unset($INC); + // ?>