/** * {@inheritDoc} */ public function getTool() { $tool = new Tool($this->getName(), 'OpiferContentBundle:ColumnBlock'); $tool->setData(['columnCount' => $this->columnCount])->setGroup(Tool::GROUP_LAYOUT)->setIcon('view_column')->setDescription('Inserts ' . $this->columnCount . ' columns equal in width'); return $tool; }
/** * {@inheritDoc} */ public function getTool(BlockInterface $block = null) { switch ($this->columnCount) { case 1: $type = 'one'; break; case 2: $type = 'two'; break; case 3: $type = 'three'; break; case 4: $type = 'four'; break; } $tool = new Tool($this->getName(), 'column_' . $type); $tool->setData(['columnCount' => $this->columnCount])->setGroup(Tool::GROUP_LAYOUT)->setIcon('view_column')->setDescription('Inserts ' . $this->columnCount . ' columns equal in width'); return $tool; }
/** * @inheritDoc */ public function getTool(BlockInterface $block = null) { $tools = array(); foreach ($this->getClipboardBlocks() as $block) { /** @var ToolsetMemberInterface $copyService */ $copyService = $this->blockManager->getService($block); $copyTool = $copyService->getTool($block); $tool = new Tool($copyTool->getName(), 'clipboard'); $tool->setGroup('Clipboard'); $tool->setIcon($copyTool->getIcon()); $tool->setData(['id' => $block->getId()]); $title = $block->getOwner() instanceof Content ? $block->getOwner()->getTitle() : $block->getOwner()->getName(); $tool->setDescription(sprintf('<span class="material-icons md-18">swap_horz</span> %s', $title)); $tools[] = $tool; } return $tools; }