// Helper now can uses toolbar

// bugfix in category listing and editing
// display fix in adminHome

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9695 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
mMarinetti
2011-10-27 18:20:13 +00:00
parent d7ac4fb94e
commit 5f79d9f879
9 changed files with 107 additions and 30 deletions
@@ -123,11 +123,28 @@ class AdminCategoriesControllerCore extends AdminController
public function initView()
{
$this->initToolbar();
$this->content .= $this->initList();
}
public function initToolbar()
{
if (empty($this->display))
$this->toolbar_btn['new'] = array(
'href' => self::$currentIndex.'&add'.$this->table.'&token='.$this->token,
'desc' => $this->l('Add new')
);
if ($this->display == 'view')
$this->toolbar_btn['new'] = array(
'href' => self::$currentIndex.'&add'.$this->table.'&id_parent='.Tools::getValue('id_category').'&token='.$this->token,
'desc' => $this->l('Add new')
);
}
public function initForm()
{
$obj = $this->loadObject(true);
$selected_cat = array(isset($obj->id_parent) ? $obj->id_parent : Tools::getValue('id_parent', 1));
if (sizeof($selected_cat) > 0)
{