[-] FO : #PSFV-771 - Fix retrocompatibility problem with method displayContent

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@14413 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
mDeflotte
2012-04-02 15:31:00 +00:00
parent f183239ad5
commit 504de1e8e0
+18 -1
View File
@@ -261,7 +261,7 @@ class FrontControllerCore extends Controller
$page_name = $this->page_name; $page_name = $this->page_name;
elseif (!empty($this->php_self)) elseif (!empty($this->php_self))
$page_name = $this->php_self; $page_name = $this->php_self;
else if (0&&Tools::getValue('fc') == 'module' && $module_name != '' && new $module_name() instanceof PaymentModule) elseif (Tools::getValue('fc') == 'module' && $module_name != '' && new $module_name() instanceof PaymentModule)
$page_name = 'module-payment-submit'; $page_name = 'module-payment-submit';
// @retrocompatibility Are we in a module ? // @retrocompatibility Are we in a module ?
elseif (preg_match('#^'.preg_quote($this->context->shop->getPhysicalURI(), '#').'modules/([a-zA-Z0-9_-]+?)/(.*)$#', $_SERVER['REQUEST_URI'], $m)) elseif (preg_match('#^'.preg_quote($this->context->shop->getPhysicalURI(), '#').'modules/([a-zA-Z0-9_-]+?)/(.*)$#', $_SERVER['REQUEST_URI'], $m))
@@ -502,6 +502,13 @@ class FrontControllerCore extends Controller
Tools::redirectLink($this->redirect_after); Tools::redirectLink($this->redirect_after);
} }
/**
* 1.4 retrocompatibility - will be removed in 1.6
*/
public function displayContent()
{
}
public function display() public function display()
{ {
Tools::safePostVars(); Tools::safePostVars();
@@ -534,6 +541,14 @@ class FrontControllerCore extends Controller
{ {
if ($this->template) if ($this->template)
$this->context->smarty->assign('template', $this->context->smarty->fetch($this->template)); $this->context->smarty->assign('template', $this->context->smarty->fetch($this->template));
else // For retrocompatibility with 1.4 controller
{
ob_start();
$this->displayContent();
$template = ob_get_contents();
ob_clean();
$this->context->smarty->assign('template', $template);
}
$this->context->smarty->display(_PS_THEME_DIR_.'layout.tpl'); $this->context->smarty->display(_PS_THEME_DIR_.'layout.tpl');
} }
else else
@@ -545,6 +560,8 @@ class FrontControllerCore extends Controller
if ($this->template) if ($this->template)
$this->context->smarty->display($this->template); $this->context->smarty->display($this->template);
else // For retrocompatibility with 1.4 controller
$this->displayContent();
if ($this->display_footer) if ($this->display_footer)
$this->context->smarty->display(_PS_THEME_DIR_.'footer.tpl'); $this->context->smarty->display(_PS_THEME_DIR_.'footer.tpl');