//small refacto

This commit is contained in:
vAugagneur committed 2013-01-04 11:45:17 +01:00
1 parent 5703e67c96
commit b725fd2d4a
1 file changed
+7 -21
+7 -21
View File
@@ -1160,32 +1160,18 @@ class AdminControllerCore extends Controller
else else
$this->context->smarty->assign('conf', $this->_conf[(int)$conf]); $this->context->smarty->assign('conf', $this->_conf[(int)$conf]);
$notifications_type = array('errors', 'warnings', 'informations', 'confirmations');
if ($this->json) foreach($notifications_type as $type)
$this->context->smarty->assign('errors', Tools::jsonEncode($this->errors)); if ($this->json)
else $this->context->smarty->assign($type, Tools::jsonEncode($this->$type));
$this->context->smarty->assign('errors', $this->errors); else
$this->context->smarty->assign($type, $this->$type);
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);
if ($this->json) if ($this->json)
$this->context->smarty->assign('page', Tools::jsonEncode($page)); $this->context->smarty->assign('page', Tools::jsonEncode($page));
else else
$this->context->smarty->assign('page', $page); $this->context->smarty->assign('page', $page);
$this->smartyOutputContent($this->layout); $this->smartyOutputContent($this->layout);
} }