本文整理汇总了PHP中CBPHelper::GetFieldInputValue方法的典型用法代码示例。如果您正苦于以下问题:PHP CBPHelper::GetFieldInputValue方法的具体用法?PHP CBPHelper::GetFieldInputValue怎么用?PHP CBPHelper::GetFieldInputValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBPHelper
的用法示例。
在下文中一共展示了CBPHelper::GetFieldInputValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetFieldInputValue
public static function GetFieldInputValue($parameterDocumentType, $fieldType, $fieldName, $arRequest, &$arErrors)
{
list($moduleId, $entity, $documentType) = CBPHelper::ParseDocumentId($parameterDocumentType);
if (strlen($moduleId) > 0) {
CModule::IncludeModule($moduleId);
}
if (is_array($fieldType)) {
$arFieldType = array("Type" => null, "Multiple" => false, "Required" => false, "Options" => null);
foreach ($fieldType as $key => $val) {
switch (strtoupper($key)) {
case "TYPE":
case "0":
$arFieldType["Type"] = strval($val);
break;
case "MULTIPLE":
case "1":
$arFieldType["Multiple"] = !$val || is_int($val) && $val == 0 || strtoupper($val) == "N" ? false : true;
break;
case "REQUIRED":
case "2":
$arFieldType["Required"] = !$val || is_int($val) && $val == 0 || strtoupper($val) == "N" ? false : true;
break;
case "OPTIONS":
case "3":
if (is_array($val)) {
$arFieldType["Options"] = $val;
}
break;
}
}
} else {
$arFieldType = array("Type" => strval($fieldType), "Multiple" => false, "Required" => false, "Options" => null);
}
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 (class_exists($entity)) {
if (method_exists($entity, "GetFieldInputValue")) {
return call_user_func_array(array($entity, "GetFieldInputValue"), array($documentType, $arFieldType, $arFieldName, $arRequest, &$arErrors));
}
if (method_exists($entity, "SetGUIFieldEdit")) {
return call_user_func_array(array($entity, "SetGUIFieldEdit"), array($documentType, $arFieldName["Field"], $arRequest, &$arErrors, $arFieldType));
}
}
return CBPHelper::GetFieldInputValue($parameterDocumentType, $arFieldType, $arFieldName, $arRequest, $arErrors);
}
示例2: GetFieldInputValue
public function GetFieldInputValue($parameterDocumentType, $fieldType, $fieldName, $arRequest, &$arErrors)
{
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 "";
}
$fieldTypeObject = $this->getFieldTypeObject($parameterDocumentType, $arFieldType);
if ($fieldTypeObject) {
return $fieldTypeObject->extractValue($arFieldName, $arRequest, $arErrors);
}
if (class_exists($entity)) {
if (method_exists($entity, "GetFieldInputValue")) {
return call_user_func_array(array($entity, "GetFieldInputValue"), array($documentType, $arFieldType, $arFieldName, $arRequest, &$arErrors));
}
if (method_exists($entity, "SetGUIFieldEdit")) {
return call_user_func_array(array($entity, "SetGUIFieldEdit"), array($documentType, $arFieldName["Field"], $arRequest, &$arErrors, $arFieldType));
}
}
return CBPHelper::GetFieldInputValue($parameterDocumentType, $arFieldType, $arFieldName, $arRequest, $arErrors);
}