[-] BO: Fix translations for overridden templates #PSCFV-7391

This commit is contained in:
Rémi Gaillard
2013-01-23 14:58:37 +01:00
parent 9f876f9300
commit e660265a1c
2 changed files with 10 additions and 2 deletions
+2
View File
@@ -65,6 +65,8 @@ function smartyTranslate($params, &$smarty)
// Eg. xxx/controllers/customers/xxx => AdminCustomers // Eg. xxx/controllers/customers/xxx => AdminCustomers
if ($key !== false) if ($key !== false)
$class = 'Admin'.Tools::toCamelCase($folder_tree[$key + 1], true); $class = 'Admin'.Tools::toCamelCase($folder_tree[$key + 1], true);
elseif (isset($folder_tree[0]))
$class = 'Admin'.Tools::toCamelCase($folder_tree[0], true);
else else
$class = null; $class = null;
} }
@@ -1751,8 +1751,14 @@ class AdminTranslationsControllerCore extends AdminController
if (preg_match('#controllers#', $tmp)) if (preg_match('#controllers#', $tmp))
{ {
$parent_class = explode(DIRECTORY_SEPARATOR, $tmp); $parent_class = explode(DIRECTORY_SEPARATOR, $tmp);
$key = array_search('controllers', $parent_class); $override = array_search('override', $parent_class);
$prefix_key = 'Admin'.ucfirst($parent_class[$key + 1]); if ($override !== false)
$prefix_key = 'Admin'.ucfirst($parent_class[count($parent_class) - 1]);
else
{
$key = array_search('controllers', $parent_class);
$prefix_key = 'Admin'.ucfirst($parent_class[$key + 1]);
}
} }
else else
$prefix_key = 'Admin'.ucfirst(substr($tmp, strrpos($tmp, DIRECTORY_SEPARATOR) + 1, $pos)); $prefix_key = 'Admin'.ucfirst(substr($tmp, strrpos($tmp, DIRECTORY_SEPARATOR) + 1, $pos));