Example #1
0
 private function parseBlocks($node)
 {
     // TODO parse content, detect other blocks and create them
     $block = new Block();
     $block->setType('Content');
     $block->setName('Content');
     $value = $this->blockImporter->driver('standard')->parse($node);
     $block->setBlockValue($value);
     $block->setPosition(1);
     return $block;
 }
Example #2
0
 protected function parseBlock($node)
 {
     $block = new Block();
     $type = (string) $node['type'];
     $block->setType($type);
     $block->setName((string) $node['name']);
     $bFilename = (string) $node['custom-template'];
     if ($bFilename) {
         $block->setCustomTemplate($bFilename);
     }
     $block->setDefaultsOutputIdentifier((string) $node['mc-block-id']);
     if (isset($node->style)) {
         $styleSet = $this->styleSetImporter->import($node->style);
         $block->setStyleSet($styleSet);
     }
     $value = $this->blockImporter->driver($type)->parse($node);
     $block->setBlockValue($value);
     return $block;
 }