• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/landing.php
  • Класс: BitrixLandingLanding
  • Вызов: Landing::applyTemplate
protected function applyTemplate($content = null)
{
	if ($this->tplId)
	{
		$template = Template::getList(array(
			'filter' => array(
				'ID' => $this->tplId
			)
		))->fetch();
		if ($template)
		{
			$editMode = $this->getEditMode();
			if ($template['XML_ID'] == 'empty')
			{
				$template['CONTENT'] = '
' . $template['CONTENT'] . '
'; } if ($editMode) { $replace = array( '>#CONTENT#<' => ' data-site="' . $this->siteId . '" data-landing="' . $this->id . '">#CONTENT#<', '#CONTENT#' => $content ? $content : '#CONTENT#' ); } else { $replace = array( '#CONTENT#' => $content ? $content : '#CONTENT#' ); } // if areas exist, get landings if ($template['AREA_COUNT'] > 0) { foreach ($this->getAreas() as $area => $lid) { ob_start(); $landing = self::createInstance($lid, array( 'is_area' => true, 'check_permissions' => false, 'disable_link_preview' => $this->disableLinkPreview )); if ($landing->exist()) { $landing->view(); } if ($editMode) { $rights = Rights::getOperationsForSite($landing->getSiteId()); $replace['>#AREA_' . $area . '#<'] = ' data-site="' . $landing->getSiteId() . '" data-landing="' . $lid . '" data-rights="' . implode(',', $rights) . '">#AREA_' . $area . '#<'; } $replace['#AREA_' . $area . '#'] = ob_get_contents(); ob_end_clean(); } } $content = str_replace( array_keys($replace), array_values($replace), $template['CONTENT'] ); } } else if ($this->getEditMode()) { if (!$content) { $content = '#CONTENT#'; } $content = '
' . $content . '
'; } return $content; }