From 744e398a190e2c7ab72b01d7981c75a75f0a4d42 Mon Sep 17 00:00:00 2001 From: rMalie Date: Mon, 9 Jan 2012 14:02:34 +0000 Subject: [PATCH] // Use smarty->getTemplateDir(0) instead of smarty->template_dir[0] (private property) git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12265 b9a71923-0436-4b27-9f14-aed3839534dd --- classes/AdminController.php | 6 +++--- classes/helper/Helper.php | 2 +- config/smartyfront.config.inc.php | 2 +- controllers/admin/AdminStockManagementController.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/classes/AdminController.php b/classes/AdminController.php index 4919df05e..dbcceb6b3 100644 --- a/classes/AdminController.php +++ b/classes/AdminController.php @@ -1112,7 +1112,7 @@ class AdminControllerCore extends Controller // new smarty : template_dir is an array. // @todo : add override path to the smarty config, and checking all array item - if (file_exists($this->context->smarty->template_dir[0].'/'.$tpl_action) && $this->display != 'view' && $this->display != 'options') + if (file_exists($this->context->smarty->getTemplateDir(0).'/'.$tpl_action) && $this->display != 'view' && $this->display != 'options') { if (method_exists($this, $this->display.Tools::toCamelCase($this->className))) $this->{$this->display.Tools::toCamelCase($this->className)}(); @@ -1122,7 +1122,7 @@ class AdminControllerCore extends Controller if (!$this->ajax) { // Check if content template has been override - if (file_exists($this->context->smarty->template_dir[0].'/'.$tpl)) + if (file_exists($this->context->smarty->getTemplateDir(0).'/'.$tpl)) $page = $this->context->smarty->fetch($tpl); else $page = $this->context->smarty->fetch($this->template); @@ -1471,7 +1471,7 @@ class AdminControllerCore extends Controller public function renderForm() { if (Tools::getValue('submitFormAjax')) - $this->content .= $this->context->smarty->fetch($this->context->smarty->template_dir[0].'form_submit_ajax.tpl'); + $this->content .= $this->context->smarty->fetch('form_submit_ajax.tpl'); if ($this->fields_form && is_array($this->fields_form)) { if (!$this->multiple_fieldsets) diff --git a/classes/helper/Helper.php b/classes/helper/Helper.php index 52422b6e1..91c77b404 100755 --- a/classes/helper/Helper.php +++ b/classes/helper/Helper.php @@ -80,7 +80,7 @@ class HelperCore public function createTemplate($tpl_name) { // Overrides exists? - if ($this->override_folder && file_exists($this->context->smarty->template_dir[0].$this->override_folder.$tpl_name)) + if ($this->override_folder && file_exists($this->context->smarty->getTemplateDir(0).$this->override_folder.$tpl_name)) return $this->context->smarty->createTemplate($this->override_folder.$tpl_name); return $this->context->smarty->createTemplate($this->base_folder.$tpl_name); diff --git a/config/smartyfront.config.inc.php b/config/smartyfront.config.inc.php index a0f5fcca8..f2e8a1666 100644 --- a/config/smartyfront.config.inc.php +++ b/config/smartyfront.config.inc.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ global $smarty; -$smarty->template_dir = _PS_THEME_DIR_.'tpl'; +$smarty->setTemplateDir(_PS_THEME_DIR_.'tpl'); function smartyTranslate($params, &$smarty) { diff --git a/controllers/admin/AdminStockManagementController.php b/controllers/admin/AdminStockManagementController.php index 1cc4a16ee..9bb507dc8 100644 --- a/controllers/admin/AdminStockManagementController.php +++ b/controllers/admin/AdminStockManagementController.php @@ -1018,7 +1018,7 @@ class AdminStockManagementControllerCore extends AdminController $helper = new HelperForm(); // Check if form template has been overriden - if (file_exists($this->context->smarty->template_dir.'/'.$this->tpl_folder.'form.tpl')) + if (file_exists($this->context->smarty->getTemplateDir(0).'/'.$this->tpl_folder.'form.tpl')) $helper->tpl = $this->tpl_folder.'form.tpl'; $this->setHelperDisplay($helper);