File :: renderControl: Bitrix method

      
<?php 
//  Bitrix\Bizproc\BaseType\File :: renderControl()
//  /dist/bitrix/modules/bizproc/lib/basetype/file.php:158

    
protected static function renderControl(FieldType $fieldType, array $field$value$allowSelection$renderMode)
    {
        if (
$renderMode FieldType::RENDER_MODE_DESIGNER)
        {
            return 
'';
        }

        
$classNameHtml htmlspecialcharsbx(static::generateControlClassName($fieldType$field));
        
$idHtml htmlspecialcharsbx(static::generateControlId($field));
        
$nameHtml htmlspecialcharsbx(static::generateControlName($field));

        if (
$renderMode FieldType::RENDER_MODE_PUBLIC)
        {
            
$msg htmlspecialcharsbx(Loc::getMessage('BPDT_FILE_CHOOSE_FILE'));
            
$onchange 'this.nextSibling.textContent = BX.Bizproc.FieldType.File.parseLabel(this.value);';
            
$onchange htmlspecialcharsbx($onchange);

            return <<<HTML
                <div class="{$classNameHtml}">
                    <span>
                        <span class="webform-small-button">
{$msg}</span>
                    </span>
                    <input type="file" id="
{$idHtml}" name="{$nameHtml}" onchange="{$onchange}">
                    <span class="bizproc-type-control-file-label"></span>
                </div>
HTML;
        }

        return 
'<input type="file" class="'.$classNameHtml.'" id="'.$idHtml.'" name="'.$nameHtml.'">';
    }