12 MODE_ADMIN_SETTINGS =
'main.admin_settings',
13 MODE_EDIT_FORM =
'main.edit_form',
14 MODE_FILTER_HTML =
'main.filter_html',
15 MODE_ADMIN_LIST_VIEW_HTML =
'main.admin_list_view_html',
16 MODE_ADMIN_LIST_EDIT_HTML =
'main.admin_list_edit_html',
17 MODE_PUBLIC_TEXT =
'main.public_text';
28 return array_merge(static::getBaseUserTypeDescription(), static::getDescription());
45 'USER_TYPE_ID' => static::USER_TYPE_ID,
46 'CLASS_NAME' => static::class,
47 'EDIT_CALLBACK' => [static::class,
'renderEdit'],
48 'VIEW_CALLBACK' => [static::class,
'renderView'],
49 'USE_FIELD_COMPONENT' =>
true,
58 public static function renderField(array $userField, ?array $additionalParameters = []): string
60 return self::getHtml($userField, $additionalParameters);
75 public static function renderView(array $userField, ?array $additionalParameters = []): string
78 return self::getHtml($userField, $additionalParameters);
92 public static function renderEdit(array $userField, ?array $additionalParameters = []): string
95 return self::getHtml($userField, $additionalParameters);
108 public static function renderSettings($userField, ?array $additionalParameters, $varsFromForm): string
110 $additionalParameters[
'mode'] = self::MODE_ADMIN_SETTINGS;
111 $additionalParameters[
'bVarsFromForm'] = $varsFromForm;
112 return self::getHtml($userField, $additionalParameters);
126 public static function renderEditForm(array $userField, ?array $additionalParameters): string
128 $additionalParameters[
'mode'] = self::MODE_EDIT_FORM;
129 $userField[
'USE_COMPONENT'] =
'Y';
130 return self::getHtml($userField, $additionalParameters);
145 $additionalParameters[
'mode'] = self::MODE_ADMIN_LIST_VIEW_HTML;
146 return self::getHtml($userField, $additionalParameters);
160 $additionalParameters[
'mode'] = self::MODE_ADMIN_LIST_EDIT_HTML;
161 return self::getHtml($userField, $additionalParameters);
174 public static function renderFilter(array $userField, ?array $additionalParameters): string
176 $additionalParameters[
'mode'] = self::MODE_FILTER_HTML;
177 return self::getHtml($userField, $additionalParameters);
186 $additionalParameters = [];
187 $additionalParameters[
'mode'] = self::MODE_PUBLIC_TEXT;
188 return self::getHtml($userField, $additionalParameters);
196 private static function getHtml($userField, $additionalParameters): string
200 $APPLICATION->IncludeComponent(
201 self::getComponentName(),
204 'userField' => $userField,
205 'additionalParameters' => $additionalParameters,
208 return ob_get_clean();
216 private static function getComponentName(): string
218 if (str_contains(static::RENDER_COMPONENT,
':'))
220 return static::RENDER_COMPONENT;
222 return 'bitrix:' . static::RENDER_COMPONENT;
231 public static function getSettingsHtml($userField, ?array $additionalParameters, $varsFromForm): string
233 return static::renderSettings($userField, $additionalParameters, $varsFromForm);
241 public static function getPublicView(array $userField, ?array $additionalParameters = []): string
243 return static::renderView($userField, $additionalParameters);
251 public static function getPublicEdit(array $userField, ?array $additionalParameters = []): string
253 return static::renderEdit($userField, $additionalParameters);
261 public static function getEditFormHtml(array $userField, ?array $additionalParameters): string
263 return static::renderEditForm($userField, $additionalParameters);
273 return static::renderAdminListView($userField, $additionalParameters);
283 return static::renderAdminListEdit($userField, $additionalParameters);
291 public static function getFilterHtml(array $userField, ?array $additionalParameters): string
293 return static::renderFilter($userField, $additionalParameters);
302 return static::renderText($userField);
310 public static function getDefaultValue(array $userField, array $additionalParameters = [])
312 $value = ($userField[
'SETTINGS'][
'DEFAULT_VALUE'] ??
null);
313 return ($userField[
'MULTIPLE'] ===
'Y' ? [$value] : $value);
static getUserTypeDescription()
static isMultiplicitySupported()
static renderAdminListEdit(array $userField, ?array $additionalParameters)
static getPublicEdit(array $userField, ?array $additionalParameters=[])
static renderEdit(array $userField, ?array $additionalParameters=[])
static getDefaultValue(array $userField, array $additionalParameters=[])
static getAdminListEditHTML(array $userField, ?array $additionalParameters)
static getBaseUserTypeDescription()
static renderEditForm(array $userField, ?array $additionalParameters)
static getEditFormHtml(array $userField, ?array $additionalParameters)
static getAdminListViewHtml(array $userField, ?array $additionalParameters)
static renderText(array $userField)
static renderField(array $userField, ?array $additionalParameters=[])
static getSettingsHtml($userField, ?array $additionalParameters, $varsFromForm)
static renderView(array $userField, ?array $additionalParameters=[])
static renderSettings($userField, ?array $additionalParameters, $varsFromForm)
static getFilterHtml(array $userField, ?array $additionalParameters)
static renderFilter(array $userField, ?array $additionalParameters)
static getPublicText(array $userField)
static getPublicView(array $userField, ?array $additionalParameters=[])
static renderAdminListView(array $userField, ?array $additionalParameters)
static isMandatorySupported()