This repository has been archived by the owner on Sep 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Fabrizio Branca
committed
Mar 12, 2012
0 parents
commit ca18e78
Showing
5 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
|
||
class Aoe_LayoutConditions_Helper_Data extends Mage_Core_Helper_Abstract { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
class Aoe_LayoutConditions_Model_Layout extends Mage_Core_Model_Layout { | ||
|
||
/** | ||
* Create layout blocks hierarchy from layout xml configuration | ||
* | ||
* @param Mage_Core_Layout_Element|null $parent | ||
*/ | ||
public function generateBlocks($parent=null) { | ||
|
||
if (empty($parent)) { | ||
$parent = $this->getNode(); | ||
} | ||
|
||
if (isset($parent['ifconfig']) && ($configPath = (string)$parent['ifconfig'])) { | ||
if (!Mage::getStoreConfigFlag($configPath)) { | ||
return; | ||
} | ||
} | ||
parent::generateBlocks($parent); | ||
} | ||
|
||
/** | ||
* Add block object to layout based on xml node data | ||
* | ||
* @param Varien_Simplexml_Element $node | ||
* @param Varien_Simplexml_Element $parent | ||
* @return Mage_Core_Model_Layout | ||
*/ | ||
protected function _generateBlock($node, $parent) { | ||
if (isset($node['ifconfig']) && ($configPath = (string)$node['ifconfig'])) { | ||
if (!Mage::getStoreConfigFlag($configPath)) { | ||
return; | ||
} | ||
} | ||
return parent::_generateBlock($node, $parent); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<config> | ||
<modules> | ||
<Aoe_LayoutConditions> | ||
<version>0.1.0</version> | ||
</Aoe_LayoutConditions> | ||
</modules> | ||
|
||
<global> | ||
<helpers> | ||
<aoe_layoutconditions> | ||
<class>Aoe_LayoutConditions_Helper</class> | ||
</aoe_layoutconditions> | ||
</helpers> | ||
<models> | ||
<!--<aoe_layoutconditions> | ||
<class>Aoe_LayoutConditions_Model</class> | ||
</aoe_layoutconditions>--> | ||
<core> | ||
<rewrite> | ||
<layout>Aoe_LayoutConditions_Model_Layout</layout> | ||
</rewrite> | ||
</core> | ||
</models> | ||
</global> | ||
|
||
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<config> | ||
<modules> | ||
<Aoe_LayoutConditions> | ||
<codePool>local</codePool> | ||
<active>true</active> | ||
</Aoe_LayoutConditions> | ||
</modules> | ||
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
app/etc/modules/* app/etc/modules/ | ||
app/code/local/Aoe/LayoutConditions app/code/local/Aoe/LayoutConditions |