// Refactor AdminController::_errors to errors

This commit is contained in:
tDidierjean
2012-01-11 08:58:12 +00:00
parent 9a607a1610
commit 8a757aaa9c
68 changed files with 857 additions and 859 deletions
@@ -89,7 +89,7 @@ class AdminAttributesGroupsControllerCore extends AdminController
$this->lang = true;
if (!Validate::isLoadedObject($obj = new AttributeGroup((int)$id)))
$this->_errors[] = Tools::displayError('An error occurred while updating status for object.').' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)');
$this->errors[] = Tools::displayError('An error occurred while updating status for object.').' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)');
$this->fieldsDisplay = array(
'id_attribute' => array(
@@ -508,22 +508,22 @@ class AdminAttributesGroupsControllerCore extends AdminController
$this->identifier = 'id_attribute';
if ($this->tabAccess['edit'] !== '1')
$this->_errors[] = Tools::displayError('You do not have permission to edit here.');
$this->errors[] = Tools::displayError('You do not have permission to edit here.');
else if (!$object = new Attribute((int)Tools::getValue($this->identifier)))
$this->_errors[] = Tools::displayError('An error occurred while updating status for object.').' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)');
$this->errors[] = Tools::displayError('An error occurred while updating status for object.').' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)');
if (Tools::getValue('position') && Tools::getValue('id_attribute'))
{
$_POST['id_attribute_group'] = $object->id_attribute_group;
if (!$object->updatePosition((int)Tools::getValue('way'), (int)Tools::getValue('position')))
$this->_errors[] = Tools::displayError('Failed to update the position.');
$this->errors[] = Tools::displayError('Failed to update the position.');
else
Tools::redirectAdmin(self::$currentIndex.'&conf=5&token='.Tools::getAdminTokenLite('AdminAttributesGroups'));
}
else if (Tools::isSubmit('deleteattribute') && Tools::getValue('id_attribute'))
{
if (!$object->delete())
$this->_errors[] = Tools::displayError('Failed to delete attribute.');
$this->errors[] = Tools::displayError('Failed to delete attribute.');
else
Tools::redirectAdmin(self::$currentIndex.'&conf=1&token='.Tools::getAdminTokenLite('AdminAttributesGroups'));
}
@@ -559,13 +559,13 @@ class AdminAttributesGroupsControllerCore extends AdminController
$object = new $this->className();
if ($object->deleteSelection($_POST[$this->table.'Box']))
Tools::redirectAdmin(self::$currentIndex.'&conf=2'.'&token='.$this->token);
$this->_errors[] = Tools::displayError('An error occurred while deleting selection.');
$this->errors[] = Tools::displayError('An error occurred while deleting selection.');
}
else
$this->_errors[] = Tools::displayError('You must select at least one element to delete.');
$this->errors[] = Tools::displayError('You must select at least one element to delete.');
}
else
$this->_errors[] = Tools::displayError('You do not have permission to delete here.');
$this->errors[] = Tools::displayError('You do not have permission to delete here.');
// clean position after delete
AttributeGroup::cleanPositions();
}