/** * @param BlockInterface $block * @param boolean $isInside * * @return FacadeInterface * * @throws TransformerParameterTypeException */ public function transform($block, $isInside = true) { if (!$block instanceof BlockInterface) { throw new TransformerParameterTypeException(); } $facade = $this->newFacade(); $facade->method = $isInside ? BlockFacade::GENERATE : BlockFacade::LOAD; $facade->component = $block->getComponent(); $facade->label = $block->getLabel(); $facade->style = $block->getStyle(); $facade->id = $block->getId(); foreach ($block->getAttributes() as $key => $attribute) { if (is_array($attribute)) { $attribute = json_encode($attribute); } $facade->addAttribute($key, $attribute); } if (count($block->getAttributes()) > 0) { $html = $this->displayBlockManager->show($block)->getContent(); } else { $html = $this->displayIconManager->show($block->getComponent()); } $facade->uiModel = $this->getTransformer('ui_model')->transform(array('label' => $block->getLabel() ?: $this->translator->trans('open_orchestra_backoffice.block.' . $block->getComponent() . '.title'), 'html' => $html)); $facade->addLink('_self_form', $this->generateRoute('open_orchestra_backoffice_block_new', array('component' => $block->getComponent()))); $facade->isDeletable = true; if ($this->nodeRepository->isBlockUsed($block->getId())) { $facade->isDeletable = false; } return $facade; }
/** * @param BlockInterface $block * * @return bool */ public function support(BlockInterface $block) { return BaseTinyMCEWysiwygStrategy::NAME === $block->getComponent(); }
/** * @param BlockInterface $block * * @return bool */ public function support(BlockInterface $block) { return BaseMenuStrategy::NAME === $block->getComponent(); }
/** * @param BlockInterface $block * * @return bool */ public function support(BlockInterface $block) { return BaseStrategy::NEWSLETTER === $block->getComponent(); }
/** * @param BlockInterface $block * * @return bool */ public function support(BlockInterface $block) { return $this->getName() === $block->getComponent(); }
/** * @param BlockInterface $block * * @return bool */ public function support(BlockInterface $block) { return in_array($block->getComponent(), array('elastica_search', 'elastica_list')); }
/** * @param BlockInterface $block * * @return bool */ public function support(BlockInterface $block) { return BaseLoginStrategy::LOGIN === $block->getComponent(); }
/** * @param BlockInterface $block * * @return bool */ public function support(BlockInterface $block) { return 'elastica_search' === $block->getComponent(); }
/** * @param BlockInterface $block * * @return bool */ public function support(BlockInterface $block) { return BaseMediaListByKeywordStrategy::NAME === $block->getComponent(); }
/** * @param BlockInterface $block * * @return bool */ public function support(BlockInterface $block) { return BaseConfigurableContentStrategy::NAME === $block->getComponent(); }
/** * @param BlockInterface $block * * @return bool */ public function support(BlockInterface $block) { return BaseAudienceAnalysisStrategy::NAME === $block->getComponent(); }