Version Notes
developed on 1.2.0.1, may work on older installations.
Download this release
Release Info
Developer | Magento Core Team |
Extension | RicoNeitzel_VertNav |
Version | 0.1.6 |
Comparing to | |
See all releases |
Code changes from version 0.1.5 to 0.1.6
app/code/community/RicoNeitzel/VertNav/Block/Navigation.php
CHANGED
@@ -48,6 +48,59 @@ class RicoNeitzel_VertNav_Block_Navigation extends Mage_Catalog_Block_Navigation
|
|
48 |
$key .= $this->_getCustomerGroupId();
|
49 |
return $key;
|
50 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
|
52 |
/**
|
53 |
* Add project specific formatting
|
@@ -59,8 +112,11 @@ class RicoNeitzel_VertNav_Block_Navigation extends Mage_Catalog_Block_Navigation
|
|
59 |
*/
|
60 |
public function drawOpenCategoryItem(Varien_Data_Tree_Node $category, $level=0, array $class=null)
|
61 |
{
|
62 |
-
$html = '';
|
63 |
-
|
|
|
|
|
|
|
64 |
|
65 |
if (! isset($class)) $class = array();
|
66 |
|
48 |
$key .= $this->_getCustomerGroupId();
|
49 |
return $key;
|
50 |
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* check if we should hide the categories because of Netzarbeiter_LoginCatalog
|
54 |
+
*
|
55 |
+
* @return boolean
|
56 |
+
*/
|
57 |
+
protected function _checkLoginCatalog()
|
58 |
+
{
|
59 |
+
return $this->_isLoginCatalogInstalledAndActive() && $this->_loginCatalogHideCategories();
|
60 |
+
}
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Check if the Netzarbeter_LoginCatalog extension is installed and active
|
64 |
+
*
|
65 |
+
* @return boolean
|
66 |
+
*/
|
67 |
+
protected function _isLoginCatalogInstalledAndActive()
|
68 |
+
{
|
69 |
+
if ($node = Mage::getConfig()->getNode('modules/Netzarbeiter_LoginCatalog'))
|
70 |
+
{
|
71 |
+
return strval($node->active) == 'true';
|
72 |
+
}
|
73 |
+
return false;
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Check if the Netzarbeter_LoginCatalog extension is configured to hide categories from logged out customers
|
78 |
+
*
|
79 |
+
* @return boolean
|
80 |
+
*/
|
81 |
+
protected function _loginCatalogHideCategories()
|
82 |
+
{
|
83 |
+
if (! Mage::getSingleton('customer/session')->isLoggedIn()
|
84 |
+
&& Mage::helper('logincatalog')->moduleActive()
|
85 |
+
&& Mage::helper('logincatalog')->getConfig('hide_categories')) {
|
86 |
+
return true;
|
87 |
+
}
|
88 |
+
return false;
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* This method is only here to provide compatibility with the Netzarbeter_LoginCatalog extension
|
93 |
+
*
|
94 |
+
* @param Varien_Data_Tree_Node $category
|
95 |
+
* @param int $level
|
96 |
+
* @param bool $last
|
97 |
+
* @return string
|
98 |
+
*/
|
99 |
+
public function drawItem($category, $level=0, $last=false)
|
100 |
+
{
|
101 |
+
if ($this->_checkLoginCatalog()) return '';
|
102 |
+
return parent::drawItem($category, $level, $last);
|
103 |
+
}
|
104 |
|
105 |
/**
|
106 |
* Add project specific formatting
|
112 |
*/
|
113 |
public function drawOpenCategoryItem(Varien_Data_Tree_Node $category, $level=0, array $class=null)
|
114 |
{
|
115 |
+
$html = '';
|
116 |
+
|
117 |
+
if ($this->_checkLoginCatalog()) return $html;
|
118 |
+
|
119 |
+
if (!$category->getIsActive()) return $html;
|
120 |
|
121 |
if (! isset($class)) $class = array();
|
122 |
|