1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
standartbuilder.php
См. документацию.
1<?php
2
3namespace Bitrix\Landing\Assets;
4
5use Bitrix\Main\Localization\Loc;
6
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();
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}
static loadAdditionalLangPhrases(array $langResources)
Определения standartbuilder.php:50
const TYPE_LANG_ADDITIONAL
Определения types.php:11
const TYPE_LANG
Определения types.php:10
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$_SERVER["DOCUMENT_ROOT"]
Определения cron_frame.php:9
if(empty($signedUserToken)) $key
Определения quickway.php:257