Example #1
0
 public function __construct()
 {
     parent::__construct();
     $this->setTemplate('ops/categoriestree.phtml');
     $this->setUseAjax(true);
     $this->_withProductCount = false;
 }
Example #2
0
 public function __construct()
 {
     parent::__construct();
     $this->setTemplate('aitpermissions/store_switcher.phtml');
     $this->setUseConfirm(true);
     $this->setUseAjax(true);
     $this->setDefaultStoreName($this->__('All Store Views'));
 }
Example #3
0
 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;
 }
Example #5
0
 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;
 }
Example #7
0
 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');
 }
Example #10
0
 public function __construct()
 {
     parent::__construct();
     $this->setTemplate('aitpermissions/product/editor.phtml');
 }
Example #11
0
 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;
 }
Example #13
0
 /**
  * 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;
 }
Example #14
0
 public function __construct()
 {
     parent::__construct();
     $this->setTemplate('salepages/categories.phtml')->toHtml();
 }
Example #15
0
 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')));
 }