- Модуль: bizproc
- Путь к файлу: ~/bitrix/modules/bizproc/lib/usertype/mailsender.php
- Класс: BitrixBizprocUserTypeMailSender
- Вызов: MailSender::renderControl
static function renderControl(FieldType $fieldType, array $field, $value, $allowSelection, $renderMode)
{
$providers = static::getMailboxList();
$fieldName = htmlspecialcharsbx(static::generateControlName($field));
$isPublicControl = $renderMode & FieldType::RENDER_MODE_PUBLIC;
$typeValue = $value;
if (is_array($typeValue))
{
$typeValue = (string)current($value);
}
$valueHtml = htmlspecialcharsbx((string)$typeValue);
$nodeAttributes = '';
if ($allowSelection && $isPublicControl)
{
$nodeAttributes = sprintf(
'data-role="inline-selector-target" data-select-mode="replace" data-property="%s" ',
htmlspecialcharsbx(MainWebJson::encode($fieldType->getProperty()))
);
}
if (!$isPublicControl)
{
$nodeAttributes .= 'style="opacity: 1" ';
}
$controlId = htmlspecialcharsbx(static::generateControlId($field));
$className = htmlspecialcharsbx(static::generateControlClassName($fieldType, $field));
$placeholder = htmlspecialcharsbx(Loc::getMessage('BP_FIELDTYPE_MAIL_SENDER_AUTO'));
$node = <<
HTML;
if ($allowSelection && !$isPublicControl)
{
$node .= static::renderControlSelectorButton($controlId, $fieldType, 'replace');
}
return $node . static::getJs($providers, $controlId);
}