//small refacto

This commit is contained in:
vAugagneur
2013-01-04 11:45:17 +01:00
parent 5703e67c96
commit b725fd2d4a
+8 -22
View File
@@ -1159,33 +1159,19 @@ class AdminControllerCore extends Controller
$this->context->smarty->assign('conf', Tools::jsonEncode($this->_conf[(int)$conf]));
else
$this->context->smarty->assign('conf', $this->_conf[(int)$conf]);
if ($this->json)
$this->context->smarty->assign('errors', Tools::jsonEncode($this->errors));
else
$this->context->smarty->assign('errors', $this->errors);
if ($this->json)
$this->context->smarty->assign('warnings', Tools::jsonEncode($this->warnings));
else
$this->context->smarty->assign('warnings', $this->warnings);
if ($this->json)
$this->context->smarty->assign('informations', Tools::jsonEncode($this->informations));
else
$this->context->smarty->assign('informations', $this->informations);
if ($this->json)
$this->context->smarty->assign('confirmations', Tools::jsonEncode($this->confirmations));
else
$this->context->smarty->assign('confirmations', $this->confirmations);
$notifications_type = array('errors', 'warnings', 'informations', 'confirmations');
foreach($notifications_type as $type)
if ($this->json)
$this->context->smarty->assign($type, Tools::jsonEncode($this->$type));
else
$this->context->smarty->assign($type, $this->$type);
if ($this->json)
$this->context->smarty->assign('page', Tools::jsonEncode($page));
else
$this->context->smarty->assign('page', $page);
$this->smartyOutputContent($this->layout);
}