diff --git a/config/smartyadmin.config.inc.php b/config/smartyadmin.config.inc.php index 60d9a149f..f2916819e 100644 --- a/config/smartyadmin.config.inc.php +++ b/config/smartyadmin.config.inc.php @@ -57,7 +57,14 @@ function smartyTranslate($params, &$smarty) // If the tpl is used by a Controller else { - // Split by \ and / to get the folder tree for the file + if (isset(Context::getContext()->controller)) + { + $class_name = get_class(Context::getContext()->controller); + $class = substr($class_name, 0, strpos(Tools::strtolower($class_name), 'controller')); + } + else + { + // Split by \ and / to get the folder tree for the file $folder_tree = preg_split('#[/\\\]#', $filename); $key = array_search('controllers', $folder_tree); @@ -69,8 +76,8 @@ function smartyTranslate($params, &$smarty) $class = 'Admin'.Tools::toCamelCase($folder_tree[0], true); else $class = null; + } } return Translate::getAdminTranslation($params['s'], $class, $addslashes, $htmlentities, $sprintf); -} - +} \ No newline at end of file