12 private $componentName;
13 private $componentTemplateName =
'';
14 private $componentParams = [];
15 private $jsPathList = array();
16 private $cssPathList = array();
17 private $processed =
false;
20 public function __construct($componentName, $componentTemplateName =
'', $componentParams = [])
32 return $this->componentName;
40 $this->componentName = $componentName;
48 return $this->componentTemplateName;
56 $this->componentTemplateName = $componentTemplateName;
64 return $this->componentParams;
72 $this->componentParams = $componentParams;
87 $componentContent = ob_get_clean();
92 $this->
setHtml($componentContent);
93 $this->
setJsList($this->getComponentJsList());
94 $this->
setCssList($this->getComponentCssList());
105 $APPLICATION->IncludeComponent(
112 private function collectAssetsPathList()
114 Asset::getInstance()->getJs();
115 Asset::getInstance()->getCss();
117 $this->jsPathList = Asset::getInstance()->getTargetList(
'JS');
118 $this->cssPathList = Asset::getInstance()->getTargetList(
'CSS');
125 private function getComponentJsList()
129 foreach($this->jsPathList as $targetAsset)
131 $assetInfo = Asset::getInstance()->getAssetInfo($targetAsset[
'NAME'], AssetMode::ALL);
132 if (!empty($assetInfo[
'JS']))
134 $jsList = array_merge($jsList, $assetInfo[
'JS']);
144 private function getComponentCssList()
148 foreach($this->cssPathList as $targetAsset)
150 $assetInfo = Asset::getInstance()->getAssetInfo($targetAsset[
'NAME'], AssetMode::ALL);
151 if (!empty($assetInfo[
'CSS']))
153 $cssList = array_merge($cssList, $assetInfo[
'CSS']);
163 private function getComponentStringList()
165 $stringList = array();
166 foreach($this->cssPathList as $targetAsset)
168 $assetInfo = Asset::getInstance()->getAssetInfo($targetAsset[
'NAME'], AssetMode::ALL);
169 if (!empty($assetInfo[
'STRINGS']))
171 $stringList = array_merge($stringList, $assetInfo[
'STRINGS']);
175 foreach($this->jsPathList as $targetAsset)
177 $assetInfo = Asset::getInstance()->getAssetInfo($targetAsset[
'NAME'], AssetMode::ALL);
178 if (!empty($assetInfo[
'STRINGS']))
180 $stringList = array_merge($stringList, $assetInfo[
'STRINGS']);
191 return $this->processed;
199 $this->processed = $processed;