From f3000f6c654cf884d7da1ab51178e50976ad1c5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Mon, 10 Jun 2013 18:23:59 +0200 Subject: [PATCH] [-] BO: Fix #PSCFV-6657 translations of overriden admin templates --- config/smartyadmin.config.inc.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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