/** * Show all the blocks in a position by name. * @todo at Core-2.0 remove all $legacy use and other checks. * @param string $positionName * @param bool|true $implode * @return array|string */ public function showBlockPosition($positionName, $implode = true) { if (!\ModUtil::available('ZikulaBlocksModule')) { // @TODO refactor to Core-2.0 return "Blocks not currently available."; } $blocks = $this->blockApi->getBlocksByPosition($positionName); foreach ($blocks as $key => $block) { $blocks[$key] = $this->showBlock($block, $positionName); } return $implode ? implode("\n", $blocks) : $blocks; }
/** * @covers BlockApi::getBlocksByPosition */ public function testGetBlocksByPosition() { $this->assertEquals([1 => $this->blockPlacements->get(1)->getBlock(), 5 => $this->blockPlacements->get(5)->getBlock()], $this->api->getBlocksByPosition('left')); }