// Use smarty->getTemplateDir(0) instead of smarty->template_dir[0] (private property)

This commit is contained in:
rMalie
2012-01-09 14:02:34 +00:00
parent 31cde0ca2c
commit 364c763a2a
4 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -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)
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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)
{
@@ -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);