[*] MO : Templates overrides works with the new structure (/views/templates/admin|front|hook)

This commit is contained in:
Francois Gaillard
2013-08-01 19:10:25 +02:00
parent ac48c1b786
commit 28de7890d2
3 changed files with 11 additions and 2 deletions
+7 -2
View File
@@ -1603,7 +1603,11 @@ abstract class ModuleCore
protected static function _isTemplateOverloadedStatic($module_name, $template)
{
if (Tools::file_exists_cache(_PS_THEME_DIR_.'modules/'.$module_name.'/'.$template))
return true;
return _PS_THEME_DIR_.'modules/'.$module_name.'/'.$template;
elseif (Tools::file_exists_cache(_PS_THEME_DIR_.'modules/'.$module_name.'/views/templates/hook/'.$template))
return _PS_THEME_DIR_.'modules/'.$module_name.'/views/templates/hook/'.$template;
elseif (Tools::file_exists_cache(_PS_THEME_DIR_.'modules/'.$module_name.'/views/templates/front/'.$template))
return _PS_THEME_DIR_.'modules/'.$module_name.'/views/templates/front/'.$template;
elseif (Tools::file_exists_cache(_PS_MODULE_DIR_.$module_name.'/views/templates/hook/'.$template))
return false;
elseif (Tools::file_exists_cache(_PS_MODULE_DIR_.$module_name.'/'.$template))
@@ -1664,8 +1668,9 @@ abstract class ModuleCore
$overloaded = $this->_isTemplateOverloaded($template);
if ($overloaded === null)
return null;
if ($overloaded)
return _PS_THEME_DIR_.'modules/'.$this->name.'/'.$template;
return $overloaded;
else if (file_exists(_PS_MODULE_DIR_.$this->name.'/views/templates/hook/'.$template))
return _PS_MODULE_DIR_.$this->name.'/views/templates/hook/'.$template;
else