- Модуль: webdav
- Путь к файлу: ~/bitrix/modules/webdav/classes/iblocksocnetbizproc.php
- Класс: CIBlockDocumentWebdavSocnet
- Вызов: CIBlockDocumentWebdavSocnet::GetFieldInputControl
static function GetFieldInputControl($documentType, $arFieldType, $arFieldName, $fieldValue, $bAllowSelection = false, $publicMode = false)
{
if($storage = self::needProxyToDiskByDocType($documentType))
{
return self::proxyToDisk(__FUNCTION__, array(BitrixDiskBizProcDocumentCompatible::generateDocumentType($storage->getId()), $arFieldType, $arFieldName, $fieldValue, $bAllowSelection, $publicMode));
}
static $arDocumentFieldTypes = array();
if (!array_key_exists($documentType, $arDocumentFieldTypes))
$arDocumentFieldTypes[$documentType] = self::GetDocumentFieldTypes($documentType);
$arFieldType["BaseType"] = "string";
$arFieldType["Complex"] = false;
if (array_key_exists($arFieldType["Type"], $arDocumentFieldTypes[$documentType]))
{
$arFieldType["BaseType"] = $arDocumentFieldTypes[$documentType][$arFieldType["Type"]]["BaseType"];
$arFieldType["Complex"] = $arDocumentFieldTypes[$documentType][$arFieldType["Type"]]["Complex"];
}
if (!is_array($fieldValue) || is_array($fieldValue) && CBPHelper::IsAssociativeArray($fieldValue))
$fieldValue = array($fieldValue);
ob_start();
if ($arFieldType["Type"] == "select")
{
$fieldValueTmp = $fieldValue;
?>
if ($bAllowSelection)
{
?>
_text" name="= $arFieldName["Field"] ?>_text" value="
if (count($fieldValueTmp) > 0)
{
$a = array_values($fieldValueTmp);
echo htmlspecialcharsbx($a[0]);
}
?>">
_text', 'select');">
}
}
elseif ($arFieldType["Type"] == "user")
{
$fieldValue = CBPHelper::UsersArrayToString($fieldValue, null, array("webdav", "CIBlockDocumentWebdavSocnet", $documentType));
?>" name="= $arFieldName["Field"] ?>" value="= htmlspecialcharsbx($fieldValue) ?>">', 'user');">
}
else
{
if (!array_key_exists("CBPVirtualDocumentCloneRowPrinted", $GLOBALS) && $arFieldType["Multiple"])
{
$GLOBALS["CBPVirtualDocumentCloneRowPrinted"] = 1;
?>
}
$customMethodName = "";
if (mb_strpos($arFieldType["Type"], ":") !== false)
{
$ar = CIBlockProperty::GetUserType(mb_substr($arFieldType["Type"], 2));
if (array_key_exists("GetPublicEditHTML", $ar))
$customMethodName = $ar["GetPublicEditHTML"];
}
if ($arFieldType["Multiple"])
echo '| '; if (is_array($customMethodName) && count($customMethodName) > 0 || !is_array($customMethodName) && $customMethodName <> '') { $value1 = $value; if ($bAllowSelection && preg_match("#^{=[a-z0-9_]+:[a-z0-9_]+}$#i", trim($value1))) $value1 = null; else unset($fieldValueTmp[$key]); echo call_user_func_array( $customMethodName, array( array("LINK_IBLOCK_ID" => $arFieldType["Options"]), array("VALUE" => $value1), array( "FORM_NAME" => $arFieldName["Form"], "VALUE" => $fieldNameName ), true ) ); } else { switch ($arFieldType["Type"]) { case "int": case "double": unset($fieldValueTmp[$key]); ?> break; case "file": if ($publicMode) { //unset($fieldValueTmp[$key]); ?> } break; case "bool": if (in_array($value, array("Y", "N"))) unset($fieldValueTmp[$key]); ?> break; case "text": unset($fieldValueTmp[$key]); ?> break; case "date": case "datetime": $v = ""; if (!preg_match("#^{=[a-z0-9_]+:[a-z0-9_]+}$#i", trim($value))) { $v = $value; unset($fieldValueTmp[$key]); } require_once($_SERVER["DOCUMENT_ROOT"].BX_ROOT."/modules/main/interface/init_admin.php"); echo CAdminCalendar::CalendarDate($fieldNameName, $v, 19, ($arFieldType["Type"] != "date")); break; default: unset($fieldValueTmp[$key]); ?> } } if ($bAllowSelection) { if (!in_array($arFieldType["Type"], array("file", "bool", "date", "datetime")) && (is_array($customMethodName) && count($customMethodName) <= 0 || !is_array($customMethodName) && $customMethodName == '')) { ?>');"> } } if ($arFieldType["Multiple"]) echo ' |
'; if ($bAllowSelection) { if (in_array($arFieldType["Type"], array("file", "bool", "date", "datetime")) || (is_array($customMethodName) && count($customMethodName) > 0 || !is_array($customMethodName) && $customMethodName <> '')) { ?> _text" name="= $arFieldName["Field"] ?>_text" value=" if (count($fieldValueTmp) > 0) { $a = array_values($fieldValueTmp); echo htmlspecialcharsbx($a[0]); } ?>"> _text', '= $arFieldType["BaseType"] ?>');"> } } } $s = ob_get_contents(); ob_end_clean(); return $s; }