// fix translations / retrocompat in AdminController and config/smartyadmin.config.inc.php (AdminTranslationsController will follow)

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10301 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
mMarinetti
2011-11-20 19:10:13 +00:00
parent 3f12f6b83f
commit 70c92e1d38
2 changed files with 53 additions and 14 deletions
+16 -1
View File
@@ -59,8 +59,23 @@ function smartyTranslate($params, &$smarty)
}
$filename = ((!isset($smarty->compiler_object) OR !is_object($smarty->compiler_object->template)) ? $smarty->template_resource : $smarty->compiler_object->template->getTemplateFilepath());
$class = Tools::substr(basename($filename), 0, -4);
// 1.5 admin : default filename is .tpl; test is made on dir
$dir_filename = dirname($filename);
// key is Helper if dir contains "helper"
// we may improve this later to get only the first directory everytime
if(strpos($dir_filename, 'helper') !== false)
$dir_filename = 'helper';
switch ($dir_filename)
{
// note : this may be modified later
case '.': $class = 'index';break;
case 'helper' : $class = 'AdminTab';break;
default :
$class = 'Admin'.ucfirst($dir_filename);
}
if(in_array($class, array('header','footer','password','login')))
$class = 'index';