Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
usergroups.php
1<?php
2
11
14
16{
17 private const GROUP_PREFIX = 'A';
18
19 public function loadAll()
20 {
21 return parent::loadAll(); // TODO: Change the autogenerated stub
22 }
23
24 public function search()
25 {
26 $result = [
27 'ITEMS' => [],
28 'ADDITIONAL_INFO' => []
29 ];
30
31 return $result;
32 }
33
34 public function getData($params = [])
35 {
36 $entityType = Handler::ENTITY_TYPE_GROUP;
37
38 $result = [
39 'ITEMS' => [],
40 'ITEMS_LAST' => [],
41 'ITEMS_HIDDEN' => [],
42 'ADDITIONAL_INFO' => [
43 'GROUPS_LIST' => [
44 'usergroups' => [
45 'TITLE' => Loc::getMessage('MAIN_UI_SELECTOR_TITLE_SONETGROUPS'),
46 'TYPE_LIST' => [$entityType],
47 'DESC_LESS_MODE' => 'Y',
48 'SORT' => 20
49 ]
50 ],
51 'PREFIX' => self::GROUP_PREFIX,
52 'SORT_SELECTED' => 300
53 ]
54 ];
55
56 $options = (!empty($params['options']) ? $params['options'] : []);
57
58 $lastItems = (!empty($params['lastItems']) ? $params['lastItems'] : []);
59 $selectedItems = (!empty($params['selectedItems']) ? $params['selectedItems'] : []);
60
61 $result['ITEMS'][AccessCode::ACCESS_DIRECTOR . '0'] = [
62 "id" => AccessCode::ACCESS_DIRECTOR . '0',
63 "entityId" => 0,
64 "name" => Loc::getMessage('MAIN_UI_SELECTOR_DIRECTOR_NAME'),
65 "desc" => Loc::getMessage('MAIN_UI_SELECTOR_DIRECTOR_DESCRIPTION')
66 ];
67 $result['ITEMS'][AccessCode::ACCESS_EMPLOYEE . '0'] = [
68 "id" => AccessCode::ACCESS_EMPLOYEE . '0',
69 "entityId" => 0,
70 "name" => Loc::getMessage('MAIN_UI_SELECTOR_EMPLOYEE_NAME'),
71 "desc" => Loc::getMessage('MAIN_UI_SELECTOR_EMPLOYEE_DESCRIPTION')
72 ];
73
74 if (!empty($lastItems[$entityType])) {
75 $result["ITEMS_LAST"] = array_values($lastItems[$entityType]);
76 }
77
78 return $result;
79 }
80
81 public function getTabList($params = [])
82 {
83 $result = [];
84
85 $options = (!empty($params['options']) ? $params['options'] : []);
86
87 if (
88 isset($options['addTab'])
89 && $options['addTab'] == 'Y'
90 ) {
91 $result = array(
92 array(
93 'id' => 'usergroups',
94 'name' => Loc::getMessage('MAIN_UI_SELECTOR_TAB_USERGROUPS'),
95 'sort' => 20
96 )
97 );
98 }
99
100 return $result;
101 }
102}
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29