Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
type.php
1<?php
2
4
6
7class Type
8{
9 // main.ui.grid constants
10 public const TEXT = 'text';
11 public const CHECKBOX = 'checkbox';
12 public const TAGS = 'tags';
13 public const LABELS = 'labels';
14 public const INT = 'int';
15 public const FLOAT = 'double';
16 public const NUMBER = 'number';
17 public const DATE = 'date';
18 public const DROPDOWN = 'list';
19 public const MULTISELECT = 'multiselect';
20 public const MONEY = 'money';
21 public const CUSTOM = 'custom';
22
23 // \CAdminListRow constants
24 public const INPUT = 'input';
25 public const CALENDAR = 'calendar';
26 public const SELECT = 'select';
27 public const FILE = 'file';
28 public const HTML = 'html';
29
36 public static function getEditorType(string $type): ?string
37 {
38 $result = null;
39
40 if ($type === '')
41 {
42 $type = self::TEXT;
43 }
44 switch ($type)
45 {
46 case self::TEXT:
47 case self::INPUT:
48 $result = Grid\Editor\Types::TEXT;
49 break;
50 case self::INT:
51 case self::FLOAT:
52 case self::NUMBER:
53 $result = Grid\Editor\Types::NUMBER;
54 break;
55 case self::CHECKBOX:
56 $result = Grid\Editor\Types::CHECKBOX;
57 break;
58 case self::DATE:
59 case self::CALENDAR:
60 $result = Grid\Editor\Types::DATE;
61 break;
62 case self::DROPDOWN:
63 case self::SELECT:
64 $result = Grid\Editor\Types::DROPDOWN;
65 break;
66 case self::MULTISELECT:
67 $result = Grid\Editor\Types::MULTISELECT;
68 break;
69 case self::MONEY:
70 $result = Grid\Editor\Types::MONEY;
71 break;
72 case self::FILE:
73 $result = Grid\Editor\Types::IMAGE;
74 break;
75 case self::HTML:
76 $result = Grid\Editor\Types::CUSTOM;
77 break;
78 }
79
80 return $result;
81 }
82}
static getEditorType(string $type)
Definition type.php:36