// Bug fix template override & admin templates

This commit is contained in:
Francois Gaillard
2013-08-06 11:13:49 +02:00
parent 33bdfa9c96
commit c0bc3bda29

View File

@@ -51,9 +51,10 @@ abstract class ModuleAdminControllerCore extends AdminController
public function createTemplate($tpl_name)
{
if (file_exists($this->getTemplatePath().$this->override_folder.$tpl_name) && $this->viewAccess())
if (file_exists(_PS_THEME_DIR_.'modules/'.$this->module->name.'/views/templates/admin/'.$tpl_name) && $this->viewAccess())
return $this->context->smarty->createTemplate(_PS_THEME_DIR_.'modules/'.$this->module->name.'/views/templates/admin/'.$tpl_name, $this->context->smarty);
elseif (file_exists($this->getTemplatePath().$this->override_folder.$tpl_name) && $this->viewAccess())
return $this->context->smarty->createTemplate($this->getTemplatePath().$this->override_folder.$tpl_name, $this->context->smarty);
return parent::createTemplate($tpl_name);
}
@@ -64,8 +65,6 @@ abstract class ModuleAdminControllerCore extends AdminController
*/
public function getTemplatePath()
{
if (file_exists(_PS_THEME_DIR_.'modules/'.$this->module->name.'/views/templates/admin/'.$template))
return _PS_THEME_DIR_.'modules/'.$this->module->name.'/views/templates/admin/'.$template;
return _PS_MODULE_DIR_.$this->module->name.'/views/templates/admin/';
}
}