// Small fixes and code cleaning
This commit is contained in:
1 parent
91c5d184b6
commit
9169995adc
2 files changed
+9
-21
No files matched your search
+3
-2
@@ -868,12 +868,13 @@ class ProductCore extends ObjectModel
|
|||||||
AND cp.id_product = '.$this->id
|
AND cp.id_product = '.$this->id
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ($result as $categ_to_delete)
|
|
||||||
$this->deleteCategory($categ_to_delete['id_category']);
|
|
||||||
// if none are found, it's an error
|
// if none are found, it's an error
|
||||||
if (!is_array($result))
|
if (!is_array($result))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
foreach ($result as $categ_to_delete)
|
||||||
|
$this->deleteCategory($categ_to_delete['id_category']);
|
||||||
|
|
||||||
if (!$this->addToCategories($categories))
|
if (!$this->addToCategories($categories))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|||||||
@@ -1197,8 +1197,7 @@ class AdminControllerCore extends Controller
|
|||||||
|
|
||||||
$tpl_action = $this->tpl_folder.$this->display.'.tpl';
|
$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)
|
foreach ($this->context->smarty->getTemplateDir() as $template_dir)
|
||||||
if (file_exists($template_dir.DIRECTORY_SEPARATOR.$tpl_action) && $this->display != 'view' && $this->display != 'options')
|
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;
|
$page = $this->content;
|
||||||
|
|
||||||
if ($conf = Tools::getValue('conf'))
|
if ($conf = Tools::getValue('conf'))
|
||||||
if ($this->json)
|
$this->context->smarty->assign('conf', $this->json ? Tools::jsonEncode($this->_conf[(int)$conf]) : $this->_conf[(int)$conf]);
|
||||||
$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));
|
|
||||||
|
|
||||||
if ($this->json)
|
foreach (array('errors', 'warnings', 'informations', 'confirmations') as $type)
|
||||||
$this->context->smarty->assign('page', Tools::jsonEncode($page));
|
$this->context->smarty->assign($type, $this->json ? Tools::jsonEncode(array_unique($this->$type)) : array_unique($this->$type));
|
||||||
else
|
|
||||||
$this->context->smarty->assign('page', $page);
|
$this->context->smarty->assign('page', $this->json ? Tools::jsonEncode($page) : $page);
|
||||||
|
|
||||||
$this->smartyOutputContent($this->layout);
|
$this->smartyOutputContent($this->layout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* add a warning message to display at the top of the page
|
* add a warning message to display at the top of the page
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in new issue
Block a user