// fix delete var no_back and multiple call method initToolbarTitle

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10277 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
lLefevre
2011-11-18 16:05:46 +00:00
parent fd90a0313d
commit 1bf46b362c
5 changed files with 56 additions and 49 deletions
@@ -367,6 +367,9 @@ class AdminAttributesGroupsControllerCore extends AdminController
return;
}
// toolbar (save, cancel, new, ..)
$this->initToolbar();
if ($this->display == 'edit' || $this->display == 'add')
{
if (!($this->object = $this->loadObject(true)))
@@ -382,14 +385,6 @@ class AdminAttributesGroupsControllerCore extends AdminController
}
else if ($this->display != 'view' && !$this->ajax)
{
$this->toolbar_btn['newAttributes'] = array(
'href' => self::$currentIndex.'&updateattribute&token='.$this->token,
'desc' => $this->l('Add new Attributes')
);
// toolbar (save, cancel, new, ..)
$this->initToolbar();
$this->content .= $this->initList();
$this->content .= $this->initOptions();
}
@@ -403,6 +398,38 @@ class AdminAttributesGroupsControllerCore extends AdminController
));
}
public function initToolbar()
{
switch ($this->display)
{
// @todo defining default buttons
case 'add':
case 'edit':
case 'editAttributes':
// Default save button - action dynamically handled in javascript
$this->toolbar_btn['save'] = array(
'href' => '#',
'desc' => $this->l('Save')
);
$back = self::$currentIndex.'&token='.$this->token;
$this->toolbar_btn['cancel'] = array(
'href' => $back,
'desc' => $this->l('Cancel')
);
break;
default: // list
$this->toolbar_btn['new'] = array(
'href' => self::$currentIndex.'&add'.$this->table.'&token='.$this->token,
'desc' => $this->l('Add new Group')
);
$this->toolbar_btn['newAttributes'] = array(
'href' => self::$currentIndex.'&updateattribute&token='.$this->token,
'desc' => $this->l('Add new Attributes')
);
}
}
public function postProcess()
{
if (!Combination::isFeatureActive())