[-] BO : Fixed bug #PSFV-276. Translates work with module tab

This commit is contained in:
vSchoener
2011-12-29 14:45:59 +00:00
parent 51880120e5
commit d759de9ec8
3 changed files with 5 additions and 3 deletions
+3 -2
View File
@@ -1617,11 +1617,12 @@ class AdminControllerCore extends Controller
// For traductions in a tpl folder with an underscore
$class = str_replace('_', '', $class);
$class_name_controller = $class.'controller';
// if the class is extended by a module, use modules/[module_name]/xx.php lang file
if (false && Module::getModuleNameFromClass($class))
if (class_exists($class_name_controller) && Module::getModuleNameFromClass($class_name_controller))
{
$string = str_replace('\'', '\\\'', $string);
return Module::findTranslation(Module::$classInModule[$class], $string, $class);
return Module::findTranslation(Module::$classInModule[$class_name_controller], $string, $class_name_controller);
}
$key = md5(str_replace('\'', '\\\'', $string));
+1 -1
View File
@@ -769,7 +769,7 @@ abstract class ModuleCore
{
// Module can now define AdminTab keeping the module translations method,
// i.e. in modules/[module name]/[iso_code].php
if (!isset(self::$classInModule[$currentClass]))
if (!isset(self::$classInModule[$currentClass]) && class_exists($currentClass))
{
global $_MODULES;
$_MODULE = array();
+1
View File
@@ -2213,6 +2213,7 @@ class ProductCore extends ObjectModel
die(Tools::displayError());
// Initializations
$id_group = (isset($context->customer) ? $context->customer->id_default_group : _PS_DEFAULT_CUSTOMER_GROUP_);
//var_dump($id_group);
if (!is_object($cur_cart) || (Validate::isUnsignedInt($id_cart) && $id_cart))
{
/*