1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
standartbuilder.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Landing\Assets;
4
5
use Bitrix\Main\Localization\Loc;
6
10
class
StandartBuilder
extends
Builder
11
{
15
public
function
setOutput
(): void
16
{
17
if
($this->resources->isEmpty())
18
{
19
return
;
20
}
21
22
$this->
normalizeResources
();
23
$this->initResourcesAsJsExtension($this->normalizedResources);
24
25
$this->setStrings();
26
}
27
28
protected
function
normalizeResources
(): void
29
{
30
$this->normalizedResources = $this->resources->getNormalized();
31
$this->
normalizeLangResources
();
32
}
33
34
protected
function
normalizeLangResources
(): void
35
{
36
$langResources = $this->normalizedResources[
Types::TYPE_LANG
] ??
null
;
37
if
(!empty($langResources))
38
{
39
// convert array to string (get first element)
40
$this->normalizedResources[
Types::TYPE_LANG
] = $this->normalizedResources[
Types::TYPE_LANG
][0];
41
42
// other files load by additional lang
43
if
($additionalLang = self::loadAdditionalLangPhrases(array_slice($langResources, 1)))
44
{
45
$this->normalizedResources[
Types::TYPE_LANG_ADDITIONAL
] = $additionalLang;
46
}
47
}
48
}
49
50
protected
static
function
loadAdditionalLangPhrases
(
array
$langResources):
array
51
{
52
$additionalLangPhrases = [];
53
foreach
($langResources as $file)
54
{
55
foreach
(Loc::loadLanguageFile(
$_SERVER
[
'DOCUMENT_ROOT'
] . $file) as
$key
=> $phrase)
56
{
57
$additionalLangPhrases[
$key
] = $phrase;
58
}
59
}
60
61
return
$additionalLangPhrases;
62
}
63
}
Bitrix\Landing\Assets\StandartBuilder
Определения
standartbuilder.php:11
Bitrix\Landing\Assets\StandartBuilder\loadAdditionalLangPhrases
static loadAdditionalLangPhrases(array $langResources)
Определения
standartbuilder.php:50
Bitrix\Landing\Assets\StandartBuilder\normalizeResources
normalizeResources()
Определения
standartbuilder.php:28
Bitrix\Landing\Assets\StandartBuilder\normalizeLangResources
normalizeLangResources()
Определения
standartbuilder.php:34
Bitrix\Landing\Assets\StandartBuilder\setOutput
setOutput()
Определения
standartbuilder.php:15
Bitrix\Landing\Assets\Types\TYPE_LANG_ADDITIONAL
const TYPE_LANG_ADDITIONAL
Определения
types.php:11
Bitrix\Landing\Assets\Types\TYPE_LANG
const TYPE_LANG
Определения
types.php:10
Bitrix\Main\Web\WebPacker\Builder
Определения
builder.php:16
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$_SERVER
$_SERVER["DOCUMENT_ROOT"]
Определения
cron_frame.php:9
$key
if(empty($signedUserToken)) $key
Определения
quickway.php:257
bitrix
modules
landing
lib
assets
standartbuilder.php
Создано системой
1.14.0