3namespace Bitrix\Main\UserField\Types;
5use Bitrix\Main\Localization\Loc;
6use Bitrix\Main\ORM\Fields\BooleanField;
9Loc::loadMessages(__FILE__);
32 'DESCRIPTION' => Loc::getMessage(
'USER_TYPE_BOOL_DESCRIPTION'),
33 'BASE_TYPE' => CUserTypeManager::BASE_TYPE_INT,
53 $label = ($userField[
'SETTINGS'][
'LABEL'] ?? [
'',
'']);
55 if($label[0] === Loc::getMessage(
'MAIN_NO'))
59 if($label[1] === Loc::getMessage(
'MAIN_YES'))
64 $labelCheckbox = ($userField[
'SETTINGS'][
'LABEL_CHECKBOX'] ??
'');
65 if($labelCheckbox === Loc::getMessage(
'MAIN_YES'))
70 $def = (int)($userField[
'SETTINGS'][
'DEFAULT_VALUE'] ?? 0);
76 $disp = ($userField[
'SETTINGS'][
'DISPLAY'] ??
'');
77 if($disp !==
'CHECKBOX' && $disp !==
'RADIO' && $disp !==
'DROPDOWN')
83 'DEFAULT_VALUE' =>
$def,
88 'LABEL_CHECKBOX' => $labelCheckbox,
98 $label = [Loc::getMessage(
'MAIN_NO'),
GetMessage(
'MAIN_YES')];
99 if(isset($userField[
'SETTINGS'][
'LABEL']) && is_array($userField[
'SETTINGS'][
'LABEL']))
101 foreach($label as
$key => $value)
103 if($userField[
'SETTINGS'][
'LABEL'][
$key] <>
'')
105 $label[
$key] = $userField[
'SETTINGS'][
'LABEL'][
$key];
121 'id' => $additionalParameters[
'ID'],
122 'name' => $additionalParameters[
'NAME'],
125 'Y' => Loc::getMessage(
'MAIN_YES'),
126 'N' => Loc::getMessage(
'MAIN_NO')
153 $reflection = new \ReflectionClass(__CLASS__);
154 $constants = $reflection->getConstants();
156 foreach($constants as
$name => $value)
158 if(str_starts_with(
$name,
'DISPLAY_'))
168 return parent::renderAdminListView($userField, $additionalParameters);
188 $fieldParameters[
'values'] = [0, 1];
190 $field = (
new BooleanField($fieldName, $fieldParameters))
191 ->configureNullable();
static getConnection($name="")
static isMultiplicitySupported()
static getAdminListViewHtmlMulty(array $userField, ?array $additionalParameters)
static getLabels(array $userField)
static getFilterData(array $userField, array $additionalParameters)
static onBeforeSave($userField, $value)
static checkFields(array $userField, $value)
static getEntityField($fieldName, $fieldParameters)
static prepareSettings(array $userField)
static isMandatorySupported()
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
GetMessage($name, $aReplace=null)
if(empty($signedUserToken)) $key
foreach($arTemplatesList as $templ) if(mb_strpos($templ["NAME"] $def