// 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
+14
View File
@@ -718,6 +718,19 @@ class AdminControllerCore extends Controller
*/
public function initToolbar()
{
switch ($this->display)
{
// @todo defining default buttons
case 'add':
case 'edit':
case 'options':
break;
default: // list
$this->toolbar_btn['new'] = array(
'href' => self::$currentIndex.'&add'.$this->table.'&token='.$this->token,
'desc' => $this->l('Add new')
);
}
$this->context->smarty->assign('toolbar_btn', $this->toolbar_btn);
}
@@ -1119,6 +1132,7 @@ class AdminControllerCore extends Controller
}
$helper->actions = $this->actions;
$helper->toolbar_btn = $this->toolbar_btn;
$helper->bulk_actions = $this->bulk_actions;
$helper->currentIndex = self::$currentIndex;
$helper->className = $this->className;
+1 -2
View File
@@ -286,7 +286,6 @@ class HelperListCore extends Helper
'fields_display' => $this->fieldsDisplay,
'list' => $this->_list,
'actions' => $this->actions,
'toolbar_btn' => $this->toolbar_btn,
'no_link' => $this->no_link,
'current_index' => $this->currentIndex,
'view' => in_array('view', $this->actions),
@@ -528,7 +527,7 @@ class HelperListCore extends Helper
'id_cat' => $id_cat,
'shop_link_type' => $this->shopLinkType,
'has_actions' => (boolean)count($this->actions),
'add_button' => in_array('edit', $this->actions) && (!isset($this->noAdd) || !$this->noAdd),
'toolbar_btn' => $this->toolbar_btn,
'table_id' => isset($table_id) ? $table_id : null,
'table_dnd' => isset($table_dnd) ? $table_dnd : null,
'name' => isset($name) ? $name : null,