// Refacto of lang functions (all code moved in Translate class)

This commit is contained in:
rMalie
2012-02-13 15:20:25 +00:00
parent f9aee0af57
commit bd0f852457
9 changed files with 210 additions and 230 deletions
+2 -12
View File
@@ -295,19 +295,9 @@ class HelperCore
// if the class is extended by a module, use modules/[module_name]/xx.php lang file
$currentClass = get_class($this);
if (Module::getModuleNameFromClass($currentClass))
{
$string = str_replace('\'', '\\\'', $string);
return Module::findTranslation(Module::$classInModule[$currentClass], $string, $currentClass);
}
global $_LANGADM;
return Translate::getModuleTranslation(Module::$classInModule[$currentClass], $string, $currentClass);
if ($class == __CLASS__)
$class = 'AdminTab';
$key = md5(str_replace('\'', '\\\'', $string));
$str = (key_exists(get_class($this).$key, $_LANGADM)) ? $_LANGADM[get_class($this).$key] : ((key_exists($class.$key, $_LANGADM)) ? $_LANGADM[$class.$key] : $string);
$str = $htmlentities ? htmlentities($str, ENT_QUOTES, 'utf-8') : $str;
return str_replace('"', '"', ($addslashes ? addslashes($str) : stripslashes($str)));
return Translate::getAdminTranslation($string, get_class($this), $addslashes, $htmlentities);
}
/**