コード例 #1
0
 public function updateBlock(BlockInterface $block, $update)
 {
     if (!is_string($update)) {
         return;
     }
     $block->setContent($update);
 }
コード例 #2
0
 protected function getPreBlockEditContent(BlockInterface $block)
 {
     $widthKey = $block->getProviderName() == 'ibrows_newsletter.block.provider.textarea' ? 'textWidth' : 'imageWidth';
     $width = $block->getParentBlock()->getProviderOption($widthKey, '50%');
     return '<td class="provider" width="' . $width . '" style="width:' . $width . '">';
 }
コード例 #3
0
 /**
  * @param BlockInterface $parentBlock
  * @param BlockInterface $cloneParentBlock
  */
 protected function loopCloneNewsletterBlocks(BlockInterface $parentBlock, BlockInterface $cloneParentBlock)
 {
     foreach ($parentBlock->getBlocks() as $childBlock) {
         $cloneChildBlock = clone $childBlock;
         $cloneChildBlock->setBlocks(array());
         $cloneParentBlock->addBlock($cloneChildBlock);
         $provider = $this->getBlockProviderManager()->get($cloneChildBlock->getProviderName());
         $provider->updateClonedBlock($cloneChildBlock);
         if ($childBlock->isCompound()) {
             $this->loopCloneNewsletterBlocks($childBlock, $cloneChildBlock);
         }
     }
 }
コード例 #4
0
ファイル: Newsletter.php プロジェクト: josephzhao/map2ucore
 /**
  * @param BlockInterface $block
  * @return Newsletter
  */
 public function removeBlock(BlockInterface $block)
 {
     $block->setNewsletter(null);
     $this->blocks->removeElement($block);
     return $this;
 }
コード例 #5
0
 protected function setFilename(BlockInterface $block, $filename)
 {
     return $block->setProviderOption(self::PROVIDER_OPTION_FILENAME, $filename);
 }