CBPDocumentService::GetFieldInputControl: Bitrix method

      
<?php 
//  CBPDocumentService :: GetFieldInputControl()
//  /dist/bitrix/modules/bizproc/classes/general/documentservice.php:751

    
public function GetFieldInputControl($parameterDocumentType$fieldType$fieldName$fieldValue$bAllowSelection false$publicMode false)
    {
        list(
$moduleId$entity$documentType) = CBPHelper::ParseDocumentId($parameterDocumentType);

        if (
strlen($moduleId) > 0)
            
CModule::IncludeModule($moduleId);

        
$arFieldType FieldType::normalizeProperty($fieldType);
        if ((string) 
$arFieldType["Type"] == "")
            return 
"";

        if (
is_array($fieldName))
        {
            
$arFieldName = array(
                
'Form' => null,
                
'Field' => null,
            );
            foreach (
$fieldName as $key => $val)
            {
                switch (
strtoupper($key))
                {
                    case 
"FORM":
                    case 
"0":
                        
$arFieldName["Form"] = $val;
                        break;
                    case 
"FIELD":
                    case 
"1":
                        
$arFieldName["Field"] = $val;
                        break;
                }
            }
        }
        else
        {
            
$arFieldName = array("Form" => null"Field" => $fieldName);
        }
        if ((string) 
$arFieldName["Field"] == "" || preg_match("#[^a-z0-9_\[\]]#i"$arFieldName["Field"]))
            return 
"";
        if ((string) 
$arFieldName["Form"] != "" && preg_match("#[^a-z0-9_]#i"$arFieldName["Form"]))
            return 
"";

        if (
$publicMode && !array_key_exists("BP_AddShowParameterInit_".$moduleId."_".$entity."_".$documentType$GLOBALS))
        {
            
$GLOBALS["BP_AddShowParameterInit_".$moduleId."_".$entity."_".$documentType] = 1;
            
CBPDocument::AddShowParameterInit($moduleId"only_users"$documentType$entity);
        }

        
$fieldTypeObject $this->getFieldTypeObject($parameterDocumentType$arFieldType);
        if (
$fieldTypeObject)
        {
            
$renderMode $publicMode FieldType::RENDER_MODE_public FieldType::RENDER_MODE_DESIGNER;
            if (
defined('ADMIN_SECTION') && ADMIN_SECTION)
            {
                
$renderMode |= FieldType::RENDER_MODE_ADMIN;
                
$renderMode &= ~FieldType::RENDER_MODE_PUBLIC;
            }

            if (
defined('BX_MOBILE') && BX_MOBILE)
            {
                
$renderMode |= FieldType::RENDER_MODE_MOBILE;
            }

            if (
$renderMode FieldType::RENDER_MODE_PUBLIC)
            {
                
CUtil::InitJSCore(['bp_field_type']);
            }

            return 
$fieldTypeObject->renderControl($arFieldName$fieldValue$bAllowSelection$renderMode);
        }

        if (
class_exists($entity))
        {
            if (
method_exists($entity"GetFieldInputControl"))
                return 
call_user_func_array(array($entity"GetFieldInputControl"), array($documentType$arFieldType$arFieldName$fieldValue$bAllowSelection$publicMode));

            if (
method_exists($entity"GetGUIFieldEdit"))
                return 
call_user_func_array(array($entity"GetGUIFieldEdit"), array($documentType$arFieldName["Form"], $arFieldName["Field"], $fieldValue$arFieldType$bAllowSelection));
        }

        return 
CBPHelper::GetFieldInputControl($parameterDocumentType$arFieldType$arFieldName$fieldValue$bAllowSelection);
    }