// Move all helper override templates for controllers to subfolders

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13052 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
tDidierjean committed 2012-02-06 18:12:15 +00:00
1 parent 3f61d1b5a3
commit 0a931b8bfe
82 files changed
+11 -13

No files matched your search

-5
View File
@@ -472,11 +472,6 @@ class AdminControllerCore extends Controller
return $this->{'ajaxProcess'.Tools::toCamelCase($action)}(); return $this->{'ajaxProcess'.Tools::toCamelCase($action)}();
else if (method_exists($this, 'ajaxProcess')) else if (method_exists($this, 'ajaxProcess'))
return $this->ajaxProcess(); return $this->ajaxProcess();
/*if (!empty($action) && method_exists($this, 'displayAjax'.Tools::toCamelCase($action)))
$this->{'displayAjax'.$action}();
else
$this->displayAjax(); */
} }
else else
{ {
+11 -8
View File
@@ -79,15 +79,18 @@ class HelperCore
*/ */
public function createTemplate($tpl_name) public function createTemplate($tpl_name)
{ {
if ($this->context->controller instanceof ModuleAdminController) if ($this->override_folder)
{ {
if ($this->override_folder && file_exists($this->context->controller->getTemplatePath().$this->override_folder.$tpl_name)) if ($this->context->controller instanceof ModuleAdminController)
return $this->context->smarty->createTemplate($this->context->controller->getTemplatePath().$this->override_folder.$tpl_name); $override_tpl_path = $this->context->controller->getTemplatePath().$this->override_folder.$this->base_folder.$tpl_name;
else
$override_tpl_path = $this->context->smarty->getTemplateDir(0).'controllers/'.$this->override_folder.$this->base_folder.$tpl_name;
} }
else if ($this->override_folder && file_exists($this->context->smarty->getTemplateDir(0).'controllers/'.$this->override_folder.$tpl_name))
return $this->context->smarty->createTemplate('controllers/'.$this->override_folder.$tpl_name);
return $this->context->smarty->createTemplate($this->base_folder.$tpl_name); if (isset($override_tpl_path) && file_exists($override_tpl_path))
return $this->context->smarty->createTemplate($override_tpl_path);
else
return $this->context->smarty->createTemplate($this->base_folder.$tpl_name);
} }
/** /**
@@ -323,7 +326,7 @@ class HelperCore
foreach (Db::getInstance()->executeS($sql) as $row) foreach (Db::getInstance()->executeS($sql) as $row)
$assos[$row['id_'.$type]] = $row['id_'.$type]; $assos[$row['id_'.$type]] = $row['id_'.$type];
} }
$tpl = $this->createTemplate('helper/assoshop.tpl'); $tpl = $this->createTemplate('helpers/assoshop.tpl');
$tpl->assign(array( $tpl->assign(array(
'input' => array( 'input' => array(
'type' => $type, 'type' => $type,
@@ -369,7 +372,7 @@ class HelperCore
'token' => $this->token 'token' => $this->token
); );
$tpl = $this->createTemplate('helper/required_fields.tpl'); $tpl = $this->createTemplate('helpers/required_fields.tpl');
$tpl->assign($this->tpl_vars); $tpl->assign($this->tpl_vars);
return $tpl->fetch(); return $tpl->fetch();