public function __construct() { parent::__construct(); $this->setTemplate('ops/categoriestree.phtml'); $this->setUseAjax(true); $this->_withProductCount = false; }
public function __construct() { parent::__construct(); $this->setTemplate('aitpermissions/store_switcher.phtml'); $this->setUseConfirm(true); $this->setUseAjax(true); $this->setDefaultStoreName($this->__('All Store Views')); }
protected function _getNodeJson($node, $level = 1) { $item = parent::_getNodeJson($node, $level); if (in_array($node->getId(), $this->getCategoryIds())) { $item['checked'] = true; } return $item; }
protected function _getNodeJson($node, $level = 1) { $item = parent::_getNodeJson($node, $level); $isParent = $this->_isParentSelectedCategory($node); if ($isParent) { $item['expanded'] = true; } if (in_array($node->getId(), $this->getCategoryIds())) { $item['checked'] = true; } return $item; }
protected function _getNodeJson($node, $level = 1) { $item = parent::_getNodeJson($node, $level); //echo $node->getId()."<br>"; //echo '<pre>'; //print_r($this->getCategoryIds()); if (in_array($node->getId(), $this->getCategoryIds()) || preg_match("/default/i", $item['text']) || preg_match("/root/i", $item['text'])) { //if (in_array($node->getId(), $this->getCategoryIds())) { $item['checked'] = true; } return $item; }
protected function _getNodeJson($node, $level = 1) { $item = parent::_getNodeJson($node, $level); $isParent = $this->_isParentSelectedCategory($node); if ($isParent) { $item['expanded'] = true; } // if ($node->getLevel() > 1 && !$isParent && isset($item['children'])) { // $item['children'] = array(); // } if (in_array($node->getId(), $this->getCategoryIds())) { $item['checked'] = true; } return $item; }
protected function _getNodeJson($������, $������� = 0) { $�������� = $this->{"getSelectedCategories"}(); $��������� = parent::_getNodeJson($������, $�������); $���������� = $������->{"getAllChildNodes"}(); $����������� = array_keys($����������); $�����������[] = $������������ = $������->{"getId"}(); $������������� = array_intersect($�����������, $��������); if (count($�������������)) { $���������[chr(101) . chr(120) . chr(112) . chr(97) . chr(110) . chr(100) . chr(101) . chr(100)] = true; if (in_array($������������, $��������)) { $���������[chr(99) . chr(104) . chr(101) . chr(99) . chr(107) . chr(101) . chr(100)] = true; } } return $���������; }
public function getCategoryCollection() { $collection = parent::getCategoryCollection(); $role = Mage::getSingleton('aitpermissions/role'); if ($role->isPermissionsEnabled()) { $allowedCategoryIds = array(); foreach ($role->getAllowedCategoryIds() as $allowedCategoryId) { $category = Mage::getModel('catalog/category')->load($allowedCategoryId); $categoryPath = $category->getPath(); $categoryPathIds = explode('/', $categoryPath); $allowedCategoryIds = array_merge($allowedCategoryIds, $categoryPathIds); } if (!empty($allowedCategoryIds)) { $collection->addIdFilter($allowedCategoryIds); $this->setData('category_collection', $collection); } } return $collection; }
/** * Adds some extra params to categories collection * * @return Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Collection */ public function getCategoryCollection() { return parent::getCategoryCollection()->addAttributeToSelect('url_key')->addAttributeToSelect('is_anchor'); }
public function __construct() { parent::__construct(); $this->setTemplate('aitpermissions/product/editor.phtml'); }
protected function _getNodeJson($node, $level = 3) { $item = parent::_getNodeJson($node, $level); $isParent = $this->_isParentSelectedCategory($node); if ($isParent) { $item['expanded'] = true; } $categoryids = $this->getCategoryIds(); if (count($categoryids) > 0) { if (in_array($node->getId(), $categoryids)) { $item['checked'] = true; } } return $item; }
public function __construct() { parent::__construct(); $this->setTemplate('aitpermissions/permissions_advanced.phtml'); $this->_withProductCount = false; }
/** * Get node label * * @access public * @param Varien_Object $node * @return string * @author Ultimate Module Creator */ public function buildNodeName($node) { $result = parent::buildNodeName($node); $result .= '<a target="_blank" href="' . $this->getUrl('adminhtml/catalog_category/index', array('id' => $node->getId(), 'clear' => 1)) . '"><em>' . $this->__(' - Edit') . '</em></a>'; return $result; }
public function __construct() { parent::__construct(); $this->setTemplate('salepages/categories.phtml')->toHtml(); }
public function testGetSuggestedCategoriesJson() { $this->assertEquals('[{"id":"2","children":[],"is_active":"1","name":"Default Category"}]', $this->_block->getSuggestedCategoriesJson('Default')); $this->assertEquals('[]', $this->_block->getSuggestedCategoriesJson(strrev('Default'))); }