%PDF- %PDF-
Server IP : 37.220.80.31 / Your IP : 18.217.193.85 Web Server : Apache/2.4.52 (Ubuntu) System : Linux 3051455-guretool.twc1.net 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64 User : www-root ( 1010) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/www-root/data/www/dev.artlot24.ru/bitrix/modules/report/lib/visualconstructor/ |
Upload File : |
<?php namespace Bitrix\Report\VisualConstructor; use Bitrix\Main\Page\Asset; use Bitrix\Main\Page\AssetMode; class BoardComponentButton extends BoardButton { private $componentName; private $componentTemplateName = ''; private $componentParams = []; private $jsPathList = array(); private $cssPathList = array(); private $processed = false; public function __construct($componentName, $componentTemplateName = '', $componentParams = []) { $this->setComponentName($componentName); $this->setComponentTemplateName($componentTemplateName); $this->setComponentParams($componentParams); } /** * @return mixed */ public function getComponentName() { return $this->componentName; } /** * @param mixed $componentName */ public function setComponentName($componentName) { $this->componentName = $componentName; } /** * @return string */ public function getComponentTemplateName() { return $this->componentTemplateName; } /** * @param string $componentTemplateName */ public function setComponentTemplateName($componentTemplateName) { $this->componentTemplateName = $componentTemplateName; } /** * @return array */ public function getComponentParams() { return $this->componentParams; } /** * @param array $componentParams */ public function setComponentParams($componentParams) { $this->componentParams = $componentParams; } /** * @return $this|BoardButton */ public function process() { if ($this->isProcessed()) { return $this; } ob_start(); $this->flush(); $componentContent = ob_get_clean(); //$this->collectAssetsPathList(); $this->setHtml($componentContent); $this->setJsList($this->getComponentJsList()); $this->setCssList($this->getComponentCssList()); $this->setStringList($this->getComponentstringList()); $this->setProcessed(true); return $this; } public function flush() { global $APPLICATION; $APPLICATION->IncludeComponent( $this->getComponentName(), $this->getComponentTemplateName(), $this->getComponentParams() ); } private function collectAssetsPathList() { Asset::getInstance()->getJs(); Asset::getInstance()->getCss(); $this->jsPathList = Asset::getInstance()->getTargetList('JS'); $this->cssPathList = Asset::getInstance()->getTargetList('CSS'); } /** * @return array */ private function getComponentJsList() { $jsList = array(); foreach($this->jsPathList as $targetAsset) { $assetInfo = Asset::getInstance()->getAssetInfo($targetAsset['NAME'], AssetMode::ALL); if (!empty($assetInfo['JS'])) { $jsList = array_merge($jsList, $assetInfo['JS']); } } return $jsList; } /** * @return array */ private function getComponentCssList() { $cssList = array(); foreach($this->cssPathList as $targetAsset) { $assetInfo = Asset::getInstance()->getAssetInfo($targetAsset['NAME'], AssetMode::ALL); if (!empty($assetInfo['CSS'])) { $cssList = array_merge($cssList, $assetInfo['CSS']); } } return $cssList; } /** * @return array */ private function getComponentStringList() { $stringList = array(); foreach($this->cssPathList as $targetAsset) { $assetInfo = Asset::getInstance()->getAssetInfo($targetAsset['NAME'], AssetMode::ALL); if (!empty($assetInfo['STRINGS'])) { $stringList = array_merge($stringList, $assetInfo['STRINGS']); } } foreach($this->jsPathList as $targetAsset) { $assetInfo = Asset::getInstance()->getAssetInfo($targetAsset['NAME'], AssetMode::ALL); if (!empty($assetInfo['STRINGS'])) { $stringList = array_merge($stringList, $assetInfo['STRINGS']); } } return $stringList; } /** * @return bool */ public function isProcessed() { return $this->processed; } /** * @param bool $processed */ public function setProcessed($processed) { $this->processed = $processed; } }