} // END - if
// Construct FQFN for extension file
- $extInclude = sprintf("inc/extensions/ext-%s.php", $ext_name);
+ $FQFN = sprintf("%sinc/extensions/ext-%s.php",
+ constant('PATH'),
+ $ext_name
+ );
// Is the extension file NOT there?
if (!FILE_READABLE($extInclude)) {
// Include the extension file
//* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "Extension loaded.");
- LOAD_INC($extInclude);
+ require($extInclude);
// Is this extension deprecated?
if ($EXT_DEPRECATED == "Y") {
if ((GET_EXT_VERSION("cache") >= "0.1.2") && (isset($cacheInstance)) && (is_object($cacheInstance))) {
// Remove extensions and mod_reg cache file
LOAD_INC_ONCE("inc/libs/cache_functions.php");
- LOAD_INC_ONCE("inc/extensions/ext-cache.php");
+ require(sprintf("%sinc/extensions/ext-cache.php", constant('PATH')));
if ($cacheInstance->loadCacheFile("extensions", true)) $cacheInstance->destroyCacheFile();
if ($cacheInstance->loadCacheFile("mod_reg")) $cacheInstance->destroyCacheFile();
} // END - if
require($INC);
}
-// Set default language
-if (empty($mx_lang)) $mx_lang = constant('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 = sprintf("%sinc/language/%s.php", constant('PATH'), $mx_lang);
+$FQFN = constant('PATH') . $INC;
// Look for file
if (!FILE_READABLE($FQFN)) {
// Switch to default (DO NOT CHANGE!!!)
- set_session('mx_lang', constant('DEFAULT_LANG'));
- $mx_lang = "de";
- $INC = sprintf("inc/language/%s.php", constant('DEFAULT_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
LOAD_INC("inc/language/install_".$mx_lang.".php");
}
+// Remove no more needed variables
+unset($mx_lang);
+unset($INC);
+
//
?>
} // END - if
} else {
// Test-drive extension in update mode
- LOAD_INC(sprintf("inc/extensions/ext-%s.php", $ext_name));
+ require(sprintf("%sinc/extensions/ext-%s.php", constant('PATH'), $ext_name));
// Update extension if extension is installed and outdated
//* DEBUG: */ print "ext={$ext_name},ver={$EXT_VERSION}/".GET_EXT_VERSION($ext_name)."<br />\n";