Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
blocktype.php
1<?php
2
3
5
6
8{
9 const UNDEFINED = 0;
10
11 const SHIPMENT_STATUS = 1;
12 const SHIPMENT_BASKET = 2;
13 const FINANCE_INFO = 3;
14 const ADDITIONAL = 4;
15 const SHIPMENT = 5;
16 const PAYMENT = 6;
17 const STATUS = 7;
18 const BASKET = 8;
19 const BUYER = 9;
20 const INFO = 10;
21 const MARKER = 11;
22 const ANALYSIS = 12;
23 const DELIVERY = 13;
24 const DISCOUNT = 14;
25
26 const SHIPMENT_BASKET_NAME = "goodsList";
27 const SHIPMENT_STATUS_NAME = "shipmentStatus";
28 const FINANCE_INFO_NAME = "financeinfo";
29 const ADDITIONAL_NAME = "additional";
30 const SHIPMENT_NAME = "shipment";
31 const PAYMENT_NAME = "payment";
32 const STATUS_NAME = "statusorder";
33 const BASKET_NAME = "basket";
34 const BUYER_NAME = "buyer";
35 const INFO_NAME = "";
36 const MARKER_NAME = "";
37 const ANALYSIS_NAME = "analysis";
38 const DELIVERY_NAME = "delivery";
39 const DISCOUNT_NAME = "discount";
40
41 const FIRST_TYPE = 1;
42 const LAST_TYPE = 14;
43
44 public static function isDefined($typeId)
45 {
46 if(!is_int($typeId))
47 {
48 $typeId = (int)$typeId;
49 }
50
51 return $typeId >= self::FIRST_TYPE && $typeId <= self::LAST_TYPE;
52 }
53
54 public static function resolveId($name)
55 {
56 if($name == '')
57 {
58 return self::UNDEFINED;
59 }
60
61 switch($name)
62 {
68 return self::FINANCE_INFO;
70 return self::ADDITIONAL;
72 return self::SHIPMENT;
74 return self::PAYMENT;
76 return self::STATUS;
78 return self::BASKET;
80 return self::BUYER;
81 case self::INFO_NAME:
82 return self::INFO;
84 return self::MARKER;
86 return self::ANALYSIS;
88 return self::DELIVERY;
90 return self::DISCOUNT;
91
92 default:
93 return self::UNDEFINED;
94 }
95 }
96
97 public static function resolveName($typeId)
98 {
99 if(!is_numeric($typeId))
100 {
101 return '';
102 }
103
104 $typeId = intval($typeId);
105 if($typeId <= 0)
106 {
107 return '';
108 }
109
110 switch($typeId)
111 {
118 case self::ADDITIONAL:
120 case self::SHIPMENT:
121 return self::SHIPMENT_NAME;
122 case self::PAYMENT:
123 return self::PAYMENT_NAME;
124 case self::STATUS:
125 return self::STATUS_NAME;
126 case self::BASKET:
127 return self::BASKET_NAME;
128 case self::BUYER:
129 return self::BUYER_NAME;
130 case self::INFO :
131 return self::INFO_NAME;
132 case self::MARKER :
133 return self::MARKER_NAME;
134 case self::ANALYSIS :
135 return self::ANALYSIS_NAME;
136 case self::DELIVERY :
137 return self::DELIVERY_NAME;
138 case self::DISCOUNT:
139 return self::DISCOUNT_NAME;
140
141 case self::UNDEFINED:
142 default:
143 return '';
144 }
145 }
146}