WIP Preorder

This commit is contained in:
Frank Schubert
2022-05-04 16:22:44 +02:00
parent 64009d12cc
commit 5481603c36
7 changed files with 279 additions and 65 deletions
+18 -3
View File
@@ -257,10 +257,25 @@ function mfLayoutInclude($filename, $folder = "") {
include $inc_path;
}
function __($string) {
/*
* global variable $lang to avoid loading it every time it's accessed
*/
if(!isset($lang)) {
$lang = [];
include(BASEDIR . "/lang/de.php");
}
function __($string, $prefix = null) {
global $lang;
if(!$lang) {
mfLoghandler::singleton()->debug("Loading language file for __() function");
include(BASEDIR . "/lang/de.php");
}
if($prefix) {
$string = "$prefix.$string";
}
if (array_key_exists($string, $lang['de'])) {
return $lang['de'][$string];
}