// 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:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user