// Search tree toolbar button

This commit is contained in:
Jerome Nadaud
2013-09-20 16:20:27 +02:00
parent f44ecb9fc8
commit e9cd8ac145
+24 -20
View File
@@ -202,18 +202,29 @@ class HelperTreeCategoriesCore extends TreeCore
&& !empty($this->_disabled_categories))
$this->_disableCategories($data, $this->getDisabledCategories());
$this->setActions(array(
new TreeToolbarLink(
'Collapse All',
'#',
'$(\'#'.$this->getId().'\').tree(\'collapseAll\')',
'icon-collapse-alt'),
new TreeToolbarLink(
'Expand All',
'#',
'$(\'#'.$this->getId().'\').tree(\'expandAll\')',
'icon-expand-alt')
));
//Default bootstrap style of search is push-right, so we add this button first
if ($this->useSearch())
{
$this->addAction(new TreeToolbarSearchCategories(
'Find a category:',
$this->getId().'-categories-search')
);
$this->setAttribute('use_search', $this->useSearch());
}
$this->addAction(new TreeToolbarLink(
'Collapse All',
'#',
'$(\'#'.$this->getId().'\').tree(\'collapseAll\')',
'icon-collapse-alt')
);
$this->addAction(new TreeToolbarLink(
'Expand All',
'#',
'$(\'#'.$this->getId().'\').tree(\'expandAll\')',
'icon-expand-alt')
);
if ($this->useCheckBox())
{
@@ -235,14 +246,7 @@ class HelperTreeCategoriesCore extends TreeCore
$this->setAttribute('use_checkbox', $this->useCheckBox());
}
if ($this->useSearch())
{
$this->addAction(new TreeToolbarSearchCategories(
'Find a category:',
$this->getId().'-categories-search')
);
$this->setAttribute('use_search', $this->useSearch());
}
$this->setAttribute('selected_categories', $this->getSelectedCatgories());
return parent::render($data);