// Small fixes and code cleaning

This commit is contained in:
Damien Metzger
2013-07-22 17:35:59 +02:00
parent 91c5d184b6
commit 9169995adc
2 changed files with 9 additions and 21 deletions
+6 -19
View File
@@ -1197,8 +1197,7 @@ class AdminControllerCore extends Controller
$tpl_action = $this->tpl_folder.$this->display.'.tpl';
// Check if action template has been override
// Check if action template has been overriden
foreach ($this->context->smarty->getTemplateDir() as $template_dir)
if (file_exists($template_dir.DIRECTORY_SEPARATOR.$tpl_action) && $this->display != 'view' && $this->display != 'options')
{
@@ -1217,27 +1216,15 @@ class AdminControllerCore extends Controller
$page = $this->content;
if ($conf = Tools::getValue('conf'))
if ($this->json)
$this->context->smarty->assign('conf', Tools::jsonEncode($this->_conf[(int)$conf]));
else
$this->context->smarty->assign('conf', $this->_conf[(int)$conf]);
$notifications_type = array('errors', 'warnings', 'informations', 'confirmations');
foreach($notifications_type as $type)
if ($this->json)
$this->context->smarty->assign($type, Tools::jsonEncode(array_unique($this->$type)));
else
$this->context->smarty->assign($type, array_unique($this->$type));
$this->context->smarty->assign('conf', $this->json ? Tools::jsonEncode($this->_conf[(int)$conf]) : $this->_conf[(int)$conf]);
if ($this->json)
$this->context->smarty->assign('page', Tools::jsonEncode($page));
else
$this->context->smarty->assign('page', $page);
foreach (array('errors', 'warnings', 'informations', 'confirmations') as $type)
$this->context->smarty->assign($type, $this->json ? Tools::jsonEncode(array_unique($this->$type)) : array_unique($this->$type));
$this->context->smarty->assign('page', $this->json ? Tools::jsonEncode($page) : $page);
$this->smartyOutputContent($this->layout);
}
/**
* add a warning message to display at the top of the page
*