当前位置: 首页>>代码示例>>PHP>>正文


PHP CBPHelper::GetFieldInputControl方法代码示例

本文整理汇总了PHP中CBPHelper::GetFieldInputControl方法的典型用法代码示例。如果您正苦于以下问题:PHP CBPHelper::GetFieldInputControl方法的具体用法?PHP CBPHelper::GetFieldInputControl怎么用?PHP CBPHelper::GetFieldInputControl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CBPHelper的用法示例。


在下文中一共展示了CBPHelper::GetFieldInputControl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: GetFieldInputControl

 public static function GetFieldInputControl($parameterDocumentType, $fieldType, $fieldName, $fieldValue, $bAllowSelection = false, $publicMode = false)
 {
     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":
                     $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 ($publicMode && !array_key_exists("BP_AddShowParameterInit_" . $moduleId . "_" . $entity . "_" . $documentType, $GLOBALS)) {
         $GLOBALS["BP_AddShowParameterInit_" . $moduleId . "_" . $entity . "_" . $documentType] = 1;
         CBPDocument::AddShowParameterInit($moduleId, "only_users", $documentType, $entity);
     }
     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);
 }
开发者ID:rasuldev,项目名称:torino,代码行数:71,代码来源:documentservice.php

示例2: GetFieldInputControl

 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 ? 0 : FieldType::RENDER_MODE_DESIGNER;
         if (defined('ADMIN_SECTION') && ADMIN_SECTION) {
             $renderMode = $renderMode | FieldType::RENDER_MODE_ADMIN;
         }
         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);
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:55,代码来源:documentservice.php


注:本文中的CBPHelper::GetFieldInputControl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。