Public Member Functions | |
getCategoryIds () | |
setCategoryIds ($ids) | |
getRoot ($parentNodeCategory=null, $recursionLevel=3) | |
Protected Member Functions | |
_prepareLayout () | |
_getNodeJson ($node, $level=1) | |
Protected Attributes | |
$_selectedIds = array() |
Definition at line 32 of file Tree.php.
_getNodeJson | ( | $ | node, | |
$ | level = 1 | |||
) | [protected] |
Get JSON of a tree node or an associative array
Varien_Data_Tree_Node|array | $node | |
int | $level |
Reimplemented from Mage_Adminhtml_Block_Catalog_Category_Tree.
Definition at line 58 of file Tree.php.
00059 { 00060 $item = array(); 00061 $item['text']= $this->htmlEscape($node->getName()); 00062 00063 if ($this->_withProductCount) { 00064 $item['text'].= ' ('.$node->getProductCount().')'; 00065 } 00066 $item['id'] = $node->getId(); 00067 $item['path'] = $node->getData('path'); 00068 $item['cls'] = 'folder ' . ($node->getIsActive() ? 'active-category' : 'no-active-category'); 00069 $item['allowDrop'] = false; 00070 $item['allowDrag'] = false; 00071 00072 if ($node->hasChildren()) { 00073 $item['children'] = array(); 00074 foreach ($node->getChildren() as $child) { 00075 $item['children'][] = $this->_getNodeJson($child, $level + 1); 00076 } 00077 } 00078 00079 if (empty($item['children']) && (int)$node->getChildrenCount() > 0) { 00080 $item['children'] = array(); 00081 } 00082 00083 if (!empty($item['children'])) { 00084 $item['expanded'] = true; 00085 } 00086 00087 if (in_array($node->getId(), $this->getCategoryIds())) { 00088 $item['checked'] = true; 00089 } 00090 00091 return $item; 00092 }
_prepareLayout | ( | ) | [protected] |
Preparing global layout
You can redefine this method in child classes for changin layout
Reimplemented from Mage_Adminhtml_Block_Catalog_Category_Tree.
Definition at line 36 of file Tree.php.
getCategoryIds | ( | ) |
getRoot | ( | $ | parentNodeCategory = null , |
|
$ | recursionLevel = 3 | |||
) |
Reimplemented from Mage_Adminhtml_Block_Catalog_Category_Abstract.
Definition at line 94 of file Tree.php.
00095 { 00096 return $this->getRootByIds($this->getCategoryIds()); 00097 }
setCategoryIds | ( | $ | ids | ) |