/** * Generate the content element */ protected function compile() { $arrContent = array(); $objBlock = BlockModuleModel::findByPk($this->block); if ($objBlock === null) { return; } $objElement = \ContentModel::findPublishedByPidAndTable($this->block, 'tl_block_module'); if ($objElement !== null) { while ($objElement->next()) { $arrContent[] = \Controller::getContentElement($objElement->current()); } } $strReturn = implode('', $arrContent); if ($objBlock->addWrapper) { $strReturn = ModuleBlock::createBlockWrapper($objBlock, $strReturn); } $this->Template->content = $strReturn; }
protected function compile() { $this->Template->block = null; // reset block attribute, otherwise block id will be printed $this->objPage = $this->determineCurrentPage(); $objChilds = BlockModuleModel::findBy('pid', $this->block, array('order' => 'sorting')); if ($objChilds === null) { $this->Template->addWrapper = false; return ''; } $strBuffer = ''; while ($objChilds->next()) { if (strlen($objChilds->hide) == 0 || $objChilds->hide == 1 || $objChilds->hide == 2 && !FE_USER_LOGGED_IN || $objChilds->hide == 3 && FE_USER_LOGGED_IN) { $strBuffer .= $this->renderChild($objChilds); } } if (strlen($strBuffer) == 0) { $this->Template->addWrapper = false; } $this->Template->block = $strBuffer; }