当前位置: 首页>>代码示例>>PHP>>正文


PHP Varien_Data_Tree_Node::getIsActive方法代码示例

本文整理汇总了PHP中Varien_Data_Tree_Node::getIsActive方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Data_Tree_Node::getIsActive方法的具体用法?PHP Varien_Data_Tree_Node::getIsActive怎么用?PHP Varien_Data_Tree_Node::getIsActive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Varien_Data_Tree_Node的用法示例。


在下文中一共展示了Varien_Data_Tree_Node::getIsActive方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: drawItem

 /**
  * @param Varien_Data_Tree_Node $category
  * @param int $level
  * @param boolean $last
  * @return string
  */
 function drawItem($category, $categoryDepth = 0, $last = false)
 {
     $html = '';
     if (!$category->getIsActive() && !$this->categoryIsRoot($category)) {
         return $html;
     }
     if (!$this->categoryHasProductUnderIt($category)) {
         return;
     }
     $html .= '<li>';
     $html .= '<div class="vaf-cat-toggler">';
     $html .= $this->htmlEscape($this->categoryName($category));
     $html .= '<div class="vaf-toggle-icon vaf-toggle-icon-plus"></div>';
     $html .= '</div>' . "\n";
     $html .= '<div class="vaf-toggle">';
     if ($category->hasChildren()) {
         $htmlChildren = $this->drawCategoryCollection($category, $categoryDepth);
         if (!empty($htmlChildren)) {
             $html .= '<ul >' . "\n" . $htmlChildren . '</ul>';
         }
     }
     $html .= $this->drawProductCollection($category);
     $html .= '</div>';
     $html .= '</li>' . "\n";
     return $html;
 }
开发者ID:hashir-dhattiwala,项目名称:vfmagento,代码行数:32,代码来源:Group.php

示例2: nodeToArray

 private function nodeToArray(Varien_Data_Tree_Node $node, $mediaUrl, $baseUrl)
 {
     $result = array();
     $thumbnail = '';
     try {
         $thumbImg = $node->getThumbnail();
         if ($thumbImg != null) {
             $thumbnail = $mediaUrl . 'catalog/category/' . $node->getThumbnail();
         }
     } catch (Exception $e) {
     }
     $result['category_id'] = $node->getId();
     $result['image'] = $mediaUrl . 'catalog/category/' . $node->getImage();
     $result['thumbnail'] = $thumbnail;
     $result['description'] = strip_tags($node->getDescription());
     $result['parent_id'] = $node->getParentId();
     $result['name'] = $node->getName();
     $result['is_active'] = $node->getIsActive();
     $result['children'] = array();
     if (method_exists('Mage', 'getEdition') && Mage::getEdition() == Mage::EDITION_COMMUNITY) {
         $result['url_path'] = $baseUrl . $node->getData('url_path');
     } else {
         $category = Mage::getModel('catalog/category')->load($node->getId());
         $result['url_path'] = $category->getUrl();
     }
     foreach ($node->getChildren() as $child) {
         $result['children'][] = $this->nodeToArray($child, $mediaUrl, $baseUrl);
     }
     return $result;
 }
开发者ID:xiaoguizhidao,项目名称:mydigibits,代码行数:30,代码来源:CategoriesController.php

示例3: _getNodeJson

 /**
  * Get JSON of a tree node or an associative array
  *
  * @param Varien_Data_Tree_Node|array $node
  * @param int $level
  * @return string
  */
 protected function _getNodeJson($node, $level = 1)
 {
     $item = array();
     $item['text'] = $this->htmlEscape($node->getName());
     if ($this->_withProductCount) {
         $item['text'] .= ' (' . $node->getProductCount() . ')';
     }
     $item['id'] = $node->getId();
     $item['path'] = $node->getData('path');
     $item['cls'] = 'folder ' . ($node->getIsActive() ? 'active-category' : 'no-active-category');
     $item['allowDrop'] = false;
     $item['allowDrag'] = false;
     if ($node->hasChildren()) {
         $item['children'] = array();
         foreach ($node->getChildren() as $child) {
             $item['children'][] = $this->_getNodeJson($child, $level + 1);
         }
     }
     if (empty($item['children']) && (int) $node->getChildrenCount() > 0) {
         $item['children'] = array();
     }
     if (!empty($item['children'])) {
         $item['expanded'] = true;
     }
     if (in_array($node->getId(), $this->getCategoryIds())) {
         $item['checked'] = true;
     }
     return $item;
 }
开发者ID:CopeX,项目名称:BannerSlider-Magento,代码行数:36,代码来源:Categories.php

示例4: nodeToArray

 function nodeToArray(Varien_Data_Tree_Node $node)
 {
     $result = array();
     $result['category_id'] = $node->getId();
     $result['parent_id'] = $node->getParentId();
     $result['name'] = $node->getName();
     $result['is_active'] = $node->getIsActive();
     $result['position'] = $node->getPosition();
     $result['level'] = $node->getLevel();
     $result['children'] = array();
     foreach ($node->getChildren() as $child) {
         $result['children'][] = $this->nodeToArray($child);
     }
     return $result;
 }
开发者ID:ahsanmage,项目名称:vr,代码行数:15,代码来源:Categorytree.php

示例5: nodeToArray

 private function nodeToArray(Varien_Data_Tree_Node $node)
 {
     $result = array();
     $category = Mage::getModel('catalog/category')->load($node->getId());
     if ($category->getAvailableForSupplier() == 1) {
         $result['category_id'] = $node->getId();
         $result['parent_id'] = $node->getParentId();
         $result['name'] = $node->getName();
         $result['is_active'] = $node->getIsActive();
         $result['position'] = $node->getPosition();
         $result['level'] = $node->getLevel();
     }
     $result['children'] = array();
     foreach ($node->getChildren() as $child) {
         $result['children'][] = $this->nodeToArray($child);
     }
     return $result;
 }
开发者ID:programmerrahul,项目名称:vastecom,代码行数:18,代码来源:Create.php

示例6: _nodeToArrayPath

 /**
  * Convert node to array with path information.
  * Path information skips the 'Root Catalog' (level=0) and 'Default Category' (level=1) levels.
  *
  * @param Varien_Data_Tree_Node $node
  * @return array
  */
 protected function _nodeToArrayPath(Varien_Data_Tree_Node $node, $parentPath)
 {
     // Only basic category data
     $categories = array();
     $category = array();
     $category['category_id'] = $node->getId();
     $category['parent_id'] = $node->getParentId();
     $category['name'] = $node->getName();
     $category['path'] = !empty($parentPath) && $node->getLevel() > 2 ? $parentPath . '/' . $node->getName() : $node->getName();
     $category['is_active'] = $node->getIsActive();
     $category['position'] = $node->getPosition();
     $category['level'] = $node->getLevel();
     $categories[] = $category;
     foreach ($node->getChildren() as $child) {
         $children = $this->_nodeToArrayPath($child, $category['path']);
         $categories = array_merge($categories, $children);
     }
     return $categories;
 }
开发者ID:adrianoaguiar,项目名称:magja-catalog-ext,代码行数:26,代码来源:Api.php

示例7: _getMenuItemClasses

 protected function _getMenuItemClasses(Varien_Data_Tree_Node $item)
 {
     $classes = array();
     $classes[] = 'level' . $item->getLevel();
     $classes[] = $item->getPositionClass();
     if ($item->getIsFirst()) {
         $classes[] = 'first';
     }
     if ($item->getIsActive()) {
         $classes[] = 'li_on';
     }
     if ($item->getIsLast()) {
         $classes[] = 'last';
     }
     if ($item->getClass()) {
         $classes[] = $item->getClass();
     }
     if ($item->hasChildren()) {
         $classes[] = 'parent';
     }
     return $classes;
 }
开发者ID:xiaoguizhidao,项目名称:bilderrahmen,代码行数:22,代码来源:Topmenu.php

示例8: _getNodesArray

 /**
  * Convert categories tree to array recursively
  *
  * @param  Varien_Data_Tree_Node $node
  * @return array
  */
 protected function _getNodesArray($node)
 {
     $result = array('id' => (int) $node->getId(), 'parent_id' => (int) $node->getParentId(), 'children_count' => (int) $node->getChildrenCount(), 'is_active' => (bool) $node->getIsActive(), 'name' => $node->getName(), 'level' => (int) $node->getLevel(), 'product_count' => (int) $node->getProductCount());
     if (is_array($this->_allowedCategoryIds) && !in_array($result['id'], $this->_allowedCategoryIds)) {
         $result['disabled'] = true;
     }
     if ($node->hasChildren()) {
         $result['children'] = array();
         foreach ($node->getChildren() as $childNode) {
             $result['children'][] = $this->_getNodesArray($childNode);
         }
     }
     $result['cls'] = ($result['is_active'] ? '' : 'no-') . 'active-category';
     $result['expanded'] = !empty($result['children']);
     return $result;
 }
开发者ID:nemphys,项目名称:magento2,代码行数:22,代码来源:Tree.php

示例9: _getMenuItemClasses

 protected function _getMenuItemClasses(Varien_Data_Tree_Node $item)
 {
     $classes = array();
     $classes[] = 'level' . $item->getLevel();
     $classes[] = $item->getPositionClass();
     if ($item->getIsFirst()) {
         $classes[] = 'first';
     }
     if ($item->getIsActive()) {
         $classes[] = 'active';
     }
     if (Mage::helper('core/url')->getCurrentUrl() == str_replace(Mage::helper('catalog/product')->getProductUrlSuffix(), "", $item->getUrl())) {
         $classes[] = 'custom-active';
     }
     if ($item->getIsLast()) {
         $classes[] = 'last';
     }
     if ($item->getClass()) {
         $classes[] = $item->getClass();
     }
     if ($item->hasChildren()) {
         $classes[] = 'parent';
     }
     return $classes;
 }
开发者ID:kiutisuperking,项目名称:eatsmartboxdev,代码行数:25,代码来源:Topmenu.php

示例10: _nodeToArray

 protected function _nodeToArray(Varien_Data_Tree_Node $node)
 {
     if (empty($node)) {
         return array();
     }
     $result = $node->debug();
     $result['category_id'] = $node->getId();
     $result['parent_id'] = $node->getParentId();
     $result['name'] = $node->getName();
     $result['is_active'] = $node->getIsActive();
     $result['is_anchor'] = $node->getIsAnchor();
     $result['url_key'] = $node->getUrlKey();
     $result['url'] = $node->getRequestPath();
     $result['position'] = $node->getPosition();
     $result['level'] = $node->getLevel();
     $result['products'] = $node->getProducts();
     $result['children'] = array();
     foreach ($node->getChildren() as $child) {
         $result['children'][] = $this->_nodeToArray($child);
     }
     return $result;
 }
开发者ID:traveladviser,项目名称:magebridge-mirror,代码行数:22,代码来源:Api.php

示例11: _getMenuItemClasses

 /**
  * Returns array of menu item's classes
  *
  * @param Varien_Data_Tree_Node $item
  * @return array
  */
 protected function _getMenuItemClasses(Varien_Data_Tree_Node $item)
 {
     if (Mage::getStoreConfig('mpanel/general/enabled')) {
         $classes = array();
         $classes[] = 'level' . $item->getLevel();
         $classes[] = $item->getPositionClass();
         if ($item->getIsFirst()) {
             $classes[] = 'first';
         }
         if ($item->getIsActive()) {
             $classes[] = 'active';
         }
         if ($item->getIsLast()) {
             $classes[] = 'last';
         }
         if ($item->getClass()) {
             $classes[] = $item->getClass();
         }
         if ($item->hasChildren()) {
             if ($item->getLevel() == 0) {
                 $classes[] = 'dropdown';
             } else {
                 $classes[] = 'dropdown-submenu';
             }
         }
         return $classes;
     } else {
         $classes = array();
         if ($item->getIsFirst()) {
             $classes[] = '';
         }
         if ($item->getIsActive()) {
             $classes[] = 'active';
         }
         if ($item->getIsLast()) {
             $classes[] = '';
         }
         if ($item->getClass()) {
             $classes[] = $item->getClass();
         }
         if ($item->hasChildren()) {
             $classes[] = 'dropdown';
         }
         return $classes;
     }
 }
开发者ID:ramantalkin,项目名称:tmp01skin,代码行数:52,代码来源:Topmenu.php

示例12: _getMenuItemClasses

 /**
  * Returns string of menu item's classes
  *
  * @param Varien_Data_Tree_Node $item
  * @return string
  */
 protected function _getMenuItemClasses(Varien_Data_Tree_Node $item)
 {
     $classes = 'level' . $item->getLevel() . ' ';
     if ($item->getIsFirst()) {
         $classes .= 'first ';
     }
     if ($item->getIsActive()) {
         $classes .= 'active ';
     }
     if ($item->getIsLast()) {
         $classes .= 'last ';
     }
     if (!$item->getFullUrl()) {
         $classes .= 'title ';
     }
     if ($item->getCssClass()) {
         $classes .= $item->getCssClass();
     }
     if ($item->hasChildren()) {
         $classes .= ' parent';
     }
     return $classes;
 }
开发者ID:scandiwebcom,项目名称:MagentoMenuManager,代码行数:29,代码来源:Menu.php

示例13: _getMenuItemClasses

 protected function _getMenuItemClasses(Varien_Data_Tree_Node $item)
 {
     Mage::log('hi', null, 'nil.log');
     $classes = array();
     $classes[] = 'level' . $item->getLevel();
     $classes[] = $item->getPositionClass();
     if ($item->getIsFirst()) {
         $classes[] = 'first';
     }
     if ($item->getIsActive()) {
         $classes[] = 'active';
     }
     if ($item->getIsLast()) {
         $classes[] = 'last';
     }
     if ($item->getClass()) {
         $classes[] = $item->getClass();
     }
     if ($item->hasChildren()) {
         $classes[] = 'dropdown';
     }
     return $classes;
 }
开发者ID:Rajivghosh,项目名称:Sass-Magento,代码行数:23,代码来源:Topmenu.php


注:本文中的Varien_Data_Tree_Node::getIsActive方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。