// fix norm correct in AdminTabsController and AdminAttributesGroupsController (PSFV-94)

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9779 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
lLefevre
2011-11-02 09:46:41 +00:00
parent fe0775f4a8
commit 9e08540e84
4 changed files with 38 additions and 39 deletions
@@ -352,7 +352,7 @@ class AdminAttributesGroupsControllerCore extends AdminController
}
$str_attributes_groups = '';
foreach ($attributes_groups AS $attribute_group)
foreach ($attributes_groups as $attribute_group)
$str_attributes_groups .= '"'.$attribute_group['id_attribute_group'].'" : '.($attribute_group['group_type'] == 'color' ? '1' : '0' ) .', ';
$image = _PS_IMG_DIR_.$this->fieldImageSettings['dir'].'/'.$obj->id.'.jpg';
@@ -387,7 +387,9 @@ class AdminAttributesGroupsControllerCore extends AdminController
{
if (!Combination::isFeatureActive())
{
$this->displayWarning($this->l('This feature has been disabled, you can active this feature at this page:').' <a href="index.php?tab=AdminPerformance&token='.Tools::getAdminTokenLite('AdminPerformance').'#featuresDetachables">'.$this->l('Performances').'</a>');
$this->displayWarning($this->l('This feature has been disabled, you can active this feature at this page:').
' <a href="index.php?tab=AdminPerformance&token='.Tools::getAdminTokenLite('AdminPerformance').
'#featuresDetachables">'.$this->l('Performances').'</a>');
return;
}
@@ -435,9 +437,7 @@ class AdminAttributesGroupsControllerCore extends AdminController
Module::hookExec('postProcessAttributeGroup',
array('errors' => &$this->_errors)); // send _errors as reference to allow postProcessAttributeGroup to stop saving process
/**
* If it's an attribute, load object Attribute()
*/
// If it's an attribute, load object Attribute()
if (Tools::getValue('id_attribute') || Tools::isSubmit('deleteattribute') || Tools::isSubmit('submitAddattribute'))
{
// Override var of Controller
@@ -458,7 +458,7 @@ class AdminAttributesGroupsControllerCore extends AdminController
else
Tools::redirectAdmin(self::$currentIndex.'&conf=5&token='.Tools::getAdminTokenLite('AdminAttributesGroups'));
}
else if(Tools::isSubmit('deleteattribute') && Tools::getValue('id_attribute'))
else if (Tools::isSubmit('deleteattribute') && Tools::getValue('id_attribute'))
{
if (!$object->delete())
$this->_errors[] = Tools::displayError('Failed to delete attribute.');
@@ -485,11 +485,11 @@ class AdminAttributesGroupsControllerCore extends AdminController
}
else
{
if(Tools::getValue('submitDel'.$this->table))
if (Tools::getValue('submitDel'.$this->table))
{
if ($this->tabAccess['delete'] === '1')
{
if (isset($_POST[$this->table.'Box']))
if (isset($_POST[$this->table.'Box']))
{
$object = new $this->className();
if ($object->deleteSelection($_POST[$this->table.'Box']))
+5 -4
View File
@@ -33,7 +33,7 @@ class AdminTabsControllerCore extends AdminController
$this->table = 'tab';
$this->className = 'Tab';
$this->lang = true;
$this->fieldImageSettings = array(
'name' => 'icon',
'dir' => 't'
@@ -219,8 +219,8 @@ class AdminTabsControllerCore extends AdminController
return;
}
/* PrestaShop demo mode*/
if (($id_tab = (int)(Tools::getValue('id_tab'))) AND ($direction = Tools::getValue('move')) AND Validate::isLoadedObject($tab = new Tab($id_tab)))
if (($id_tab = (int)Tools::getValue('id_tab')) && ($direction = Tools::getValue('move')) && Validate::isLoadedObject($tab = new Tab($id_tab)))
{
if ($tab->move($direction))
Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token);
@@ -230,7 +230,8 @@ class AdminTabsControllerCore extends AdminController
if ($this->tabAccess['edit'] !== '1')
$this->_errors[] = Tools::displayError('You do not have permission to edit here.');
else if (!Validate::isLoadedObject($object = new Tab((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 (!$object->updatePosition((int)Tools::getValue('way'), (int)Tools::getValue('position')))
$this->_errors[] = Tools::displayError('Failed to update the position.');
else