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


PHP CForm::isFieldInTemplate方法代码示例

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


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

示例1: array

 }
 // access rights
 $arFields["arGROUP"] = array();
 foreach ($arGroups as $arrG) {
     $arFields["arGROUP"][$arrG["ID"]] = $_REQUEST["PERMISSION_" . $arrG["ID"]];
 }
 $res = intval(CForm::Set($arFields, $ID));
 if ($res > 0) {
     if ($bEditTemplate && $USE_DEFAULT_TEMPLATE == "N") {
         // structure
         $FORM_STRUCTURE = $_REQUEST["FORM_STRUCTURE"];
         $arrFS = CheckSerializedData($FORM_STRUCTURE) ? unserialize($FORM_STRUCTURE) : array();
         if (CFormOutput::CheckTemplate($FORM_TEMPLATE, $arrFS)) {
             $GLOBALS['CACHE_MANAGER']->ClearByTag('form_' . $res);
             foreach ($arrFS as $arQuestion) {
                 $arQuestionFields = array("FORM_ID" => $res, "TITLE" => $arQuestion["CAPTION_UNFORM"], "TITLE_TYPE" => $arQuestion["isHTMLCaption"] == "N" ? "text" : "html", "SID" => $arQuestion["FIELD_SID"], "REQUIRED" => $arQuestion["isRequired"] == "N" ? "N" : "Y", "IN_RESULTS_TABLE" => $arQuestion["inResultsTable"] == "Y" ? "Y" : "N", "IN_EXCEL_TABLE" => $arQuestion["inExcelTable"] == "Y" ? "Y" : "N", "ACTIVE" => CForm::isFieldInTemplate($arQuestion["FIELD_SID"], $FORM_TEMPLATE) ? "Y" : "N", 'FILTER_TITLE' => $arQuestion['FILTER_TITLE']);
                 $FIELD_ID = $arQuestion["isNew"] == "Y" ? false : $arQuestion["ID"];
                 $QID = CFormField::Set($arQuestionFields, $FIELD_ID, 'Y', 'N');
                 if ($QID) {
                     foreach ($arQuestion["structure"] as $arAnswer) {
                         if (strlen($arAnswer["MESSAGE"]) <= 0) {
                             if ($arAnswer['ANS_NEW'] != 'Y' && in_array($arAnswer['FIELD_TYPE'], array('dropdown', 'multiselect', 'checkbox', 'radio'))) {
                                 CFormAnswer::Delete($arAnswer['ID'], $QID);
                             }
                             continue;
                         }
                         if (isset($arAnswer['DEFAULT'])) {
                             if ($arAnswer["FIELD_TYPE"] == "dropdown" || $arAnswer['FIELD_TYPE'] == "multiselect") {
                                 if ($arAnswer["DEFAULT"] == "Y") {
                                     $arAnswer["FIELD_PARAM"] = "SELECTED";
                                 } else {
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:form_edit.php

示例2: CheckTemplate

 public static function CheckTemplate($FORM_TEMPLATE, &$arrFS)
 {
     if (count($arrFS) > 0) {
         $arFldSIDs = array();
         $arInactiveFldSIDs = array();
         $str = "";
         foreach ($arrFS as $key => $arField) {
             $cur_str = "";
             if (strlen(trim($arField["FIELD_SID"])) <= 0) {
                 $cur_str .= GetMessage("FORM_ERROR_FORGOT_SID") . "<br>";
             } elseif (preg_match("/[^A-Za-z_01-9]/", $arField["FIELD_SID"])) {
                 $cur_str .= GetMessage("FORM_ERROR_INCORRECT_SID") . "<br>";
             } elseif (in_array($arField['FIELD_SID'], $arFldSIDs)) {
                 $key = array_search($arField['FIELD_SID'], $arInactiveFldSIDs);
                 if ($key) {
                     unset($arrFS[$key]);
                     unset($arInactiveFldSIDs[$key]);
                     unset($arFldSIDs[$key]);
                 } else {
                     $s = str_replace("#TYPE#", GetMessage("FORM_TYPE_FIELD"), GetMessage("FORM_ERROR_WRONG_SID"));
                     $s = str_replace("#ID#", $zr["ID"], $s);
                     $cur_str .= $s . "<br>";
                 }
             } else {
                 $arFldSIDs[$key] = $arField["FIELD_SID"];
                 if (!CForm::isFieldInTemplate($arField["FIELD_SID"], $FORM_TEMPLATE)) {
                     $arInactiveFldSIDs[$key] = $arField["FIELD_SID"];
                 }
             }
             if (!empty($cur_str)) {
                 $str .= $cur_str;
             }
         }
         if (!empty($str)) {
             $_GLOBALS["strError"] .= $str;
             return false;
         } else {
             return true;
         }
     }
     return true;
 }
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:42,代码来源:form_callformoutput.php

示例3: CheckSerializedData

			$arrFS = CheckSerializedData($FORM_STRUCTURE) ? unserialize($FORM_STRUCTURE) : array();

			if (CFormOutput::CheckTemplate($FORM_TEMPLATE, $arrFS))
			{
				$GLOBALS['CACHE_MANAGER']->ClearByTag('form_'.$res);
				foreach ($arrFS as $arQuestion)
				{
					$arQuestionFields = array(
						"FORM_ID" 	 => $res,
						"TITLE" 	 => $arQuestion["CAPTION_UNFORM"],
						"TITLE_TYPE" => $arQuestion["isHTMLCaption"] == "N" ? "text" : "html",
						"SID" 		 => $arQuestion["FIELD_SID"],
						"REQUIRED" 	 => $arQuestion["isRequired"] == "N" ? "N" : "Y",
						"IN_RESULTS_TABLE" => $arQuestion["inResultsTable"] == "Y" ? "Y" : "N",
						"IN_EXCEL_TABLE" => $arQuestion["inExcelTable"] == "Y" ? "Y" : "N",
						"ACTIVE"	 => CForm::isFieldInTemplate($arQuestion["FIELD_SID"], $FORM_TEMPLATE) ? "Y" : "N",
						'FILTER_TITLE' => $arQuestion['FILTER_TITLE'],
					);

					$FIELD_ID = $arQuestion["isNew"] == "Y" ? false : $arQuestion["ID"];

					$QID = CFormField::Set($arQuestionFields, $FIELD_ID, 'Y', 'N');

					if ($QID)
					{
						foreach ($arQuestion["structure"] as $arAnswer)
						{
							if (strlen($arAnswer["MESSAGE"]) <= 0)
							{
								if (
									$arAnswer['ANS_NEW'] != 'Y'
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:31,代码来源:form_edit.php


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