// AdminControllers cleanup
This commit is contained in:
@@ -244,7 +244,7 @@ class AdminCartsController extends AdminController
|
||||
if (!$this->context->cart->id)
|
||||
return;
|
||||
if ($this->context->cart->OrderExists())
|
||||
$errors[] = Tools::displayErrors('An order already placed with this cart');
|
||||
$errors[] = Tools::displayError('An order already placed with this cart');
|
||||
elseif (!($id_product = (int)Tools::getValue('id_product')) OR !($product = new Product((int)$id_product, true, $this->context->language->id)))
|
||||
$errors[] = Tools::displayError('Invalid product');
|
||||
elseif (!($qty = Tools::getValue('qty')) || $qty == 0)
|
||||
@@ -326,7 +326,7 @@ class AdminCartsController extends AdminController
|
||||
{
|
||||
$errors = array();
|
||||
if (!$id_order = Tools::getValue('id_order'))
|
||||
$errors[] = Tools::displayErrors('Invalid order');
|
||||
$errors[] = Tools::displayError('Invalid order');
|
||||
$cart = Cart::getCartByOrderId($id_order);
|
||||
$new_cart = $cart->duplicate();
|
||||
if (!$new_cart || !Validate::isLoadedObject($new_cart['cart']))
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
@@ -115,18 +115,7 @@ class AdminCatalogController extends AdminController
|
||||
$this->adminProducts->ajaxProcess();
|
||||
if (Tools::getValue('deleteImage'))
|
||||
$this->adminProducts->ajaxProcess();
|
||||
|
||||
}
|
||||
|
||||
public function displayErrors()
|
||||
{
|
||||
parent::displayErrors();
|
||||
$this->adminProducts->displayErrors();
|
||||
$this->adminCategories->displayErrors();
|
||||
if (Validate::isLoadedObject($this->attributeGenerator))
|
||||
$this->attributeGenerator->displayErrors();
|
||||
if (Validate::isLoadedObject($this->imageResize))
|
||||
$this->imageResize->displayErrors();
|
||||
}
|
||||
|
||||
public function initContent()
|
||||
@@ -154,12 +143,12 @@ class AdminCatalogController extends AdminController
|
||||
// Cleaning links
|
||||
$catBarIndex = self::$currentIndex;
|
||||
foreach ($catalog_tabs AS $tab)
|
||||
if (Tools::getValue($tab.'Orderby') && Tools::getValue($tab.'Orderway'))
|
||||
if (Tools::getValue($tab.'Orderby') && Tools::getValue($tab.'Orderway'))
|
||||
$catBarIndex = preg_replace('/&'.$tab.'Orderby=([a-z _]*)&'.$tab.'Orderway=([a-z]*)/i', '', self::$currentIndex);
|
||||
|
||||
|
||||
$this->context->smarty->assign('cat_bar',getPath($catBarIndex, $id_category, '', '', 'catalog', $home));
|
||||
}
|
||||
$this->content = '';
|
||||
$this->content = '';
|
||||
parent::initContent();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,14 +69,6 @@ class AdminCmsContentControllerCore extends AdminController
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
public function displayErrors()
|
||||
{
|
||||
parent::displayErrors();
|
||||
$this->adminCMS->displayErrors();
|
||||
$this->adminCMSCategories->displayErrors();
|
||||
}
|
||||
|
||||
public function initContent()
|
||||
{
|
||||
$this->adminCMSCategories->token = $this->token;
|
||||
|
||||
@@ -1773,24 +1773,6 @@ class AdminProductsControllerCore extends AdminController
|
||||
return $content;
|
||||
}
|
||||
|
||||
public function displayErrors()
|
||||
{
|
||||
if ($this->includeSubTab('displayErrors'))
|
||||
;
|
||||
else if ($nbErrors = sizeof($this->_errors))
|
||||
{
|
||||
$this->content .= '<div class="error">
|
||||
<img src="../img/admin/error2.png" />
|
||||
'.$nbErrors.' '.($nbErrors > 1 ? $this->l('errors') : $this->l('error')).'
|
||||
<ol>';
|
||||
foreach ($this->_errors as $error)
|
||||
$this->content .= '<li>'.$error.'</li>';
|
||||
$this->content .= '
|
||||
</ol>
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
|
||||
private function _displayDraftWarning($active)
|
||||
{
|
||||
$content = '<div class="warn draft" style="'.($active ? 'display:none' : '').'">
|
||||
@@ -3539,7 +3521,6 @@ class AdminProductsControllerCore extends AdminController
|
||||
else
|
||||
$this->_errors[] = Tools::displayError('Object cannot be loaded (identifier missing or invalid)');
|
||||
|
||||
$this->displayErrors();
|
||||
return $this->object;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user