Subversion Repositories php-qbpwcf

Rev

Rev 3 | Rev 66 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3 Rev 30
Line 1671... Line 1671...
1671
	#$conf["checkedVarName"]=array();
1671
	#$conf["checkedVarName"]=array();
1672
	#$conf["canBeEmptyString"],字串,用$conf["checkedVarName"]指定接收的變數名稱陣列,若接收到的內容為空字串是否算有接收到內容,預設為"false","true"代表接收到的內容可以為空字串,"false"代表接收到的內容不可以為空字串.
1672
	#$conf["canBeEmptyString"],字串,用$conf["checkedVarName"]指定接收的變數名稱陣列,若接收到的內容為空字串是否算有接收到內容,預設為"false","true"代表接收到的內容可以為空字串,"false"代表接收到的內容不可以為空字串.
1673
	#$conf["canBeEmptyString"]="false";
1673
	#$conf["canBeEmptyString"]="false";
1674
	#$conf["sessionNameArray"],陣列,若存在則代表若沒有從表單取得變數,則從session變數中取得內容,每個元素代表每個表單變數對應的session名稱,若不是要改用session方式取得變數內容的變數,請輸入null,數量請跟$conf["checkedVarName"]參數一致.
1674
	#$conf["sessionNameArray"],陣列,若存在則代表若沒有從表單取得變數,則從session變數中取得內容,每個元素代表每個表單變數對應的session名稱,若不是要改用session方式取得變數內容的變數,請輸入null,數量請跟$conf["checkedVarName"]參數一致.
1675
	#$conf["sessionNameArray"]=array();
1675
	#$conf["sessionNameArray"]=array();
1676
	#$conf["unsetSessionArray"],陣列,與$conf["sessionNameArray"]對應的元素,是否要接收到變數後就卸除,"true"代表要卸除,"false"代表不要卸除.
1676
	#$conf["unsetSessionArray"],陣列,與$conf["sessionNameArray"]對應的元素,是否要接收到變數後就卸除,"true"代表要卸除,預設為"false"代表不要卸除.
1677
	#$conf["unsetSessionArray"]=array();
1677
	#$conf["unsetSessionArray"]=array();
1678
	#$conf["recaptcha_url"],字串,有內容代表要檢查有無透過recaptcha於特定頁面網址認證過.
1678
	#$conf["recaptcha_url"],字串,有內容代表要檢查有無透過recaptcha於特定頁面網址認證過.
1679
	#$conf["recaptcha_url"]="";
1679
	#$conf["recaptcha_url"]="";
1680
	#參考資料:
1680
	#參考資料:
1681
	#foreach 的用法 -> http://php.net/manual/en/control-structures.foreach.php
1681
	#foreach 的用法 -> http://php.net/manual/en/control-structures.foreach.php
Line 4754... Line 4754...
4754
			$conf["dataFormId"]="";
4754
			$conf["dataFormId"]="";
4755
		
4755
		
4756
			}#else end	
4756
			}#else end	
4757
 
4757
 
4758
		#如果要 autocomplete
4758
		#如果要 autocomplete
4759
		if($conf["autocomplete"]==="on")
4759
		if($conf["autocomplete"]==="on"){
4760
		{
4760
		
4761
			#設置為 "autocomplete"
4761
			#設置為 "autocomplete"
4762
			$conf["autocomplete"]="autocomplete";
4762
			$conf["autocomplete"]="autocomplete";
4763
		
4763
		
4764
		}#if end
4764
			}#if end
4765
		
4765
		
4766
		#反之
4766
		#反之
4767
		else
4767
		else{
4768
		{
4768
		
4769
			#設置為空字串
4769
			#設置為空字串
4770
			$conf["autocomplete"]="";
4770
			$conf["autocomplete"]="";
4771
		
4771
		
4772
		}#else end
4772
			}#else end
4773
 
4773
 
4774
		#放置可以輸入文字的表單
4774
		#放置可以輸入文字的表單
4775
		$result["content"]=$result["content"]."<input ".$conf["id"]." type = \"text\" ".$conf["width"]." ".$conf["maxInputLength"]." name = ".$conf["name"]." id = ".$conf["name"]." ".$conf["value"]." ".$conf["readOnly"]." ".$conf["autoFocus"]." ".$conf["class"]." ".$conf["jsCustom"]." ".$conf["placeholder"]." ".$conf["autocomplete"]." ".$conf["required"]." ".$conf["dataFormId"]." >";
4775
		$result["content"]=$result["content"]."<input ".$conf["id"]." type = \"text\" ".$conf["width"]." ".$conf["maxInputLength"]." name = ".$conf["name"]." id = ".$conf["name"]." ".$conf["value"]." ".$conf["readOnly"]." ".$conf["autoFocus"]." ".$conf["class"]." ".$conf["jsCustom"]." ".$conf["placeholder"]." ".$conf["autocomplete"]." ".$conf["required"]." ".$conf["dataFormId"]." >";
4776
 
4776
 
4777
		#如果 $conf["formEnd"] 等於 "true"
4777
		#如果 $conf["formEnd"] 等於 "true"
Line 4832... Line 4832...
4832
 
4832
 
4833
		}#function inputText end
4833
		}#function inputText end
4834
	
4834
	
4835
	/*
4835
	/*
4836
	#函式說明:
4836
	#函式說明:
-
 
4837
	#可以輸入Email的輸入方框
-
 
4838
	#回傳結果:
-
 
4839
	#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
-
 
4840
	#$result["function"],當前執行的函數.
-
 
4841
	#$result["error"],錯誤訊息陣列.
-
 
4842
	#$result["content"],按鈕語法.
-
 
4843
	#必填參數:
-
 
4844
	#$conf["name"],字串,爲該文字輸入框的名稱,用於讓接收頁面讀取的名稱。
-
 
4845
	$conf["name"]="";
-
 
4846
	#$conf["readOnly"],字串,爲該文字框是否可以填寫資料,若要只能觀看不能填寫,那麼就必須將其值設爲"true",反之要設爲"false".
-
 
4847
	$conf["readOnly"]="false";
-
 
4848
	#可省略參數:
-
 
4849
	#$conf["width"],字串,爲文字框的外觀長度,預設為"100%".
-
 
4850
	#$conf["width"]="";
-
 
4851
	#$conf["maxInputLength"],字串,爲可輸入的最大位元長度,預設不限制.
-
 
4852
	#$conf["maxInputLength"]="";
-
 
4853
	#$conf["autoFocus"],字串,是否為將填寫的指標移到該表單,"true"代表要,預設為"false".
-
 
4854
	#$conf["autoFocus"]="";
-
 
4855
	#$conf["value"],字串,爲該文字框預設要顯示的文字,預設爲"".
-
 
4856
	#$conf["value"]="";
-
 
4857
	#$conf["class"],字串,爲要套用的css樣式,若省略,則會套用預設的 "__qbpwcf_inputTextCssStyle" 樣式,其屬性爲 "width:100%","font-size:30px"
-
 
4858
	#$conf["class"]="";
-
 
4859
	#$conf["classList"],字串陣列,為要使用的多個css class樣式,若有使用,則會取代"class"參數的設定.
-
 
4860
	#$conf["classList"]=array();
-
 
4861
	#$conf["jsActivitor"],字串,爲觸發js的條件,可以是"onChange"(已改變內容時)、"onClick"(按下按鈕時)、"onkeyup"(當鍵盤按下放開後)、"onmouseover"(當滑鼠移過去的時候)...,須搭配$conf["jsSubmitActionTarget"]參數。
-
 
4862
	#$conf["jsActivitor"]="";
-
 
4863
	#$conf["jsAction"],字串,爲該js是要做什麼,可以是"document.testForm.submit()"(傳送名爲testForm的表單內容)...,須搭配$conf["jsActivitor"]參數。
-
 
4864
	#$conf["jsAction"]="";
-
 
4865
	#$conf["trStart"],字串,爲是否要以<tr>開頭,"true"表示"是"。也可以看作新的一列開始,預設為"false".
-
 
4866
	#$conf["trStart"]="";
-
 
4867
	#$conf["tdStart"],字串,爲是否要以<td>開頭,"true"表示"是"。也可以看成列裏面的元素開始,預設為"false".
-
 
4868
	#$conf["tdStart"]="";
-
 
4869
	#$conf["formStart"],字串,爲是否要以<form>開頭,"true"表示"是",也可以看成表單的開始,預設為"false".
-
 
4870
	#$conf["formStart"]="";
-
 
4871
	#$conf["formAction"],字串,表單遞交的目的地,若$conf["formStart"]為"true",則該參數不能省略.
-
 
4872
	#$conf["formAction"]="";
-
 
4873
	#$conf["formName"],字串,爲該表單的名稱
-
 
4874
	#$conf["formName"]="";
-
 
4875
	#$conf["formMethod"],字串,爲傳輸的方法,若沒設定則預設爲post,其他可用的參數爲get。
-
 
4876
	#$conf["formMethod"]="";
-
 
4877
	#$conf["formTarget"],字串,為顯示的方式,若沒設定則預設爲"_self",其他可用的參數爲 "_blank"、"_parent"、"_top",也可以是iframe的名稱。
-
 
4878
	#$conf["formTarget"]="";
-
 
4879
	#$conf["tableStart"],字串,爲該表單是否要以<table>開始。"true"爲是,預設為"false".
-
 
4880
	#$conf["tableStart"]="";
-
 
4881
	#$conf["tableClass"],字串,表格要套用的css樣式,若爲"__withoutBorder"的話則套用無框線的預設樣式;若爲"__withBorder"的話,則爲有框線的預設樣式,預設為"__withoutBorder".
-
 
4882
	#$conf["tableClass"]="";
-
 
4883
	#$conf["formEnd"],字串,爲是否要以<form>結尾,"true"表示"是",也可以看成表單的結束,預設為"false".
-
 
4884
	#$conf["formEnd"]="true";
-
 
4885
	#$conf["tdEnd"],字串,爲是否要以</td>結尾,"true"表示"是"。也可以看成列裏面的元素結束,預設為"false".
-
 
4886
	#$conf["tdEnd"]="true";
-
 
4887
	#$conf["trEnd"],字串,爲是否要以</tr>結尾,"true"表示"是"。也可以看作該列結束,預設為"false".
-
 
4888
	#$conf["trEnd"]="true";
-
 
4889
	#$conf["tableEnd"],字串,爲該表單是否要以</table>結尾,"true"爲是,預設為"false".
-
 
4890
	#$conf["tableEnd"]="true";
-
 
4891
	#$conf["autocomplete"],字串,是否依據使用者過往輸入的記錄來提示可能要的輸入內容,"on"為啟用,"off"為停用,預設為"on".
-
 
4892
	#$conf["autocomplete"]="off";
-
 
4893
	#$conf["required"],字串,該欄位是否必填,"true"為必填,"false"為可留空,預設為"false".
-
 
4894
	#$conf["required"]="true";
-
 
4895
	#$conf["comment"],字串,輸入方框上面要放哪些註解文字,亦即用label來呈現,同時指定"for"屬性的數值為當前"input"標籤的id,意即參數"name"的內容.
-
 
4896
	#$conf["comment"]="";
-
 
4897
	#$conf["placeholder"],字串,當沒有內容時要顯示的內容.
-
 
4898
	#$conf["placeholder"]="";
-
 
4899
	#$conf["br"],字串,"true"代表最後要換行,預設為"false".
-
 
4900
	#$conf["br"]="true";
-
 
4901
	#$conf["p"],字串,"true"代表最後要空一行,預設為"false".
-
 
4902
	#$conf["p"]="true";
-
 
4903
	#$conf["id"],字串,該元素的id,預設不使用.
-
 
4904
	#$conf["id"]="";
-
 
4905
	#$conf["dataFormId"],字串,提供用於識別哪一張表單的data屬性名稱.
-
 
4906
	#$conf["dataFormId"]="";
-
 
4907
	#參考資料:
-
 
4908
	#https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input/email
-
 
4909
	#備註:
-
 
4910
	#無.
-
 
4911
	*/
-
 
4912
	public static function inputEmail(&$conf){
-
 
4913
	
-
 
4914
		#初始化要回傳的內容
-
 
4915
		$result=array();
-
 
4916
 
-
 
4917
		#設置當前執行的函數
-
 
4918
		$result["function"]=__FUNCTION__;
-
 
4919
 
-
 
4920
		#初始化content樣式內容
-
 
4921
		$result["content"]="";
-
 
4922
 
-
 
4923
		#如果 $conf 不為陣列
-
 
4924
		if(gettype($conf)!="array"){
-
 
4925
 
-
 
4926
			#設置執行失敗
-
 
4927
			$result["status"]="false";
-
 
4928
 
-
 
4929
			#設置執行錯誤訊息
-
 
4930
			$result["error"][]="\$conf變數須為陣列形態";
-
 
4931
 
-
 
4932
			#如果傳入的參數為 null
-
 
4933
			if($conf==null){
-
 
4934
 
-
 
4935
				#設置執行錯誤訊息
-
 
4936
				$result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
-
 
4937
 
-
 
4938
				}#if end
-
 
4939
 
-
 
4940
			#回傳結果
-
 
4941
			return $result;
-
 
4942
 
-
 
4943
			}#if end
-
 
4944
 
-
 
4945
		#函式說明:
-
 
4946
		#檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容。
-
 
4947
		#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
-
 
4948
		#$reuslt["error"],執行不正常結束的錯訊息陣列.
-
 
4949
		#$result["function"],當前執行的函式名稱.
-
 
4950
		#$result["argu"],設置給予的參數.
-
 
4951
		#$result["passed"],識別要檢查的全體變數是否存在以及型態是否正確的變數,"true"代表檢查全部通過;"false"代表檢查不通過
-
 
4952
		#$result[$shouldBeCheckedVarName]["varExist"],所檢查的變數是否存在,"false"代表不存在;"true"代表存在
-
 
4953
		#$result[$shouldBeCheckedVarName]["varType"],所檢查的變數型態是否正確,"false"代表錯誤;"true"代表正確
-
 
4954
		#$result[$shouldBeCheckedVarName]["error"],每個參數設定的錯誤訊息
-
 
4955
		#$result["shouldNotBeEmpty"],不應該為空字串或控陣列的變數.
-
 
4956
		#$result["argu"],字串陣列,目前輸入的參數名稱陣列.
-
 
4957
		#$result["legalVarName"],字串陣列,合法可用的參數名稱陣列.
-
 
4958
		#$result["notNeedVar"],字串陣列,多餘的參數名稱.
-
 
4959
		#必填寫的參數:
-
 
4960
		#$conf["varInput"],陣列變數,要檢查的陣列變數,請在要檢查的參數前面加上&,這樣變動的結果才能被套用。
-
 
4961
		$conf["variableCheck::checkArguments"]["varInput"]=&$conf;
-
 
4962
		#$conf["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
-
 
4963
		$conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
-
 
4964
		#可以省略的參數:
-
 
4965
		#$conf["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,元素數量需要跟"mustBeFilledVariableType"參數的元素數量一致,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
-
 
4966
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("name","readOnly");
-
 
4967
		#$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列,元素數量需要跟"mustBeFilledVariableName"參數的元素數量一致,例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double","resource","object"); , null代表不指定變數形態.
-
 
4968
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("string","string");
-
 
4969
		#$conf["canBeEmptyString"],字串,必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true",可以為空字串.
-
 
4970
		$conf["variableCheck::checkArguments"]["canBeEmptyString"]="false";
-
 
4971
		#$conf["canNotBeEmpty"],字串陣列,哪些必填參數的內容不得為空字串或空陣列,僅當$conf["canBeEmptyString"]為"true"時會生效.
-
 
4972
		#$conf["canNotBeEmpty"]=array();
-
 
4973
		#$conf["canBeEmpty"],字串陣列,哪些必填參數的內容可為空字串或空陣列,僅當$conf["canBeEmptyString"]為"false"時會生效.
-
 
4974
		#$conf["canBeEmpty"]=array();
-
 
4975
		#$conf["skipableVariableCanNotBeEmpty"],字串陣列,哪些可省略參數不可以為空字串或空陣列.
-
 
4976
		#$conf["skipableVariableCanNotBeEmpty"]=array();
-
 
4977
		#$conf["skipableVariableName"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
-
 
4978
		$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("width","maxInputLength","autoFocus","value","class","jsActivitor","jsAction","trStart","tdStart","formStart","formAction","formName","formMethod","formTarget","tableStart","tableClass","formEnd","tdEnd","trEnd","tableEnd","autocomplete","comment","placeholder","br","p","required","id","dataFormId","classList");
-
 
4979
		#$conf["skipableVariableType"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double");
-
 
4980
		$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("string","string","string","string","string","string","string","string","string","string","string","string","string","string","string","string","string","string","string","string","string","string","string","string","string","string","string","string","array");
-
 
4981
		#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,null與代表不指定,若預設值是參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
-
 
4982
		$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array(null,null,"false",null,"__qbpwcf_inputTextCssStyle",null,null,"false","false","false",null,null,"post","_self","false","__withoutBorder","false","false","false","false","on",null,null,"false","false","false",null,null,null);
-
 
4983
		#$conf["disallowAllSkipableVarIsEmpty"],字串,是否允許每個可省略參數都為空字串,預設為"true"允許,反之為"false".
-
 
4984
		#$conf["disallowAllSkipableVarIsEmpty"]="";
-
 
4985
		#$conf["disallowAllSkipableVarIsEmptyArray"],字串,是否允許每個可省略參數都為空陣列,預設為"true"允許,反之為"false".
-
 
4986
		#$conf["disallowAllSkipableVarIsEmptyArray"]="";
-
 
4987
		#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
-
 
4988
		#$conf["arrayCountEqualCheck"][]=array();
-
 
4989
		#參考資料:
-
 
4990
		#array_keys=>http://php.net/manual/en/function.array-keys.php
-
 
4991
		$checkArguments=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
-
 
4992
		unset($conf["variableCheck::checkArguments"]);
-
 
4993
 
-
 
4994
		#如果檢查失敗
-
 
4995
		if($checkArguments["status"]=="false"){
-
 
4996
 
-
 
4997
			#設置執行不正常
-
 
4998
			$result["status"]="false";
-
 
4999
 
-
 
5000
			#程式停止執行
-
 
5001
			$result["error"]=$checkArguments;
-
 
5002
 
-
 
5003
			#回傳結果
-
 
5004
			return $result;
-
 
5005
 
-
 
5006
			}#if end
-
 
5007
 
-
 
5008
		#如果檢查不通過
-
 
5009
		if($checkArguments["passed"]=="false"){
-
 
5010
 
-
 
5011
			#設置執行不正常
-
 
5012
			$result["status"]="false";
-
 
5013
 
-
 
5014
			#程式停止執行
-
 
5015
			$result["error"]=$checkArguments;
-
 
5016
 
-
 
5017
			#回傳結果
-
 
5018
			return $result;
-
 
5019
 
-
 
5020
			}#if end
-
 
5021
 
-
 
5022
		#如果 $conf["tableStart"] 為 "true"
-
 
5023
		if($conf["tableStart"]=="true"){
-
 
5024
 
-
 
5025
			#函式說明:
-
 
5026
			#表格開始,可以設定表格的厚度和位置
-
 
5027
			#回傳結果:
-
 
5028
			#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
-
 
5029
			#$result["content"],表格開始的語法
-
 
5030
			#$result["function"],當前執行的函數
-
 
5031
			#$result["error"],函式錯誤訊息
-
 
5032
			#必填寫的參數:
-
 
5033
			$conf["table::start"]["class"]=$conf["tableClass"];#爲表格的css樣式,若為"",則代表不套用css樣式;若爲"__withoutBorder"的話則套用無框線的預設樣式;若爲"__withBorder"的話,則爲有框線的預設樣式。
-
 
5034
			$tableStart=table::start($conf["table::start"]);
-
 
5035
			unset($conf["table::start"]);
-
 
5036
 
-
 
5037
			#如果表開始立失敗
-
 
5038
			if($tableStart["status"]=="false"){
-
 
5039
 
-
 
5040
				#設置執行失敗
-
 
5041
				$result["status"]="false";
-
 
5042
 
-
 
5043
				#設置執行錯誤訊息
-
 
5044
				$result["error"]=$tableStart;
-
 
5045
 
-
 
5046
				#回傳結果
-
 
5047
				return $result;
-
 
5048
 
-
 
5049
				}#if end
-
 
5050
 
-
 
5051
			#串接表格開始的語法
-
 
5052
			$result["content"]=$result["content"].$tableStart["content"];
-
 
5053
 
-
 
5054
			}#if end
-
 
5055
 
-
 
5056
		#如果 $conf["comment"] 有設置
-
 
5057
		if(isset($conf["comment"])){
-
 
5058
 
-
 
5059
			#新增label,且套用css樣式.
-
 
5060
			$result["content"]=$result["content"]."<label for=\"".$conf["name"]."\" class=\"".$conf["class"]."\" >".$conf["comment"]."</label>";
-
 
5061
 
-
 
5062
			}#if end
-
 
5063
 
-
 
5064
		#如果其值爲 true
-
 
5065
		if($conf["trStart"]=="true"){
-
 
5066
 
-
 
5067
			#串接列開始<tr>
-
 
5068
			$result["content"]=$result["content"]."<tr>";
-
 
5069
 
-
 
5070
			}#if end
-
 
5071
 
-
 
5072
		#如果其值爲 true
-
 
5073
		if($conf["tdStart"]=="true"){
-
 
5074
 
-
 
5075
			#串接欄位開始<td>
-
 
5076
			$result["content"]=$result["content"]."<td>";
-
 
5077
 
-
 
5078
			}#if end
-
 
5079
 
-
 
5080
		#如果 $conf["formStart"] 等於 "true"
-
 
5081
		if($conf["formStart"]=="true"){
-
 
5082
 
-
 
5083
			#函式說明:
-
 
5084
			#表單開始
-
 
5085
			#回傳結果:
-
 
5086
			#$result,表單開始的語法
-
 
5087
			#必填參數:
-
 
5088
			$conf["form"]["start"]["action"]=$conf["formAction"];#爲要交給那個檔案處理該表單傳送的內容
-
 
5089
			#可省略參數:
-
 
5090
 
-
 
5091
			#如果 $conf["formName"] 有設置
-
 
5092
			if(isset($conf["formName"])){
-
 
5093
 
-
 
5094
				#過濾 $conf["formName"] 避免錯誤
-
 
5095
				#函式說明:
-
 
5096
				#處理字串避免網頁出錯
-
 
5097
				#回傳結果:
-
 
5098
				#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
-
 
5099
				#$result["function"],當前執行的函數.
-
 
5100
				#$result["content"],爲處理好的字串.
-
 
5101
				#$result["error"],錯誤訊息陣列.
-
 
5102
				#必填參數:
-
 
5103
				$conf["stringProcess::correctCharacter"]["stringIn"]=$conf["formName"];#爲要處理的字串
-
 
5104
				#可省略的參數:
-
 
5105
				$conf["stringProcess::correctCharacter"]["selectedCharacter"]=array("<",">","=","//","'","$","%","&","|","/*","*\/","#","\""," ");#爲被選擇要處理的字串/字元,須爲陣列值。
-
 
5106
					#若不設定則預設爲要將這些字串作替換("<",">","=","//","'","$","%","&","|","/*","*\/","#","\"")。
-
 
5107
					#特殊字元,「\n」代表換行,「\t」代表tab鍵的間隔
-
 
5108
				#$conf["changeTo"]=array();#爲被選擇的字元要換成什麼字串/字元,須爲陣列值。若不設定,則預設爲更換成""(空字串)。
-
 
5109
				$correctCharacter=stringProcess::correctCharacter($conf["stringProcess::correctCharacter"]);
-
 
5110
				unset($conf["stringProcess::correctCharacter"]);
-
 
5111
 
-
 
5112
				#如果過濾 $conf["formName"] 失敗
-
 
5113
				if($correctCharacter["status"]=="false"){
-
 
5114
 
-
 
5115
					#設置執行失敗
-
 
5116
					$result["status"]="false";
-
 
5117
 
-
 
5118
					#設置執行錯誤訊息
-
 
5119
					$result["error"]=$correctCharacter;
-
 
5120
 
-
 
5121
					#回傳結果
-
 
5122
					return $result;
-
 
5123
 
-
 
5124
					}#if end
-
 
5125
 
-
 
5126
				#則設定其數值
-
 
5127
				$conf["form"]["start"]["name"]=$correctCharacter["content"];#爲該表單的名稱
-
 
5128
 
-
 
5129
				}#if end
-
 
5130
 
-
 
5131
			#如果 $conf["formMethod"] 有設置
-
 
5132
			if(isset($conf["formMethod"])){
-
 
5133
 
-
 
5134
				#則設定其數值
-
 
5135
				$conf["form"]["start"]["method"]=$conf["formMethod"];#爲傳輸的方法,若沒設定則預設爲post,其他可用的參數爲get。
-
 
5136
 
-
 
5137
				}#if end
-
 
5138
 
-
 
5139
			#如果 $conf["formTarget"] 有設定
-
 
5140
			if(isset($conf["formTarget"])){
-
 
5141
 
-
 
5142
				#則設定其數值
-
 
5143
				$conf["form"]["start"]["target"]=$conf["formTarget"];#為顯示的方式,若沒設定則預設爲"_self",其他可用的參數爲 "_blank"、"_parent"、"_top",也可以是iframe的名稱。
-
 
5144
 
-
 
5145
				}#if end
-
 
5146
 
-
 
5147
			#則設定其參數數值
-
 
5148
			$conf["form"]["start"]["tableStart"]="false";#爲該表單是否要以<table>開始。"true"爲是;
-
 
5149
 
-
 
5150
			#則設定其數值
-
 
5151
			#$conf["form"]["start"]["tableClass"]=$conf["tableClass"];#表格要套用的css樣式,若爲"__withoutBorder"的話則套用無框線的預設樣式;若爲"__withBorder"的話,則爲有框線的預設樣式。
-
 
5152
			$formStart=form::start($conf["form"]["start"]);
-
 
5153
			unset($conf["form"]["start"]);
-
 
5154
 
-
 
5155
			#如果表單開始失敗
-
 
5156
			if($formStart["status"]=="false"){
-
 
5157
 
-
 
5158
				#設置執行失敗
-
 
5159
				$result["status"]="false";
-
 
5160
 
-
 
5161
				#設置執行錯誤訊息
-
 
5162
				$result["error"]=$formStart;
-
 
5163
 
-
 
5164
				#回傳結果
-
 
5165
				return $result;
-
 
5166
 
-
 
5167
				}#if end
-
 
5168
 
-
 
5169
			#串接表單開始的語法
-
 
5170
			$result["content"]=$result["content"].$formStart["content"];
-
 
5171
 
-
 
5172
			}#if end
-
 
5173
 
-
 
5174
		#如果$conf["width"]沒設定
-
 
5175
		if(!isset($conf["width"])){
-
 
5176
 
-
 
5177
			#則$conf["width"]爲空值
-
 
5178
			$conf["width"]="";
-
 
5179
 
-
 
5180
			}#if end
-
 
5181
 
-
 
5182
		#如果$conf["width"]有設定
-
 
5183
		else{
-
 
5184
 
-
 
5185
			#則套用寬度的css設定值
-
 
5186
			$conf["width"]=" style=\"width:".$conf["width"].";\" ";
-
 
5187
 
-
 
5188
			}#else end
-
 
5189
 
-
 
5190
		#如果$conf["maxInputLength"]沒設定
-
 
5191
		if(!isset($conf["maxInputLength"])){
-
 
5192
 
-
 
5193
			#則$conf["maxInputLength"]爲空值
-
 
5194
			$conf["maxInputLength"]="";
-
 
5195
 
-
 
5196
			}#if end
-
 
5197
 
-
 
5198
		#如果$conf["maxInputLength"]有設定
-
 
5199
		else{
-
 
5200
 
-
 
5201
			$conf["maxInputLength"]=" maxlength=".$conf["maxInputLength"];
-
 
5202
 
-
 
5203
			}#else end
-
 
5204
 
-
 
5205
		#如果$conf["value"]沒有設定
-
 
5206
		if(!isset($conf["value"])){
-
 
5207
 
-
 
5208
			#則$value就爲空值
-
 
5209
			$conf["value"]="";
-
 
5210
 
-
 
5211
			}#if end
-
 
5212
 
-
 
5213
		#如果$conf["value"]有設定,且不為空.
-
 
5214
		else if($conf["value"]!==""){
-
 
5215
 
-
 
5216
			#過濾 $conf["value"] 的內容,避免錯誤。
-
 
5217
			#函式說明:
-
 
5218
			#處理字串避免網頁出錯
-
 
5219
			#回傳結果:
-
 
5220
			#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
-
 
5221
			#$result["function"],當前執行的函數.
-
 
5222
			#$result["content"],爲處理好的字串.
-
 
5223
			#$result["error"],錯誤訊息陣列.
-
 
5224
			#必填參數:
-
 
5225
			$conf["stringProcess::correctCharacter"]["stringIn"]=$conf["value"];#爲要處理的字串
-
 
5226
			#可省略的參數:
-
 
5227
			$conf["stringProcess::correctCharacter"]["selectedCharacter"]=array("<",">","=","//","'","$","%","&","|","/*","*\/","#","\"");#爲被選擇要處理的字串/字元,須爲陣列值。
-
 
5228
				#若不設定則預設爲要將這些字串作替換("<",">","=","//","'","$","%","&","|","/*","*\/","#","\"")。
-
 
5229
				#特殊字元,「\n」代表換行,「\t」代表tab鍵的間隔
-
 
5230
			#$conf["stringProcess::correctCharacter"]["changeTo"]=array("","","","","","","","","","","","","");#爲被選擇的字元要換成什麼字串/字元,須爲陣列值。若不設定,則預設爲更換成""(空字串)。
-
 
5231
			$correctCharacter=stringProcess::correctCharacter($conf["stringProcess::correctCharacter"]);
-
 
5232
			unset($conf["stringProcess::correctCharacter"]);
-
 
5233
 
-
 
5234
			#如果過濾字串失敗
-
 
5235
			if($correctCharacter["status"]=="false"){
-
 
5236
 
-
 
5237
				#設置執行失敗
-
 
5238
				$result["status"]="false";
-
 
5239
 
-
 
5240
				#設置執行錯誤訊息
-
 
5241
				$result["error"]=$correctCharacter;
-
 
5242
 
-
 
5243
				#回傳結果
-
 
5244
				return $result;
-
 
5245
 
-
 
5246
				}#if end
-
 
5247
 
-
 
5248
			#就設定預設的內容
-
 
5249
			$conf["value"] =" value= \"".$correctCharacter["content"]."\" ";
-
 
5250
 
-
 
5251
			}#else end
-
 
5252
 
-
 
5253
		#如果$conf["readOnly"]爲"true"
-
 
5254
		if($conf["readOnly"]=="true"){
-
 
5255
 
-
 
5256
			#則$conf["readOnly"] 爲 readonly
-
 
5257
			$conf["readOnly"]="readonly=true disabled=true";
-
 
5258
 
-
 
5259
			}#if end
-
 
5260
 
-
 
5261
		#反之
-
 
5262
		else{
-
 
5263
 
-
 
5264
			#$conf["readOnly"]爲空
-
 
5265
			$conf["readOnly"]="";
-
 
5266
 
-
 
5267
			}#if end
-
 
5268
 
-
 
5269
		#判斷 $conf["autoFocus"] 的數值
-
 
5270
		switch($conf["autoFocus"]){
-
 
5271
 
-
 
5272
			#如果是 "true"
-
 
5273
			case "true":
-
 
5274
 
-
 
5275
				#設置為 "autofocus"
-
 
5276
				$conf["autoFocus"]=" autofocus=true ";
-
 
5277
 
-
 
5278
				#跳出 switch
-
 
5279
				break;
-
 
5280
 
-
 
5281
			#如果是其他內容
-
 
5282
			default:
-
 
5283
 
-
 
5284
				#則設置為 ""
-
 
5285
				$conf["autoFocus"]="";
-
 
5286
 
-
 
5287
			}#switch end
-
 
5288
 
-
 
5289
		#如果有設置 $conf["class"]
-
 
5290
		if(isset($conf["class"])){
-
 
5291
 
-
 
5292
			#套用css設定
-
 
5293
			$conf["class"]=" class = \"".$conf["class"]."\"";
-
 
5294
 
-
 
5295
			}#if end
-
 
5296
		
-
 
5297
		#反之
-
 
5298
		else{
-
 
5299
			#設置為空字串
-
 
5300
			$conf["class"]="";
-
 
5301
			
-
 
5302
			}#else end
-
 
5303
			
-
 
5304
		#如果有 $conf["classList"]
-
 
5305
		if(isset($conf["classList"])){
-
 
5306
		
-
 
5307
			#傳接 class 開始
-
 
5308
			$conf["class"]=" class = \"";
-
 
5309
			
-
 
5310
			#針對 $conf["classList"] 的每個元素
-
 
5311
			foreach($conf["classList"] as $index => $cssClassName){
-
 
5312
			
-
 
5313
				#串接 class 名稱
-
 
5314
				$conf["class"]=$conf["class"].$cssClassName;
-
 
5315
			
-
 
5316
				#若後面還有未串接的 class 名稱
-
 
5317
				if(isset($conf["classList"][$index+1])){
-
 
5318
				
-
 
5319
					#串接空格
-
 
5320
					$conf["class"]=$conf["class"]." ";
-
 
5321
				
-
 
5322
					}#if end
-
 
5323
			
-
 
5324
				}#foreach end
-
 
5325
			
-
 
5326
			#串接 class 結束
-
 
5327
			$conf["class"]=$conf["class"]."\"";
-
 
5328
		
-
 
5329
			}#if end
-
 
5330
 
-
 
5331
		#如果 $conf["jsActivitor"] 與 $conf["jsAction"] 皆有設定
-
 
5332
		if( isset($conf["jsActivitor"]) && isset($conf["jsAction"]) ){
-
 
5333
 
-
 
5334
			#則將設定值組合
-
 
5335
			$conf["jsCustom"]=" ".$conf["jsActivitor"]."=".$conf["jsAction"]." ";
-
 
5336
 
-
 
5337
			}#if end
-
 
5338
 
-
 
5339
		#如果 $conf["jsCustom"] 沒有設定
-
 
5340
		if(!isset($conf["jsCustom"])){
-
 
5341
 
-
 
5342
			#將其設爲空值
-
 
5343
			$conf["jsCustom"]="";
-
 
5344
 
-
 
5345
			}#if end
-
 
5346
 
-
 
5347
		#過濾 $conf["name"] 避免錯誤
-
 
5348
		#函式說明:
-
 
5349
		#處理字串避免網頁出錯
-
 
5350
		#回傳結果:
-
 
5351
		#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
-
 
5352
		#$result["function"],當前執行的函數.
-
 
5353
		#$result["content"],爲處理好的字串.
-
 
5354
		#$result["error"],錯誤訊息陣列.
-
 
5355
		#必填參數:
-
 
5356
		$conf["stringProcess::correctCharacter"]["stringIn"]=$conf["name"];#爲要處理的字串
-
 
5357
		#可省略的參數:
-
 
5358
		$conf["stringProcess::correctCharacter"]["selectedCharacter"]=array("<",">","=","//","'","$","%","&","|","/*","*\/","#","\""," ");#爲被選擇要處理的字串/字元,須爲陣列值。
-
 
5359
			#若不設定則預設爲要將這些字串作替換("<",">","=","//","'","$","%","&","|","/*","*\/","#","\"")。
-
 
5360
			#特殊字元,「\n」代表換行,「\t」代表tab鍵的間隔
-
 
5361
		#$conf["stringProcess::correctCharacter"]["changeTo"]=array("","","","","","","","","","","","","");#爲被選擇的字元要換成什麼字串/字元,須爲陣列值。若不設定,則預設爲更換成""(空字串)。
-
 
5362
		$correctCharacter=stringProcess::correctCharacter($conf["stringProcess::correctCharacter"]);
-
 
5363
		unset($conf["stringProcess::correctCharacter"]);
-
 
5364
 
-
 
5365
		#如果過濾字串失敗
-
 
5366
		if($correctCharacter["status"]=="false"){
-
 
5367
 
-
 
5368
			#設置執行失敗
-
 
5369
			$result["status"]="false";
-
 
5370
 
-
 
5371
			#設置執行錯誤訊息
-
 
5372
			$result["error"]=$correctCharacter;
-
 
5373
 
-
 
5374
			#回傳結果
-
 
5375
			return $result;
-
 
5376
 
-
 
5377
			}#if end
-
 
5378
 
-
 
5379
		#置換過濾好了的$conf["name"]
-
 
5380
		$conf["name"]=$correctCharacter["content"];
-
 
5381
 
-
 
5382
		#如果有設定 $conf["placeholder"]
-
 
5383
		if(isset($conf["placeholder"])){
-
 
5384
 
-
 
5385
			#串接 placeholder 的內容
-
 
5386
			$conf["placeholder"]=" placeholder=\"".$conf["placeholder"]."\" ";
-
 
5387
 
-
 
5388
			}#if end
-
 
5389
 
-
 
5390
		#反之沒有設定 $conf["placeholder"]
-
 
5391
		else{
-
 
5392
 
-
 
5393
			#設為 ""
-
 
5394
			$conf["placeholder"]="";
-
 
5395
 
-
 
5396
			}#else end
-
 
5397
 
-
 
5398
		#如果 $conf["required"] 為"true"
-
 
5399
		if($conf["required"]=="true"){
-
 
5400
 
-
 
5401
			#設置 "required" 屬性
-
 
5402
			$conf["required"]="required=true";
-
 
5403
 
-
 
5404
			}#if end
-
 
5405
 
-
 
5406
		#反之
-
 
5407
		else{
-
 
5408
 
-
 
5409
			#設為空值
-
 
5410
			$conf["required"]="";
-
 
5411
 
-
 
5412
			}#else end
-
 
5413
 
-
 
5414
		#如果有設置id
-
 
5415
		if(isset($conf["id"])){
-
 
5416
 
-
 
5417
			#設置id屬性
-
 
5418
			$conf["id"]="id=\"".$conf["id"]."\"";
-
 
5419
 
-
 
5420
			}#if end
-
 
5421
 
-
 
5422
		#反之
-
 
5423
		else{
-
 
5424
 
-
 
5425
			#設為空值
-
 
5426
			$conf["id"]="";
-
 
5427
 
-
 
5428
			}#else end
-
 
5429
 
-
 
5430
		#如果有設置 $conf["dataFormId"]
-
 
5431
		if(isset($conf["dataFormId"])){
-
 
5432
		
-
 
5433
			#設置 data-id 屬性
-
 
5434
			$conf["dataFormId"]="data-form-id=\"".$conf["dataFormId"]."\"";
-
 
5435
		
-
 
5436
			}#if end
-
 
5437
		
-
 
5438
		#反之設置為空數值	
-
 
5439
		else{
-
 
5440
		
-
 
5441
			$conf["dataFormId"]="";
-
 
5442
		
-
 
5443
			}#else end	
-
 
5444
 
-
 
5445
		#如果要 autocomplete
-
 
5446
		if($conf["autocomplete"]==="on"){
-
 
5447
		
-
 
5448
			#設置為 "autocomplete"
-
 
5449
			$conf["autocomplete"]="autocomplete";
-
 
5450
		
-
 
5451
		}#if end
-
 
5452
		
-
 
5453
		#反之
-
 
5454
		else{
-
 
5455
			#設置為空字串
-
 
5456
			$conf["autocomplete"]="";
-
 
5457
		
-
 
5458
		}#else end
-
 
5459
 
-
 
5460
		#放置可以輸入email的表單
-
 
5461
		$result["content"]=$result["content"]."<input ".$conf["id"]." type = \"email\" ".$conf["width"]." ".$conf["maxInputLength"]." name = ".$conf["name"]." id = ".$conf["name"]." ".$conf["value"]." ".$conf["readOnly"]." ".$conf["autoFocus"]." ".$conf["class"]." ".$conf["jsCustom"]." ".$conf["placeholder"]." ".$conf["autocomplete"]." ".$conf["required"]." ".$conf["dataFormId"]." >";
-
 
5462
 
-
 
5463
		#如果 $conf["formEnd"] 等於 "true"
-
 
5464
		if($conf["formEnd"]=="true"){
-
 
5465
 
-
 
5466
			#函式說明:
-
 
5467
			#表單結束
-
 
5468
			#回傳結果:
-
 
5469
			#$result,表單結束的語法
-
 
5470
			#必填參數:
-
 
5471
			#則設定其數值
-
 
5472
			$conf["form"]["end"]["tableEnd"]="false";#爲該表單是否要以</table>結尾。"true"爲是;"false"爲否。
-
 
5473
			$formEnd=form::end($conf["form"]["end"]);
-
 
5474
			unset($conf["form"]["end"]);
-
 
5475
 
-
 
5476
			#串接表單結束的語法
-
 
5477
			$result["content"]=$result["content"].$formEnd["content"];
-
 
5478
 
-
 
5479
			}#if end
-
 
5480
 
-
 
5481
		#如果其值爲 true
-
 
5482
		if($conf["tdEnd"]=="true"){
-
 
5483
 
-
 
5484
			#串接欄位結束的語法
-
 
5485
			$result["content"]=$result["content"]."</td>";
-
 
5486
 
-
 
5487
			}#if end
-
 
5488
 
-
 
5489
		#如果其值爲 true
-
 
5490
		if($conf["trEnd"]=="true"){
-
 
5491
 
-
 
5492
			#串接列結束的語法
-
 
5493
			$result["content"]=$result["content"]."</tr>";
-
 
5494
 
-
 
5495
			}#if end
-
 
5496
 
-
 
5497
		#如果 $conf["br"] 等於 "true"
-
 
5498
		if($conf["br"]=="true"){
-
 
5499
 
-
 
5500
			#結尾加上<br>
-
 
5501
			$result["content"]=$result["content"]."<br>";
-
 
5502
 
-
 
5503
			}#if end
-
 
5504
 
-
 
5505
		#如果 $conf["p"] 等於 "true"
-
 
5506
		if($conf["p"]=="true"){
-
 
5507
 
-
 
5508
			#結尾加上<p>
-
 
5509
			$result["content"]=$result["content"]."<p>";
-
 
5510
 
-
 
5511
			}#if end
-
 
5512
 
-
 
5513
		#執行到這邊代表執行成功
-
 
5514
		$result["status"]="true";
-
 
5515
 
-
 
5516
		#回傳結果
-
 
5517
		return $result;
-
 
5518
		
-
 
5519
		}#function inputEmail end
-
 
5520
	
-
 
5521
	/*
-
 
5522
	#函式說明:
4837
	#可以輸入文字的區塊
5523
	#可以輸入文字的區塊
4838
	#回傳結果:
5524
	#回傳結果:
4839
	#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
5525
	#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
4840
	#$result["function"],當前執行的函數.
5526
	#$result["function"],當前執行的函數.
4841
	#$result["error"],錯誤訊息陣列.
5527
	#$result["error"],錯誤訊息陣列.