// Search tree toolbar button
This commit is contained in:
@@ -202,18 +202,29 @@ class HelperTreeCategoriesCore extends TreeCore
|
|||||||
&& !empty($this->_disabled_categories))
|
&& !empty($this->_disabled_categories))
|
||||||
$this->_disableCategories($data, $this->getDisabledCategories());
|
$this->_disableCategories($data, $this->getDisabledCategories());
|
||||||
|
|
||||||
$this->setActions(array(
|
//Default bootstrap style of search is push-right, so we add this button first
|
||||||
new TreeToolbarLink(
|
if ($this->useSearch())
|
||||||
'Collapse All',
|
{
|
||||||
'#',
|
$this->addAction(new TreeToolbarSearchCategories(
|
||||||
'$(\'#'.$this->getId().'\').tree(\'collapseAll\')',
|
'Find a category:',
|
||||||
'icon-collapse-alt'),
|
$this->getId().'-categories-search')
|
||||||
new TreeToolbarLink(
|
);
|
||||||
'Expand All',
|
$this->setAttribute('use_search', $this->useSearch());
|
||||||
'#',
|
}
|
||||||
'$(\'#'.$this->getId().'\').tree(\'expandAll\')',
|
|
||||||
'icon-expand-alt')
|
$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())
|
if ($this->useCheckBox())
|
||||||
{
|
{
|
||||||
@@ -235,14 +246,7 @@ class HelperTreeCategoriesCore extends TreeCore
|
|||||||
$this->setAttribute('use_checkbox', $this->useCheckBox());
|
$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());
|
$this->setAttribute('selected_categories', $this->getSelectedCatgories());
|
||||||
return parent::render($data);
|
return parent::render($data);
|
||||||
|
|||||||
Reference in New Issue
Block a user