Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
assetcollector.php
1
<?php
2
namespace
Bitrix\Main\UserField
;
3
4
use Bitrix\Main\Page\Asset;
5
11
class
AssetCollector
12
{
13
protected
$assetCollectionStarted
=
false
;
14
15
public
function
startAssetCollection
()
16
{
17
if
(!$this->assetCollectionStarted)
18
{
19
$this->
resetAssets
();
20
$this->assetCollectionStarted =
true
;
21
}
22
}
23
24
public
function
getCollectedAssets
()
25
{
26
$result = array_merge(
27
$this->
parseResourceString
(Asset::getInstance()->getJs()),
28
$this->
parseResourceString
(Asset::getInstance()->getCss())
29
);
30
31
return
array_unique($result);
32
}
33
34
protected
function
resetAssets
()
35
{
36
global $APPLICATION;
37
38
$APPLICATION->ShowAjaxHead(
true
,
false
,
false
,
false
);
39
}
40
41
protected
function
parseResourceString
($string)
42
{
43
$result = array();
44
$string = preg_split(
"/\\r\\n|\\r|\\n/"
, $string);
45
foreach
($string as $v)
46
{
47
$v = trim((
string
)$v);
48
if
($v !==
''
)
49
{
50
$result[] = $v;
51
}
52
}
53
54
return
array_unique($result);
55
}
56
}
Bitrix\Main\UserField\AssetCollector
Definition
assetcollector.php:12
Bitrix\Main\UserField\AssetCollector\startAssetCollection
startAssetCollection()
Definition
assetcollector.php:15
Bitrix\Main\UserField\AssetCollector\resetAssets
resetAssets()
Definition
assetcollector.php:34
Bitrix\Main\UserField\AssetCollector\getCollectedAssets
getCollectedAssets()
Definition
assetcollector.php:24
Bitrix\Main\UserField\AssetCollector\parseResourceString
parseResourceString($string)
Definition
assetcollector.php:41
Bitrix\Main\UserField\AssetCollector\$assetCollectionStarted
$assetCollectionStarted
Definition
assetcollector.php:13
Bitrix\Main\UserField
modules
main
lib
userfield
assetcollector.php
Создано системой
1.10.0