示例#1
0
 protected function _generateBlockLayoutXML($blockName)
 {
     if (self::$_layoutXml == null) {
         self::$_layoutXml = Mage::app()->getLayout()->getUpdate()->asSimplexml();
     }
     $sections = self::$_layoutXml->xpath("//block[@name='{$blockName}'] | //reference[@name='{$blockName}']");
     $layoutXml = '';
     foreach ($sections as $section) {
         $layoutXml .= $this->_generateSubBlockLayoutXml($section);
     }
     $layout = new Mage_Core_Model_Layout();
     $layout->getUpdate()->addUpdate($layoutXml);
     $layout->generateXml();
     $layoutXml = $layout->getXmlString();
     return $layoutXml;
 }
示例#2
0
 /**
  * Save data to cache storage and set cache lifetime equal with customer session lifetime
  *
  * @param string $data
  * @param string $id
  * @param array $tags
  */
 protected function _saveCache($data, $id, $tags = array(), $lifetime = null)
 {
     $lifetime = Mage::getConfig()->getNode(Mage_Core_Model_Session_Abstract::XML_PATH_COOKIE_LIFETIME);
     return parent::_saveCache($data, $id, $tags, $lifetime);
 }