• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/component_template.php
  • Класс: CBitrixComponentTemplate
  • Вызов: CBitrixComponentTemplate::ApplyCachedData
public function ApplyCachedData($arData)
{
	/** @global CMain $APPLICATION */
	global $APPLICATION;

	if ($arData && is_array($arData))
	{
		if (array_key_exists("additionalCSS", $arData) && $arData["additionalCSS"] <> '')
		{
			$APPLICATION->SetAdditionalCSS($arData["additionalCSS"]);
			//Check if parent component exists and plug css it to it's "collection"
			if($this->__component && $this->__component->__parent)
				$this->__component->__parent->addChildCSS($this->__folder."/style.css");
		}

		if (array_key_exists("additionalJS", $arData) && $arData["additionalJS"] <> '')
		{
			$APPLICATION->AddHeadScript($arData["additionalJS"]);
			//Check if parent component exists and plug js it to it's "collection"
			if($this->__component && $this->__component->__parent)
				$this->__component->__parent->addChildJS($this->__folder."/script.js");
		}

		if (array_key_exists("frames", $arData) && is_array($arData["frames"]))
		{
			foreach ($arData["frames"] as $frameState)
			{
				$frame = BitrixMainCompositeStaticArea::applyCachedData($frameState);
				if ($this->__component && $this->__component->__parent)
				{
					$this->__component->__parent->addChildFrame($frame);
				}
			}
		}

		if (array_key_exists("frameMode", $arData))
		{
			$this->setFrameMode($arData["frameMode"]);

			if ($this->getFrameMode() === false)
			{
				$context = isset($arData["frameModeCtx"]) ? "(from component cache) ".$arData["frameModeCtx"] : "";
				$page = BitrixMainCompositePage::getInstance();
				$page->giveNegativeComponentVote($context);
			}

		}

		if (isset($arData["externalCss"]))
		{
			foreach ($arData["externalCss"] as $cssPath)
			{
				$APPLICATION->SetAdditionalCSS($cssPath);
				//Check if parent component exists and plug css it to it's "collection"
				if($this->__component && $this->__component->__parent)
					$this->__component->__parent->addChildCSS($cssPath);
			}
		}

		if (isset($arData["externalJs"]))
		{
			foreach ($arData["externalJs"] as $jsPath)
			{
				$APPLICATION->AddHeadScript($jsPath);
				//Check if parent component exists and plug js it to it's "collection"
				if($this->__component && $this->__component->__parent)
					$this->__component->__parent->addChildJS($jsPath);
			}
		}
	}
}