1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
typemanager.php
См. документацию.
1<?php
2
3namespace Bitrix\Conversion\Internals;
4
5use Bitrix\Conversion\Config;
6use Bitrix\Main\EventManager;
7use Bitrix\Main\SystemException;
8
10abstract class TypeManager
11{
13 static public function getTypesInternal()
14 {
15 if (! $types =& static::$types)
16 {
17 $event = static::$event;
18 $checkModule = static::$checkModule;
19
20 foreach (EventManager::getInstance()->findEventHandlers('conversion', $event) as $handler)
21 {
22 $result = ExecuteModuleEventEx($handler);
23
24 if (! is_array($result))
25 throw new SystemException('Not array returned from: '.print_r($handler, true));
26
27 foreach ($result as $name => $type)
28 {
29 if (! is_array($type))
30 throw new SystemException('Not array in: '.$event.'()['.$name.'] => '.print_r($handler, true));
31
32 if ($checkModule)
33 {
34 if (! $type['MODULE'])
35 throw new SystemException('No [MODULE] in: '.$event.'()['.$name.'] => '.print_r($handler, true));
36 }
37
38 if (isset($types[$name]))
39 throw new SystemException('Duplicate in: '.$event.'()['.$name.'] => '.print_r($handler, true));
40
41 $types[$name] = $type;
42 }
43 }
44 }
45
46 return $types;
47 }
48
49 static public function getTypes(array $filter = null)
50 {
51 if (! $types =& static::$types)
52 {
53 static::getTypesInternal();
54 }
55
56 if (! static::$ready)
57 {
58 static::$ready = true;
59
60 uasort($types, function ($a, $b)
61 {
62 $a = $a['SORT'] ?? 0;
63 $b = $b['SORT'] ?? 0;
64
65 return $a < $b ? -1 : ($a > $b ? 1 : 0);
66 });
67
68 if (static::$checkModule)
69 {
70 $modules = Config::getModules();
71 foreach ($types as & $type)
72 {
73 $module = $modules[$type['MODULE']];
74 $type['ACTIVE'] = $module && $module['ACTIVE'];
75 }
76 unset($type);
77 }
78 }
79
80 if ($filter)
81 {
83
84 return array_filter($types, function (array $type) use ($count, $filter)
85 {
86 return $count == count(array_intersect_assoc($filter, $type));
87 });
88 }
89 else
90 {
91 return $types;
92 }
93 }
94
96 static public function isTypeActive($name)
97 {
98 $types = static::getTypes();
99 $type = $types[$name];
100 return $type && $type['ACTIVE'];
101 }
102}
$count
Определения admin_tab.php:4
$type
Определения options.php:106
static getTypes(array $filter=null)
Определения typemanager.php:49
static isTypeActive($name)
Определения typemanager.php:96
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
$filter
Определения iblock_catalog_list.php:54
$modules
Определения bitrix.php:26
ExecuteModuleEventEx($arEvent, $arParams=[])
Определения tools.php:5214
$name
Определения menu_edit.php:35
$event
Определения prolog_after.php:141
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
Определения waybill.php:936
else $a
Определения template.php:137