Esempio n. 1
0
 public function export($node, $exportType = 'full')
 {
     if (!$this->isAliasOfMasterCollection()) {
         $blockNode = $node->addChild('block');
         $blockNode->addAttribute('type', $this->getBlockTypeHandle());
         $blockNode->addAttribute('name', $this->getBlockName());
         if ($this->getBlockFilename() != '') {
             $blockNode->addAttribute('custom-template', $this->getBlockFilename());
         }
         if (is_object($this->c) && $this->c->isMasterCollection()) {
             $mcBlockID = Loader::helper('validation/identifier')->getString(8);
             ContentExporter::addMasterCollectionBlockID($this, $mcBlockID);
             $blockNode->addAttribute('mc-block-id', $mcBlockID);
         }
         if ($exportType == 'full') {
             $style = $this->getCustomStyle();
             if (is_object($style)) {
                 $set = $style->getStyleSet();
                 $set->export($blockNode);
             }
             if ($this->overrideBlockTypeCacheSettings()) {
                 $settings = $this->getBlockCacheSettingsObject();
                 $blockNode['cache-output'] = $settings->cacheBlockOutput();
                 $blockNode['cache-output-lifetime'] = $settings->getBlockOutputCacheLifetime();
                 $blockNode['cache-output-on-post'] = $settings->cacheBlockOutputOnPost();
                 $blockNode['cache-output-for-registered-users'] = $settings->cacheBlockOutputForRegisteredUsers();
             }
             $bc = $this->getInstance();
             $bc->export($blockNode);
         }
     } else {
         $blockNode = $node->addChild('block');
         $blockNode->addAttribute('mc-block-id', ContentExporter::getMasterCollectionTemporaryBlockID($this));
     }
 }
Esempio n. 2
0
 public function export($node, $exportType = 'full')
 {
     if (!$this->isAliasOfMasterCollection()) {
         $blockNode = $node->addChild('block');
         $blockNode->addAttribute('type', $this->getBlockTypeHandle());
         $blockNode->addAttribute('name', $this->getBlockName());
         if ($this->getBlockFilename() != '') {
             $blockNode->addAttribute('custom-template', $this->getBlockFilename());
         }
         if (is_object($this->c) && $this->c->isMasterCollection()) {
             $mcBlockID = Loader::helper('validation/identifier')->getString(8);
             ContentExporter::addMasterCollectionBlockID($this, $mcBlockID);
             $blockNode->addAttribute('mc-block-id', $mcBlockID);
         }
         if ($exportType == 'full') {
             $style = $this->getCustomStyle();
             if (is_object($style)) {
                 $set = $style->getStyleSet();
                 $set->export($blockNode);
             }
             $bc = $this->getInstance();
             $bc->export($blockNode);
         }
     } else {
         $blockNode = $node->addChild('block');
         $blockNode->addAttribute('mc-block-id', ContentExporter::getMasterCollectionTemporaryBlockID($this));
     }
 }