public function display($disableControls = false) { $layout = $this->getAreaLayoutObject(); $a = $layout->getAreaObject(); $as = new SubArea($this->getAreaLayoutColumnDisplayID(), $a); $as->setAreaDisplayName(t('Column %s', $this->getAreaLayoutColumnIndex() + 1)); if ($disableControls) { $as->disableControls(); } $c = $a->getAreaCollectionObject(); $as->load($c); if (!$this->getAreaID()) { $this->setAreaID($as->getAreaID()); } $as->display($c); }
protected function importAdditionalData($b, $blockNode) { $controller = $b->getController(); $arLayout = $controller->getAreaLayoutObject(); $columns = $arLayout->getAreaLayoutColumns(); $layoutArea = $b->getBlockAreaObject(); $arLayout->setAreaObject($b->getBlockAreaObject()); $page = $b->getBlockCollectionObject(); $i = 0; foreach ($blockNode->arealayout->columns->column as $columnNode) { $column = $columns[$i]; $as = new SubArea($column->getAreaLayoutColumnDisplayID(), $layoutArea->getAreaHandle(), $layoutArea->getAreaID()); $as->load($page); $column->setAreaID($as->getAreaID()); $area = $column->getAreaObject(); foreach ($columnNode->block as $bx) { $bt = \BlockType::getByHandle($bx['type']); if (!is_object($bt)) { throw new \Exception(t('Invalid block type handle: %s', strval($bx['type']))); } $btc = $bt->getController(); $btc->import($page, $area->getAreaHandle(), $bx); } $i++; } }
/** * @param bool $disableControls */ public function display($disableControls = false) { $layout = $this->getAreaLayoutObject(); $a = $layout->getAreaObject(); if (is_object($a)) { $as = new SubArea($this->getAreaLayoutColumnDisplayID(), $a->getAreaHandle(), $a->getAreaID()); $as->setAreaGridMaximumColumns($this->getSubAreaMaximumColumns()); $as->setAreaDisplayName(t('Column %s', $this->getAreaLayoutColumnIndex() + 1)); if ($disableControls) { $as->disableControls(); } $c = $a->getAreaCollectionObject(); $as->load($c); if (!$this->getAreaID()) { $this->setAreaID($as->getAreaID()); } $as->setSubAreaBlockObject($this->arLayout->getBlockObject()); $as->display($c); } }
/** * @return SubArea|null */ public function getSubAreaObject() { $layout = $this->getAreaLayoutObject(); $a = $layout->getAreaObject(); if (is_object($a)) { $as = new SubArea($this->getAreaLayoutColumnDisplayID(), $a->getAreaHandle(), $a->getAreaID()); $as->setAreaGridMaximumColumns($this->getSubAreaMaximumColumns()); $as->setAreaDisplayName(t('Column %s', $this->getAreaLayoutColumnIndex() + 1)); $c = $a->getAreaCollectionObject(); $as->load($c); if (!$this->getAreaID()) { $this->setAreaID($as->getAreaID()); } $as->setSubAreaBlockObject($this->arLayout->getBlockObject()); return $as; } else { return null; } }