Subversion Repositories php-qbpwcf

Rev

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

Rev 3 Rev 226
Line 1... Line 1...
1
<?php
1
<?php
2
 
2
 
3
/*
3
/*
4
 
4
 
5
	QBPWCF, Quick Build PHP website Component base on Fedora Linux.
5
	QBPWCF, Quick Build PHP website Component base on Fedora Linux.
6
    Copyright (C) 2015~2024 Min-Jhin,Chen
6
    Copyright (C) 2014~2025 MIN ZHI, CHEN
7
 
7
 
8
    This file is part of QBPWCF.
8
    This file is part of QBPWCF.
9
 
9
 
10
    QBPWCF is free software: you can redistribute it and/or modify
10
    QBPWCF is free software: you can redistribute it and/or modify
11
    it under the terms of the GNU General Public License as published by
11
    it under the terms of the GNU General Public License as published by
Line 47... Line 47...
47
	#__call=>http://php.net/manual/en/language.oop5.overloading.php#object.callstatic
47
	#__call=>http://php.net/manual/en/language.oop5.overloading.php#object.callstatic
48
	#備註:
48
	#備註:
49
	#無.
49
	#無.
50
	*/
50
	*/
51
	public function __call($method,$arguments){
51
	public function __call($method,$arguments){
52
		
52
 
53
		#取得當前執行的函式
53
		#取得當前執行的函式
54
		$result["function"]=__FUNCTION__;
54
		$result["function"]=__FUNCTION__;
55
		
55
 
56
		#設置執行不正常
56
		#設置執行不正常
57
		$result["status"]="false";
57
		$result["status"]="false";
58
		
58
 
59
		#設置執行錯誤
59
		#設置執行錯誤
60
		$result["error"][]=__NAMESPACE__ ."/".$method."() 不存在!";
60
		$result["error"][]=__NAMESPACE__ ."/".$method."() 不存在!";
61
		
61
 
62
		#設置所丟入的參數
62
		#設置所丟入的參數
63
		$result["error"][]=$arguments;
63
		$result["error"][]=$arguments;
64
		
64
 
65
		#回傳結果
65
		#回傳結果
66
		return $result;
66
		return $result;
67
		
67
 
68
		}#function __call end
68
		}#function __call end
69
		
69
 
70
	/*
70
	/*
71
	#函式說明:
71
	#函式說明:
72
	#當前類別被呼叫的靜態方法不存在時,將會執行該函數,回報該方法不存在.
72
	#當前類別被呼叫的靜態方法不存在時,將會執行該函數,回報該方法不存在.
73
	#回傳結果:
73
	#回傳結果:
74
	#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
74
	#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
Line 83... Line 83...
83
	#__call=>http://php.net/manual/en/language.oop5.overloading.php#object.callstatic
83
	#__call=>http://php.net/manual/en/language.oop5.overloading.php#object.callstatic
84
	#備註:
84
	#備註:
85
	#無.
85
	#無.
86
	*/
86
	*/
87
	public static function __callStatic($method,$arguments){
87
	public static function __callStatic($method,$arguments){
88
		
88
 
89
		#取得當前執行的函式
89
		#取得當前執行的函式
90
		$result["function"]=__FUNCTION__;
90
		$result["function"]=__FUNCTION__;
91
		
91
 
92
		#設置執行不正常
92
		#設置執行不正常
93
		$result["status"]="false";
93
		$result["status"]="false";
94
		
94
 
95
		#設置執行錯誤
95
		#設置執行錯誤
96
		$result["error"][]="欲呼叫的". __NAMESPACE__ ."/".$method."() 不存在!";
96
		$result["error"][]="欲呼叫的". __NAMESPACE__ ."/".$method."() 不存在!";
97
		
97
 
98
		#設置所丟入的參數
98
		#設置所丟入的參數
99
		$result["error"][]=$arguments;
99
		$result["error"][]=$arguments;
100
		
100
 
101
		#回傳結果
101
		#回傳結果
102
		return $result;
102
		return $result;
103
		
103
 
104
		}#function __callStatic end
104
		}#function __callStatic end
105
	
105
 
106
	/*
106
	/*
107
	#函式說明:
107
	#函式說明:
108
	#放置超鏈結
108
	#放置超鏈結
109
	#回傳結果:
109
	#回傳結果:
110
	#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
110
	#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
111
	#$result["error"],錯誤訊息
111
	#$result["error"],錯誤訊息
112
	#$result["content"],語法
112
	#$result["content"],語法
113
	#$result["function"],當前執行的函數名稱
113
	#$result["function"],當前執行的函數名稱
114
	#必填參數:
114
	#必填參數:
115
	#$conf["position"],字串,爲要連結到的位置,若留空,將會自動變成"#(目標不存在)","#"則可以搭配ajax傳值.	
115
	#$conf["position"],字串,爲要連結到的位置,若留空,將會自動變成"#(目標不存在)","#"則可以搭配ajax傳值.
116
	$conf["position"]="";
116
	$conf["position"]="";
117
	#$conf["linkName",字串,爲連結的顯示名稱
117
	#$conf["linkName",字串,爲連結的顯示名稱
118
	$conf["linkName"]="";
118
	$conf["linkName"]="";
119
	#可省略參數:
119
	#可省略參數:
120
	#$conf["method"],字串,爲點選連結後,新畫面要如何呈現,可省略預設爲"_self",可用的選項有 _top(覆蓋目前的視窗來顯現新內容) _parent _self _blank(跳新視窗)
120
	#$conf["method"],字串,爲點選連結後,新畫面要如何呈現,可省略預設爲"_self",可用的選項有 _top(覆蓋目前的視窗來顯現新內容) _parent _self _blank(跳新視窗)
121
	#$conf["method"]=""; 
121
	#$conf["method"]="";
122
	#$conf["class"],字串,爲要套用的css超連節樣式,可省略.
122
	#$conf["class"],字串,爲要套用的css超連節樣式,可省略.
123
	#$conf["class"]="";
123
	#$conf["class"]="";
124
	#$conf["id"],字串,超連結的id.
124
	#$conf["id"],字串,超連結的id.
125
	#$conf["id"]="";
125
	#$conf["id"]="";
126
	#$conf["no_outline"],字串,是否要取消連結的框線,"false為不取消,"true"代表要取消,預設為"false".
126
	#$conf["no_outline"],字串,是否要取消連結的框線,"false為不取消,"true"代表要取消,預設為"false".
Line 129... Line 129...
129
	#$conf["callBackFunctions"]=array();
129
	#$conf["callBackFunctions"]=array();
130
	#參考資料
130
	#參考資料
131
	#無.
131
	#無.
132
	#備註:
132
	#備註:
133
	#無.
133
	#無.
134
	*/	
134
	*/
135
	public static function show_link(&$conf){
135
	public static function show_link(&$conf){
136
 
136
 
137
		#初始化要回傳的內容
137
		#初始化要回傳的內容
138
		$result=array();
138
		$result=array();
139
		
139
 
140
		#取得當前執行的函數名稱
140
		#取得當前執行的函數名稱
141
		$result["function"]=__FUNCTION__;
141
		$result["function"]=__FUNCTION__;
142
		
142
 
143
		#初始化要回傳的語法
143
		#初始化要回傳的語法
144
		$result["content"]="";
144
		$result["content"]="";
145
		
145
 
146
		#如果 $conf 不為陣列
146
		#如果 $conf 不為陣列
147
		if(gettype($conf)!="array"){
147
		if(gettype($conf)!="array"){
148
			
148
 
149
			#設置執行失敗
149
			#設置執行失敗
150
			$result["status"]="false";
150
			$result["status"]="false";
151
			
151
 
152
			#設置執行錯誤訊息
152
			#設置執行錯誤訊息
153
			$result["error"][]="\$conf變數須為陣列形態";
153
			$result["error"][]="\$conf變數須為陣列形態";
154
 
154
 
155
			#如果傳入的參數為 null
155
			#如果傳入的參數為 null
156
			if($conf==null){
156
			if($conf==null){
157
				
157
 
158
				#設置執行錯誤訊息
158
				#設置執行錯誤訊息
159
				$result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
159
				$result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
160
				
160
 
161
				}#if end
161
				}#if end
162
 
162
 
163
			#回傳結果
163
			#回傳結果
164
			return $result;
164
			return $result;
165
			
165
 
166
			}#if end
166
			}#if end
167
		
167
 
168
		#檢查參數
168
		#檢查參數
169
		#函式說明:
169
		#函式說明:
170
		#檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容。
170
		#檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容。
171
		#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
171
		#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
172
		#$reuslt["error"],執行不正常結束的錯訊息陣列.
172
		#$reuslt["error"],執行不正常結束的錯訊息陣列.
Line 178... Line 178...
178
		#必填寫的參數:
178
		#必填寫的參數:
179
		#$conf["varInput"],陣列變數,要檢查的陣列變數,請在要檢查的參數前面加上&,這樣變動的結果才能被套用。
179
		#$conf["varInput"],陣列變數,要檢查的陣列變數,請在要檢查的參數前面加上&,這樣變動的結果才能被套用。
180
		$conf["variableCheck::checkArguments"]["varInput"]=&$conf;
180
		$conf["variableCheck::checkArguments"]["varInput"]=&$conf;
181
		#$conf["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
181
		#$conf["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
182
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("position","linkName");
182
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("position","linkName");
183
		#$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列 例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double"); 
183
		#$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列 例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double");
184
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("string","string");
184
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("string","string");
185
		#$conf["variableCheck::checkArguments"]["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
185
		#$conf["variableCheck::checkArguments"]["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
186
		$conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
186
		$conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
187
		#可以省略的參數:
187
		#可以省略的參數:
188
		#$conf["canBeEmptyString"],必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true"。
188
		#$conf["canBeEmptyString"],必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true"。
189
		$conf["variableCheck::checkArguments"]["canBeEmptyString"]="true";
189
		$conf["variableCheck::checkArguments"]["canBeEmptyString"]="true";
190
		#$conf["skipableVariableName"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
190
		#$conf["skipableVariableName"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
191
		$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("class","method","imgFilePosition","id","no_outline","callBackFunctions");
191
		$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("class","method","imgFilePosition","id","no_outline","callBackFunctions");
192
		#$conf["skipableVariableType"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double"); 
192
		#$conf["skipableVariableType"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double");
193
		$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("string","string","string","string","string","array");
193
		$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("string","string","string","string","string","array");
194
		#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,「null」代表不指定,若預設值是必填參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
194
		#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,「null」代表不指定,若預設值是必填參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
195
		$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array(null,"_self",null,null,"false",null);
195
		$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array(null,"_self",null,null,"false",null);
196
		#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
196
		#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
197
		#$conf["arrayCountEqualCheck"][]=array();
197
		#$conf["arrayCountEqualCheck"][]=array();
198
		$checkResult=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
198
		$checkResult=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
199
		unset($conf["variableCheck::checkArguments"]);
199
		unset($conf["variableCheck::checkArguments"]);
200
		
200
 
201
		#如果檢查參數失敗
201
		#如果檢查參數失敗
202
		if($checkResult["status"]=="false"){
202
		if($checkResult["status"]=="false"){
203
			
203
 
204
			#設置執行失敗
204
			#設置執行失敗
205
			$result["status"]="false";
205
			$result["status"]="false";
206
			
206
 
207
			#設置錯誤訊息
207
			#設置錯誤訊息
208
			$result["error"]=$checkResult;
208
			$result["error"]=$checkResult;
209
			
209
 
210
			#回傳結果
210
			#回傳結果
211
			return $result;
211
			return $result;
212
			
212
 
213
			}#if end
213
			}#if end
214
			
214
 
215
		#如果檢查參數不通過
215
		#如果檢查參數不通過
216
		if($checkResult["passed"]=="false"){
216
		if($checkResult["passed"]=="false"){
217
			
217
 
218
			#設置執行失敗
218
			#設置執行失敗
219
			$result["status"]="false";
219
			$result["status"]="false";
220
			
220
 
221
			#設置錯誤訊息
221
			#設置錯誤訊息
222
			$result["error"]=$checkResult;
222
			$result["error"]=$checkResult;
223
			
223
 
224
			#回傳結果
224
			#回傳結果
225
			return $result;
225
			return $result;
226
			
226
 
227
			}#if end
227
			}#if end
228
		
228
 
229
		#存放 js callback 的字串
229
		#存放 js callback 的字串
230
		$callBackStrTemp="";
230
		$callBackStrTemp="";
231
		
231
 
232
		#初始化js內容為空
232
		#初始化js內容為空
233
		$js="";
233
		$js="";
234
		
234
 
235
		#如果是一般的 method
235
		#如果是一般的 method
236
		if($conf["method"]==="_self" || $conf["method"]==="_top" || $conf["method"]==="_parent" || $conf["method"]==="_blank"){
236
		if($conf["method"]==="_self" || $conf["method"]==="_top" || $conf["method"]==="_parent" || $conf["method"]==="_blank"){
237
		
237
 
238
			#設定連結顯示的方式 $conf["method"] 存在,則套用結果
238
			#設定連結顯示的方式 $conf["method"] 存在,則套用結果
239
			$conf["method"]=" target = ".$conf["method"];
239
			$conf["method"]=" target = ".$conf["method"];
240
 
240
 
241
			}#if end
241
			}#if end
242
			
242
 
243
		#反之有設定 $conf["id"]
243
		#反之有設定 $conf["id"]
244
		else if(isset($conf["id"])){
244
		else if(isset($conf["id"])){
245
			
245
 
246
			#如果沒有設置 callback function
246
			#如果沒有設置 callback function
247
			if(!isset($conf["callBackFunctions"])){
247
			if(!isset($conf["callBackFunctions"])){
248
			
248
 
249
				#初始化為空字串
249
				#初始化為空字串
250
				$conf["callBackFunctions"]="";
250
				$conf["callBackFunctions"]="";
251
			
251
 
252
				}#if end
252
				}#if end
253
			
253
 
254
			#反之
254
			#反之
255
			else{
255
			else{
256
				#針對每個 $conf["callBackFunctions"]
256
				#針對每個 $conf["callBackFunctions"]
257
				foreach($conf["callBackFunctions"] as $callback){
257
				foreach($conf["callBackFunctions"] as $callback){
258
				
258
 
259
					#串接 callback 的語法,res為網頁的內容,params.url為目標檔案的相對位置
259
					#串接 callback 的語法,res為網頁的內容,params.url為目標檔案的相對位置
260
					$callBackStrTemp=$callBackStrTemp.$callback.".call(this,res,params.url);";
260
					$callBackStrTemp=$callBackStrTemp.$callback.".call(this,res,params.url);";
261
				
261
 
262
					}#foreach end
262
					}#foreach end
263
				
263
 
264
				}#else end
264
				}#else end
265
			
265
 
266
			#函式說明:
266
			#函式說明:
267
			#將要執行的script語法透過該函式執行(會在程式外層用<script></script>包起來).
267
			#將要執行的script語法透過該函式執行(會在程式外層用<script></script>包起來).
268
			#回傳結果:
268
			#回傳結果:
269
			#$result["status"],執行是否正常,"true"為正常,"false"為不正常.
269
			#$result["status"],執行是否正常,"true"為正常,"false"為不正常.
270
			#$result["error"],錯誤訊息陣列
270
			#$result["error"],錯誤訊息陣列
Line 278... Line 278...
278
			document.getElementById('".$conf["id"]."').addEventListener('click',function(e){
278
			document.getElementById('".$conf["id"]."').addEventListener('click',function(e){
279
 
279
 
280
				//取消預設事件效果與擴散
280
				//取消預設事件效果與擴散
281
				e.preventDefault();
281
				e.preventDefault();
282
				e.stopPropagation();
282
				e.stopPropagation();
283
				
283
 
284
				/*
284
				/*
285
				設置 window.qbpwcf.ajax 函數
285
				設置 window.qbpwcf.ajax 函數
286
				說明:
286
				說明:
287
				傳送ajax,指定傳送前要做什麼事情,傳送後要做什麼事情.
287
				傳送ajax,指定傳送前要做什麼事情,傳送後要做什麼事情.
288
				參數:
288
				參數:
Line 299... Line 299...
299
				params.data={};
299
				params.data={};
300
				params.method='GET';
300
				params.method='GET';
301
				params.url='".$conf["position"]."';
301
				params.url='".$conf["position"]."';
302
				params.resType='document';
302
				params.resType='document';
303
				params.preAc=function(){
303
				params.preAc=function(){
304
				
304
 
305
					//建立讀取的div
305
					//建立讀取的div
306
					var loadingDiv=document.createElement('div');
306
					var loadingDiv=document.createElement('div');
307
					loadingDiv.id='widow.qbpwcf.link.show_link.loadingDiv';
307
					loadingDiv.id='widow.qbpwcf.link.show_link.loadingDiv';
308
					
308
 
309
					//建立讀取的提示文字
309
					//建立讀取的提示文字
310
					loadingDiv.innerText='Loading...';
310
					loadingDiv.innerText='Loading...';
311
					
311
 
312
					//設定讀取的div樣式
312
					//設定讀取的div樣式
313
					loadingDiv.style.position='fixed';
313
					loadingDiv.style.position='fixed';
314
					loadingDiv.style.textAlign='center';
314
					loadingDiv.style.textAlign='center';
315
					loadingDiv.style.color='#FF0000';
315
					loadingDiv.style.color='#FF0000';
316
					loadingDiv.style.backgroundColor='#AAAAAA';
316
					loadingDiv.style.backgroundColor='#AAAAAA';
Line 322... Line 322...
322
					loadingDiv.style.zIndex='1';
322
					loadingDiv.style.zIndex='1';
323
					loadingDiv.style.lineHeight='100vh';
323
					loadingDiv.style.lineHeight='100vh';
324
 
324
 
325
					//append div to body
325
					//append div to body
326
					document.body.appendChild(loadingDiv);
326
					document.body.appendChild(loadingDiv);
327
				
327
 
328
					};
328
					};
329
				params.aftAc=function(res){
329
				params.aftAc=function(res){
330
				
330
 
331
					//移除讀取的div
331
					//移除讀取的div
332
					document.getElementById('widow.qbpwcf.link.show_link.loadingDiv').remove();
332
					document.getElementById('widow.qbpwcf.link.show_link.loadingDiv').remove();
333
					
333
 
334
					//debug
334
					//debug
335
					if(window.debug){
335
					if(window.debug){
336
					
336
 
337
						//debug msg		
337
						//debug msg
338
						console.log(res);
338
						console.log(res);
339
						
339
 
340
						}//if end
340
						}//if end
341
					
341
 
342
					//如果有回應
342
					//如果有回應
343
					if(res!==null){
343
					if(res!==null){
344
					
344
 
345
						//輸出回應
345
						//輸出回應
346
						document.getElementById('".$conf["method"]."').innerHTML=res.body.innerHTML;
346
						document.getElementById('".$conf["method"]."').innerHTML=res.body.innerHTML;
347
					
347
 
348
						}//if end
348
						}//if end
349
					
349
 
350
					//反之	
350
					//反之
351
					else{
351
					else{
352
					
352
 
353
						//輸出回應
353
						//輸出回應
354
						document.getElementById('".$conf["method"]."').innerHTML='';
354
						document.getElementById('".$conf["method"]."').innerHTML='';
355
					
355
 
356
						}//else end
356
						}//else end
357
					
357
 
358
					".$callBackStrTemp."
358
					".$callBackStrTemp."
359
					
359
 
360
					};
360
					};
361
				window.qbpwcf.ajax.call(this,params);
361
				window.qbpwcf.ajax.call(this,params);
362
				
362
 
363
				});
363
				});
364
			";
364
			";
365
			#可省略參數:
365
			#可省略參數:
366
			#$conf["onReady"],字串,是否要在網頁完全載入後再執行,"false"為不等載入完就先執行,預設為"true"要等載入完再執行.
366
			#$conf["onReady"],字串,是否要在網頁完全載入後再執行,"false"為不等載入完就先執行,預設為"true"要等載入完再執行.
367
			#$conf["onReady"]="true";
367
			#$conf["onReady"]="true";
Line 371... Line 371...
371
			#$conf["jsFunciton"]=array();
371
			#$conf["jsFunciton"]=array();
372
			#參考資料:
372
			#參考資料:
373
			#http://stackoverflow.com/questions/9899372/pure-javascript-equivalent-to-jquerys-ready-how-to-call-a-function-when-the
373
			#http://stackoverflow.com/questions/9899372/pure-javascript-equivalent-to-jquerys-ready-how-to-call-a-function-when-the
374
			$toScript=javaScript::toScript($conf["javaScript::toScript"]);
374
			$toScript=javaScript::toScript($conf["javaScript::toScript"]);
375
			unset($conf["javaScript::toScript"]);
375
			unset($conf["javaScript::toScript"]);
376
		
376
 
377
			#如果檢查參數不通過
377
			#如果檢查參數不通過
378
			if($toScript["status"]=="false"){
378
			if($toScript["status"]=="false"){
379
				
379
 
380
				#設置執行失敗
380
				#設置執行失敗
381
				$result["status"]="false";
381
				$result["status"]="false";
382
				
382
 
383
				#設置錯誤訊息
383
				#設置錯誤訊息
384
				$result["error"]=$toScript;
384
				$result["error"]=$toScript;
385
				
385
 
386
				#回傳結果
386
				#回傳結果
387
				return $result;
387
				return $result;
388
				
388
 
389
				}#if end
389
				}#if end
390
				
390
 
391
			#設置js內容	
391
			#設置js內容
392
			$js=$toScript["content"];
392
			$js=$toScript["content"];
393
		
393
 
394
			}#if end
394
			}#if end
395
 
395
 
396
		#如果 $conf["class"] 不存在,則不設定樣式
396
		#如果 $conf["class"] 不存在,則不設定樣式
397
		if(!isset($conf["class"])){
397
		if(!isset($conf["class"])){
398
			
398
 
399
			$conf["class"]="";
399
			$conf["class"]="";
400
 
400
 
401
			}#if end
401
			}#if end
402
 
402
 
403
		#如果 $conf["class"] 存在,則設定樣式
403
		#如果 $conf["class"] 存在,則設定樣式
Line 407... Line 407...
407
 
407
 
408
			}#else end
408
			}#else end
409
 
409
 
410
		#如果連結位置為空字串
410
		#如果連結位置為空字串
411
		if($conf["position"]==""){
411
		if($conf["position"]==""){
412
			
412
 
413
			#設為無效的連結
413
			#設為無效的連結
414
			$conf["position"]="#";
414
			$conf["position"]="#";
415
			
415
 
416
			#連結名稱加上"目標不存在的提示"
416
			#連結名稱加上"目標不存在的提示"
417
			$conf["linkName"]=$conf["linkName"]."(目標不存在)";
417
			$conf["linkName"]=$conf["linkName"]."(目標不存在)";
418
			
418
 
419
			}#if end
419
			}#if end
420
 
420
 
421
		#如果 $conf["id"] 有設置
421
		#如果 $conf["id"] 有設置
422
		if(isset($conf["id"])){
422
		if(isset($conf["id"])){
423
			
423
 
424
			#設置id
424
			#設置id
425
			$conf["id"]=" id=".$conf["id"]." ";
425
			$conf["id"]=" id=".$conf["id"]." ";
426
			
426
 
427
			}#if end
427
			}#if end
428
			
428
 
429
		#反之
429
		#反之
430
		else{
430
		else{
431
			
431
 
432
			#設為空字串
432
			#設為空字串
433
			$conf["id"]="";
433
			$conf["id"]="";
434
			
434
 
435
			}#else end
435
			}#else end
436
 
436
 
437
		#初始化 style 字串
437
		#初始化 style 字串
438
		$style="";
438
		$style="";
439
 
439
 
440
		#如果 $conf["no_outline"] 為 "true"
440
		#如果 $conf["no_outline"] 為 "true"
441
		if($conf["no_outline"]=="true"){
441
		if($conf["no_outline"]=="true"){
442
			
442
 
443
			#函式說明: 
443
			#函式說明:
444
			#建立給與html標籤使用的style屬性字串.
444
			#建立給與html標籤使用的style屬性字串.
445
			#回傳結果:
445
			#回傳結果:
446
			#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.		
446
			#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
447
			#$result["function"],當前執行的函數
447
			#$result["function"],當前執行的函數
448
			#$result["error"],錯誤訊息陣列
448
			#$result["error"],錯誤訊息陣列
449
			#$result["content"],css設定內容
449
			#$result["content"],css設定內容
450
			#必填參數:
450
			#必填參數:
451
			$conf["css::styleStr"]["styleName"]=array("outline","behavior","text-decoration");#為屬性名稱,須為陣列值
451
			$conf["css::styleStr"]["styleName"]=array("outline","behavior","text-decoration");#為屬性名稱,須為陣列值
452
			$conf["css::styleStr"]["styleValue"]=array("none","expression(this.onFocus=this.blur()); /* for IE */","none");#為屬性值,須為陣列值
452
			$conf["css::styleStr"]["styleValue"]=array("none","expression(this.onFocus=this.blur()); /* for IE */","none");#為屬性值,須為陣列值
453
			$styleStr=css::styleStr($conf["css::styleStr"]);
453
			$styleStr=css::styleStr($conf["css::styleStr"]);
454
			unset($conf["css::styleStr"]);
454
			unset($conf["css::styleStr"]);
455
			
455
 
456
			#如果建立 style 字串失敗
456
			#如果建立 style 字串失敗
457
			if($styleStr["status"]=="false"){
457
			if($styleStr["status"]=="false"){
458
				
458
 
459
				#設置執行失敗
459
				#設置執行失敗
460
				$result["status"]="false";
460
				$result["status"]="false";
461
				
461
 
462
				#設置錯誤訊息
462
				#設置錯誤訊息
463
				$result["error"]=$styleStr;
463
				$result["error"]=$styleStr;
464
				
464
 
465
				#回傳結果
465
				#回傳結果
466
				return $result;
466
				return $result;
467
				
467
 
468
				}#if end			
468
				}#if end
469
		
469
 
470
			#取得 style 字串
470
			#取得 style 字串
471
			$style=$styleStr["content"];
471
			$style=$styleStr["content"];
472
			
472
 
473
			}#if end							
473
			}#if end
474
 
474
 
475
		#放置超連結的語法
475
		#放置超連結的語法
476
		$result["content"]="<a href= ".$conf["position"]." ".$conf["method"]." ".$conf["class"]." ".$conf["id"]."  ".$style." > ".$conf["linkName"]." </a>".$js;
476
		$result["content"]="<a href= ".$conf["position"]." ".$conf["method"]." ".$conf["class"]." ".$conf["id"]."  ".$style." > ".$conf["linkName"]." </a>".$js;
477
		
477
 
478
		#設置執行正常
478
		#設置執行正常
479
		$result["status"]="true";  
479
		$result["status"]="true";
480
		
480
 
481
		#回傳結果
481
		#回傳結果
482
		return $result;
482
		return $result;
483
		
483
 
484
		}#function show_link end
484
		}#function show_link end
485
 
485
 
486
	/*
486
	/*
487
	#函式說明:
487
	#函式說明:
488
	#放置圖片超鏈接
488
	#放置圖片超鏈接
Line 509... Line 509...
509
	*/
509
	*/
510
	public static function showImgLink(&$conf){
510
	public static function showImgLink(&$conf){
511
 
511
 
512
		#初始化要回傳的內容
512
		#初始化要回傳的內容
513
		$result=array();
513
		$result=array();
514
		
514
 
515
		#取得當前執行的函數名稱
515
		#取得當前執行的函數名稱
516
		$result["function"]=__FUNCTION__;
516
		$result["function"]=__FUNCTION__;
517
		
517
 
518
		#初始化要回傳的語法
518
		#初始化要回傳的語法
519
		$result["content"]="";
519
		$result["content"]="";
520
		
520
 
521
		#如果 $conf 不為陣列
521
		#如果 $conf 不為陣列
522
		if(gettype($conf)!="array"){
522
		if(gettype($conf)!="array"){
523
			
523
 
524
			#設置執行失敗
524
			#設置執行失敗
525
			$result["status"]="false";
525
			$result["status"]="false";
526
			
526
 
527
			#設置執行錯誤訊息
527
			#設置執行錯誤訊息
528
			$result["error"][]="\$conf變數須為陣列形態";
528
			$result["error"][]="\$conf變數須為陣列形態";
529
 
529
 
530
			#如果傳入的參數為 null
530
			#如果傳入的參數為 null
531
			if($conf==null){
531
			if($conf==null){
532
				
532
 
533
				#設置執行錯誤訊息
533
				#設置執行錯誤訊息
534
				$result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
534
				$result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
535
				
535
 
536
				}#if end
536
				}#if end
537
 
537
 
538
			#回傳結果
538
			#回傳結果
539
			return $result;
539
			return $result;
540
			
540
 
541
			}#if end
541
			}#if end
542
		
542
 
543
		#檢查參數
543
		#檢查參數
544
		#函式說明:
544
		#函式說明:
545
		#檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容。
545
		#檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容。
546
		#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
546
		#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
547
		#$reuslt["error"],執行不正常結束的錯訊息陣列.
547
		#$reuslt["error"],執行不正常結束的錯訊息陣列.
Line 553... Line 553...
553
		#必填寫的參數:
553
		#必填寫的參數:
554
		#$conf["varInput"],陣列變數,要檢查的陣列變數,請在要檢查的參數前面加上&,這樣變動的結果才能被套用。
554
		#$conf["varInput"],陣列變數,要檢查的陣列變數,請在要檢查的參數前面加上&,這樣變動的結果才能被套用。
555
		$conf["variableCheck::checkArguments"]["varInput"]=&$conf;
555
		$conf["variableCheck::checkArguments"]["varInput"]=&$conf;
556
		#$conf["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
556
		#$conf["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
557
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("linkLocation","imgFilePosition");
557
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("linkLocation","imgFilePosition");
558
		#$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列 例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double"); 
558
		#$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列 例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double");
559
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("string","string");
559
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("string","string");
560
		#$conf["variableCheck::checkArguments"]["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
560
		#$conf["variableCheck::checkArguments"]["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
561
		$conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
561
		$conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
562
		#可以省略的參數:
562
		#可以省略的參數:
563
		#$conf["canBeEmptyString"],必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true"。
563
		#$conf["canBeEmptyString"],必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true"。
564
		#$conf["variableCheck::checkArguments"]["canBeEmptyString"]="true";
564
		#$conf["variableCheck::checkArguments"]["canBeEmptyString"]="true";
565
		#$conf["skipableVariableName"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
565
		#$conf["skipableVariableName"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
566
		$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("method","class","imgHeight","imgWidth","imgLinkName","no_outline");
566
		$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("method","class","imgHeight","imgWidth","imgLinkName","no_outline");
567
		#$conf["skipableVariableType"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double"); 
567
		#$conf["skipableVariableType"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double");
568
		$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("string","string","string","string","string","string");
568
		$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("string","string","string","string","string","string");
569
		#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,「null」代表不指定,若預設值是必填參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
569
		#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,「null」代表不指定,若預設值是必填參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
570
		$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array("_self","","","","","true");
570
		$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array("_self","","","","","true");
571
		#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
571
		#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
572
		#$conf["arrayCountEqualCheck"][]=array();
572
		#$conf["arrayCountEqualCheck"][]=array();
573
		$checkResult=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
573
		$checkResult=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
574
		unset($conf["variableCheck::checkArguments"]);
574
		unset($conf["variableCheck::checkArguments"]);
575
		
575
 
576
		#如果檢查參數失敗
576
		#如果檢查參數失敗
577
		if($checkResult["status"]=="false"){
577
		if($checkResult["status"]=="false"){
578
			
578
 
579
			#設置執行失敗
579
			#設置執行失敗
580
			$result["status"]="false";
580
			$result["status"]="false";
581
			
581
 
582
			#設置錯誤訊息
582
			#設置錯誤訊息
583
			$result["error"]=$checkResult;
583
			$result["error"]=$checkResult;
584
			
584
 
585
			#回傳結果
585
			#回傳結果
586
			return $result;
586
			return $result;
587
			
587
 
588
			}#if end
588
			}#if end
589
			
589
 
590
		#如果檢查參數不通過
590
		#如果檢查參數不通過
591
		if($checkResult["passed"]=="false"){
591
		if($checkResult["passed"]=="false"){
592
			
592
 
593
			#設置執行失敗
593
			#設置執行失敗
594
			$result["status"]="false";
594
			$result["status"]="false";
595
			
595
 
596
			#設置錯誤訊息
596
			#設置錯誤訊息
597
			$result["error"]=$checkResult;
597
			$result["error"]=$checkResult;
598
			
598
 
599
			#回傳結果
599
			#回傳結果
600
			return $result;
600
			return $result;
601
			
601
 
602
			}#if end
602
			}#if end
603
 
603
 
604
		#如果 $conf["imgHeight"] 不爲"",則設定圖片高度
604
		#如果 $conf["imgHeight"] 不爲"",則設定圖片高度
605
		if($conf["imgHeight"]!=""){
605
		if($conf["imgHeight"]!=""){
606
		
606
 
607
			$conf["imgHeight"]="height = ".$conf["imgHeight"];
607
			$conf["imgHeight"]="height = ".$conf["imgHeight"];
608
 
608
 
609
			}#if end
609
			}#if end
610
 
610
 
611
		#如果 $conf["imgWidth"] 不爲"",則設定圖片寬度
611
		#如果 $conf["imgWidth"] 不爲"",則設定圖片寬度
612
		if($conf["imgWidth"]!=""){
612
		if($conf["imgWidth"]!=""){
613
			
613
 
614
			$conf["imgWidth"]="width = ".$conf["imgWidth"];
614
			$conf["imgWidth"]="width = ".$conf["imgWidth"];
615
 
615
 
616
			}#if end
616
			}#if end
617
 
617
 
618
		#$conf["imgLinkName"] 不爲"",則設定圖片無法顯示時的替代文字。
618
		#$conf["imgLinkName"] 不爲"",則設定圖片無法顯示時的替代文字。
619
		if($conf["imgLinkName"]!=""){
619
		if($conf["imgLinkName"]!=""){
620
			
620
 
621
			$conf["imgLinkName"]="alt = ".$conf["imgLinkName"];
621
			$conf["imgLinkName"]="alt = ".$conf["imgLinkName"];
622
 
622
 
623
			}#if end
623
			}#if end
624
 
624
 
625
		#如果 $conf["class"] 不爲"",則設定css樣式。
625
		#如果 $conf["class"] 不爲"",則設定css樣式。
626
		if($conf["class"]!=""){
626
		if($conf["class"]!=""){
627
		
627
 
628
			$conf["class"]="class = ".$conf["class"];
628
			$conf["class"]="class = ".$conf["class"];
629
 
629
 
630
			}#if end
630
			}#if end
631
 
631
 
632
		#初始化 style 字串
632
		#初始化 style 字串
633
		$style="";
633
		$style="";
634
 
634
 
635
		#如果 $conf["no_outline"] 為 "true"
635
		#如果 $conf["no_outline"] 為 "true"
636
		if($conf["no_outline"]=="true"){
636
		if($conf["no_outline"]=="true"){
637
			
637
 
638
			#函式說明: 
638
			#函式說明:
639
			#建立給與html標籤使用的style屬性字串.
639
			#建立給與html標籤使用的style屬性字串.
640
			#回傳結果:
640
			#回傳結果:
641
			#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.		
641
			#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
642
			#$result["function"],當前執行的函數
642
			#$result["function"],當前執行的函數
643
			#$result["error"],錯誤訊息陣列
643
			#$result["error"],錯誤訊息陣列
644
			#$result["content"],css設定內容
644
			#$result["content"],css設定內容
645
			#必填參數:
645
			#必填參數:
646
			$conf["css::styleStr"]["styleName"]=array("outline","behavior");#為屬性名稱,須為陣列值
646
			$conf["css::styleStr"]["styleName"]=array("outline","behavior");#為屬性名稱,須為陣列值
647
			$conf["css::styleStr"]["styleValue"]=array("none","expression(this.onFocus=this.blur()); /* for IE */");#為屬性值,須為陣列值
647
			$conf["css::styleStr"]["styleValue"]=array("none","expression(this.onFocus=this.blur()); /* for IE */");#為屬性值,須為陣列值
648
			$styleStr=css::styleStr($conf["css::styleStr"]);
648
			$styleStr=css::styleStr($conf["css::styleStr"]);
649
			unset($conf["css::styleStr"]);
649
			unset($conf["css::styleStr"]);
650
			
650
 
651
			#如果建立 style 字串失敗
651
			#如果建立 style 字串失敗
652
			if($styleStr["status"]=="false"){
652
			if($styleStr["status"]=="false"){
653
				
653
 
654
				#設置執行失敗
654
				#設置執行失敗
655
				$result["status"]="false";
655
				$result["status"]="false";
656
				
656
 
657
				#設置錯誤訊息
657
				#設置錯誤訊息
658
				$result["error"]=$styleStr;
658
				$result["error"]=$styleStr;
659
				
659
 
660
				#回傳結果
660
				#回傳結果
661
				return $result;
661
				return $result;
662
				
662
 
663
				}#if end			
663
				}#if end
664
		
664
 
665
			#取得 style 字串
665
			#取得 style 字串
666
			$style=$styleStr["content"];
666
			$style=$styleStr["content"];
667
			
667
 
668
			}#if end
668
			}#if end
669
 
669
 
670
		#放置圖片超連結
670
		#放置圖片超連結
671
		$result["content"]=$result["content"]."<a href = ".$conf["linkLocation"]." target = ".$conf["method"]." ".$style." >";
671
		$result["content"]=$result["content"]."<a href = ".$conf["linkLocation"]." target = ".$conf["method"]." ".$style." >";
672
		$result["content"]=$result["content"]."<img src = ".$conf["imgFilePosition"]." ".$conf["imgWidth"]." ".$conf["imgHeight"]." ".$conf["imgLinkName"]." ".$conf["class"]." >";
672
		$result["content"]=$result["content"]."<img src = ".$conf["imgFilePosition"]." ".$conf["imgWidth"]." ".$conf["imgHeight"]." ".$conf["imgLinkName"]." ".$conf["class"]." >";
Line 690... Line 690...
690
	#$result["function"],當前執行的函數名稱
690
	#$result["function"],當前執行的函數名稱
691
	#必填參數:
691
	#必填參數:
692
	#$conf["linkLocation"],字串,爲連結的網路位置.
692
	#$conf["linkLocation"],字串,爲連結的網路位置.
693
	$conf["linkLocation"]="";
693
	$conf["linkLocation"]="";
694
	#$conf["content"],字串陣列,要放置的內容.
694
	#$conf["content"],字串陣列,要放置的內容.
695
	$conf["content"]=array(""); 
695
	$conf["content"]=array("");
696
	#可省略參數:
696
	#可省略參數:
697
	#$conf["class"],陣列,爲link的css類別名稱.
697
	#$conf["class"],陣列,爲link的css類別名稱.
698
	#$conf["class"]=array();
698
	#$conf["class"]=array();
699
	#$conf["method"],爲點選該連結之後,新畫面要如何呈現,可留空,可用的選項有 _top(覆蓋目前的視窗來顯現新內容) _parent(在目前的父頁面顯示新畫面) _blank(跳新視窗) _self(在自己的頁面呈現),預設爲 _self。
699
	#$conf["method"],爲點選該連結之後,新畫面要如何呈現,可留空,可用的選項有 _top(覆蓋目前的視窗來顯現新內容) _parent(在目前的父頁面顯示新畫面) _blank(跳新視窗) _self(在自己的頁面呈現),預設爲 _self。
700
	#$conf["method"]="";		
700
	#$conf["method"]="";
701
	#$conf["no_outline"],字串,是否要取消連結的框線,"false為不取消,"true"代表要取消,預設為"true".
701
	#$conf["no_outline"],字串,是否要取消連結的框線,"false為不取消,"true"代表要取消,預設為"true".
702
	#$conf["no_outline"]="";
702
	#$conf["no_outline"]="";
703
	#$conf["jsTrigger"],字串,要觸發的js函式,參數為事件自己.
703
	#$conf["jsTrigger"],字串,要觸發的js函式,參數為事件自己.
704
	#$conf["jsTrigger"]="";
704
	#$conf["jsTrigger"]="";
705
	#參考資料
705
	#參考資料
Line 709... Line 709...
709
	*/
709
	*/
710
	public static function aTagSection(&$conf){
710
	public static function aTagSection(&$conf){
711
 
711
 
712
		#初始化要回傳的內容
712
		#初始化要回傳的內容
713
		$result=array();
713
		$result=array();
714
		
714
 
715
		#取得當前執行的函數名稱
715
		#取得當前執行的函數名稱
716
		$result["function"]=__FUNCTION__;
716
		$result["function"]=__FUNCTION__;
717
		
717
 
718
		#初始化要回傳的語法
718
		#初始化要回傳的語法
719
		$result["content"]="";
719
		$result["content"]="";
720
		
720
 
721
		#如果 $conf 不為陣列
721
		#如果 $conf 不為陣列
722
		if(gettype($conf)!="array"){
722
		if(gettype($conf)!="array"){
723
			
723
 
724
			#設置執行失敗
724
			#設置執行失敗
725
			$result["status"]="false";
725
			$result["status"]="false";
726
			
726
 
727
			#設置執行錯誤訊息
727
			#設置執行錯誤訊息
728
			$result["error"][]="\$conf變數須為陣列形態";
728
			$result["error"][]="\$conf變數須為陣列形態";
729
 
729
 
730
			#如果傳入的參數為 null
730
			#如果傳入的參數為 null
731
			if($conf==null){
731
			if($conf==null){
732
				
732
 
733
				#設置執行錯誤訊息
733
				#設置執行錯誤訊息
734
				$result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
734
				$result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
735
				
735
 
736
				}#if end
736
				}#if end
737
 
737
 
738
			#回傳結果
738
			#回傳結果
739
			return $result;
739
			return $result;
740
			
740
 
741
			}#if end
741
			}#if end
742
		
742
 
743
		#檢查參數
743
		#檢查參數
744
		#函式說明:
744
		#函式說明:
745
		#檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容。
745
		#檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容。
746
		#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
746
		#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
747
		#$reuslt["error"],執行不正常結束的錯訊息陣列.
747
		#$reuslt["error"],執行不正常結束的錯訊息陣列.
Line 753... Line 753...
753
		#必填寫的參數:
753
		#必填寫的參數:
754
		#$conf["varInput"],陣列變數,要檢查的陣列變數,請在要檢查的參數前面加上&,這樣變動的結果才能被套用。
754
		#$conf["varInput"],陣列變數,要檢查的陣列變數,請在要檢查的參數前面加上&,這樣變動的結果才能被套用。
755
		$conf["variableCheck::checkArguments"]["varInput"]=&$conf;
755
		$conf["variableCheck::checkArguments"]["varInput"]=&$conf;
756
		#$conf["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
756
		#$conf["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
757
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("linkLocation","content");
757
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("linkLocation","content");
758
		#$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列 例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double"); 
758
		#$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列 例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double");
759
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("string","array");
759
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("string","array");
760
		#$conf["variableCheck::checkArguments"]["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
760
		#$conf["variableCheck::checkArguments"]["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
761
		$conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
761
		$conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
762
		#可以省略的參數:
762
		#可以省略的參數:
763
		#$conf["canBeEmptyString"],必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true"。
763
		#$conf["canBeEmptyString"],必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true"。
764
		#$conf["variableCheck::checkArguments"]["canBeEmptyString"]="true";
764
		#$conf["variableCheck::checkArguments"]["canBeEmptyString"]="true";
765
		#$conf["skipableVariableName"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
765
		#$conf["skipableVariableName"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
766
		$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("method","class","no_outline","jsTrigger");
766
		$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("method","class","no_outline","jsTrigger");
767
		#$conf["skipableVariableType"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double"); 
767
		#$conf["skipableVariableType"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double");
768
		$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("string","array","string","string");
768
		$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("string","array","string","string");
769
		#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,「null」代表不指定,若預設值是必填參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
769
		#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,「null」代表不指定,若預設值是必填參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
770
		$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array("_self",null,"true",null);
770
		$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array("_self",null,"true",null);
771
		#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
771
		#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
772
		#$conf["arrayCountEqualCheck"][]=array();
772
		#$conf["arrayCountEqualCheck"][]=array();
773
		$checkResult=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
773
		$checkResult=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
774
		unset($conf["variableCheck::checkArguments"]);
774
		unset($conf["variableCheck::checkArguments"]);
775
		
775
 
776
		#如果檢查參數失敗
776
		#如果檢查參數失敗
777
		if($checkResult["status"]=="false"){
777
		if($checkResult["status"]=="false"){
778
			
778
 
779
			#設置執行失敗
779
			#設置執行失敗
780
			$result["status"]="false";
780
			$result["status"]="false";
781
			
781
 
782
			#設置錯誤訊息
782
			#設置錯誤訊息
783
			$result["error"]=$checkResult;
783
			$result["error"]=$checkResult;
784
			
784
 
785
			#回傳結果
785
			#回傳結果
786
			return $result;
786
			return $result;
787
			
787
 
788
			}#if end
788
			}#if end
789
			
789
 
790
		#如果檢查參數不通過
790
		#如果檢查參數不通過
791
		if($checkResult["passed"]=="false"){
791
		if($checkResult["passed"]=="false"){
792
			
792
 
793
			#設置執行失敗
793
			#設置執行失敗
794
			$result["status"]="false";
794
			$result["status"]="false";
795
			
795
 
796
			#設置錯誤訊息
796
			#設置錯誤訊息
797
			$result["error"]=$checkResult;
797
			$result["error"]=$checkResult;
798
			
798
 
799
			#回傳結果
799
			#回傳結果
800
			return $result;
800
			return $result;
801
			
801
 
802
			}#if end
802
			}#if end
803
	
803
 
804
		#初始化 style 字串
804
		#初始化 style 字串
805
		$style="";
805
		$style="";
806
 
806
 
807
		#如果 $conf["no_outline"] 為 "true"
807
		#如果 $conf["no_outline"] 為 "true"
808
		if($conf["no_outline"]==="true"){
808
		if($conf["no_outline"]==="true"){
809
			
809
 
810
			#函式說明: 
810
			#函式說明:
811
			#建立給與html標籤使用的style屬性字串.
811
			#建立給與html標籤使用的style屬性字串.
812
			#回傳結果:
812
			#回傳結果:
813
			#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.		
813
			#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
814
			#$result["function"],當前執行的函數
814
			#$result["function"],當前執行的函數
815
			#$result["error"],錯誤訊息陣列
815
			#$result["error"],錯誤訊息陣列
816
			#$result["content"],css設定內容
816
			#$result["content"],css設定內容
817
			#必填參數:
817
			#必填參數:
818
			$conf["css::styleStr"]["styleName"]=array("text-decoration","outline","behavior");#為屬性名稱,須為陣列值
818
			$conf["css::styleStr"]["styleName"]=array("text-decoration","outline","behavior");#為屬性名稱,須為陣列值
819
			$conf["css::styleStr"]["styleValue"]=array("none","none","expression(this.onFocus=this.blur()); /* for IE */");#為屬性值,須為陣列值
819
			$conf["css::styleStr"]["styleValue"]=array("none","none","expression(this.onFocus=this.blur()); /* for IE */");#為屬性值,須為陣列值
820
			$styleStr=css::styleStr($conf["css::styleStr"]);
820
			$styleStr=css::styleStr($conf["css::styleStr"]);
821
			unset($conf["css::styleStr"]);
821
			unset($conf["css::styleStr"]);
822
			
822
 
823
			#如果建立 style 字串失敗
823
			#如果建立 style 字串失敗
824
			if($styleStr["status"]=="false"){
824
			if($styleStr["status"]=="false"){
825
				
825
 
826
				#設置執行失敗
826
				#設置執行失敗
827
				$result["status"]="false";
827
				$result["status"]="false";
828
				
828
 
829
				#設置錯誤訊息
829
				#設置錯誤訊息
830
				$result["error"]=$styleStr;
830
				$result["error"]=$styleStr;
831
				
831
 
832
				#回傳結果
832
				#回傳結果
833
				return $result;
833
				return $result;
834
				
834
 
835
				}#if end			
835
				}#if end
836
		
836
 
837
			#取得 style 字串
837
			#取得 style 字串
838
			$style=$styleStr["content"];
838
			$style=$styleStr["content"];
839
			
839
 
840
			}#if end
840
			}#if end
841
 
841
 
842
		#初始化 class 字串
842
		#初始化 class 字串
843
		$class="";
843
		$class="";
844
	
844
 
845
		#如果有設定 class
845
		#如果有設定 class
846
		if(isset($conf["class"])){
846
		if(isset($conf["class"])){
847
	
847
 
848
			#涵式說明:
848
			#涵式說明:
849
			#建立class屬性字串,亦即套用多個class樣式的設定字串.
849
			#建立class屬性字串,亦即套用多個class樣式的設定字串.
850
			#回傳結果:
850
			#回傳結果:
851
			#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
851
			#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
852
			#$result["function"],當前執行的函數
852
			#$result["function"],當前執行的函數
Line 855... Line 855...
855
			#必填參數:
855
			#必填參數:
856
			#$conf["class"],字串陣列,要套用的類別樣式名稱.
856
			#$conf["class"],字串陣列,要套用的類別樣式名稱.
857
			$conf["css::classStr"]["class"]=$conf["class"];
857
			$conf["css::classStr"]["class"]=$conf["class"];
858
			$classStr=css::classStr($conf["css::classStr"]);
858
			$classStr=css::classStr($conf["css::classStr"]);
859
			unset($conf["css::classStr"]);
859
			unset($conf["css::classStr"]);
860
		
860
 
861
			#如果建立 style 字串失敗
861
			#如果建立 style 字串失敗
862
			if($classStr["status"]=="false"){
862
			if($classStr["status"]=="false"){
863
				
863
 
864
				#設置執行失敗
864
				#設置執行失敗
865
				$result["status"]="false";
865
				$result["status"]="false";
866
				
866
 
867
				#設置錯誤訊息
867
				#設置錯誤訊息
868
				$result["error"]=$classStr;
868
				$result["error"]=$classStr;
869
				
869
 
870
				#回傳結果
870
				#回傳結果
871
				return $result;
871
				return $result;
872
				
872
 
873
				}#if end	
873
				}#if end
874
 
874
 
875
			#取得 class 設定字串
875
			#取得 class 設定字串
876
			$class=$classStr["content"];
876
			$class=$classStr["content"];
877
		
877
 
878
			}#if end
878
			}#if end
879
 
879
 
880
		#初始化點擊後要觸發的js語法
880
		#初始化點擊後要觸發的js語法
881
		$jsTrigger="";
881
		$jsTrigger="";
882
			
882
 
883
		#如果有設置 $conf["jsTrigger"]
883
		#如果有設置 $conf["jsTrigger"]
884
		if(isset($conf["jsTrigger"])){
884
		if(isset($conf["jsTrigger"])){
885
		
885
 
886
			#設置點擊觸發的事件
886
			#設置點擊觸發的事件
887
			$jsTrigger="onclick=".$conf["jsTrigger"]."(this)";
887
			$jsTrigger="onclick=".$conf["jsTrigger"]."(this)";
888
		
888
 
889
			}#if end
889
			}#if end
890
 
890
 
891
		#放置圖片超連結 - start
891
		#放置圖片超連結 - start
892
		$result["content"]=$result["content"]."<a ".$class." href=\"".$conf["linkLocation"]."\" target =\"".$conf["method"]."\" ".$style." ".$jsTrigger." >";
892
		$result["content"]=$result["content"]."<a ".$class." href=\"".$conf["linkLocation"]."\" target =\"".$conf["method"]."\" ".$style." ".$jsTrigger." >";
893
		
893
 
894
		#針對每個要放置的內容
894
		#針對每個要放置的內容
895
		foreach($conf["content"] as $content){
895
		foreach($conf["content"] as $content){
896
 
896
 
897
			#串接內容
897
			#串接內容
898
			$result["content"]=$result["content"].$content;
898
			$result["content"]=$result["content"].$content;
Line 920... Line 920...
920
	#$result["function"],當前執行的函數名稱
920
	#$result["function"],當前執行的函數名稱
921
	#必填參數:
921
	#必填參數:
922
	#$conf["phone"],字串,爲要撥打的號碼.
922
	#$conf["phone"],字串,爲要撥打的號碼.
923
	$conf["phone"]="";
923
	$conf["phone"]="";
924
	#$conf["content"],字串,要顯示的內容.
924
	#$conf["content"],字串,要顯示的內容.
925
	$conf["content"]=""; 
925
	$conf["content"]="";
926
	#可省略參數:
926
	#可省略參數:
927
	#$conf["class"],陣列,爲link的css類別名稱.
927
	#$conf["class"],陣列,爲link的css類別名稱.
928
	#$conf["class"]=array();		
928
	#$conf["class"]=array();
929
	#參考資料
929
	#參考資料
930
	#無.
930
	#無.
931
	#備註:
931
	#備註:
932
	#無.
932
	#無.
933
	*/
933
	*/
934
	public static function call(&$conf){
934
	public static function call(&$conf){
935
	
935
 
936
		#初始化要回傳的內容
936
		#初始化要回傳的內容
937
		$result=array();
937
		$result=array();
938
		
938
 
939
		#取得當前執行的函數名稱
939
		#取得當前執行的函數名稱
940
		$result["function"]=__FUNCTION__;
940
		$result["function"]=__FUNCTION__;
941
		
941
 
942
		#初始化要回傳的語法
942
		#初始化要回傳的語法
943
		$result["content"]="";
943
		$result["content"]="";
944
		
944
 
945
		#如果 $conf 不為陣列
945
		#如果 $conf 不為陣列
946
		if(gettype($conf)!="array"){
946
		if(gettype($conf)!="array"){
947
			
947
 
948
			#設置執行失敗
948
			#設置執行失敗
949
			$result["status"]="false";
949
			$result["status"]="false";
950
			
950
 
951
			#設置執行錯誤訊息
951
			#設置執行錯誤訊息
952
			$result["error"][]="\$conf變數須為陣列形態";
952
			$result["error"][]="\$conf變數須為陣列形態";
953
 
953
 
954
			#如果傳入的參數為 null
954
			#如果傳入的參數為 null
955
			if($conf==null){
955
			if($conf==null){
956
				
956
 
957
				#設置執行錯誤訊息
957
				#設置執行錯誤訊息
958
				$result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
958
				$result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
959
				
959
 
960
				}#if end
960
				}#if end
961
 
961
 
962
			#回傳結果
962
			#回傳結果
963
			return $result;
963
			return $result;
964
			
964
 
965
			}#if end
965
			}#if end
966
			
966
 
967
		#取得使用的參數
967
		#取得使用的參數
968
		$result["argu"]=$conf;
968
		$result["argu"]=$conf;
969
		
969
 
970
		#檢查參數
970
		#檢查參數
971
		#函式說明:
971
		#函式說明:
972
		#檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容。
972
		#檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容。
973
		#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
973
		#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
974
		#$reuslt["error"],執行不正常結束的錯訊息陣列.
974
		#$reuslt["error"],執行不正常結束的錯訊息陣列.
Line 980... Line 980...
980
		#必填寫的參數:
980
		#必填寫的參數:
981
		#$conf["varInput"],陣列變數,要檢查的陣列變數,請在要檢查的參數前面加上&,這樣變動的結果才能被套用。
981
		#$conf["varInput"],陣列變數,要檢查的陣列變數,請在要檢查的參數前面加上&,這樣變動的結果才能被套用。
982
		$conf["variableCheck::checkArguments"]["varInput"]=&$conf;
982
		$conf["variableCheck::checkArguments"]["varInput"]=&$conf;
983
		#$conf["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
983
		#$conf["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
984
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("phone","content");
984
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("phone","content");
985
		#$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列 例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double"); 
985
		#$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列 例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double");
986
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("string","string");
986
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("string","string");
987
		#$conf["variableCheck::checkArguments"]["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
987
		#$conf["variableCheck::checkArguments"]["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
988
		$conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
988
		$conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
989
		#可以省略的參數:
989
		#可以省略的參數:
990
		#$conf["canBeEmptyString"],必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true"。
990
		#$conf["canBeEmptyString"],必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true"。
991
		#$conf["variableCheck::checkArguments"]["canBeEmptyString"]="true";
991
		#$conf["variableCheck::checkArguments"]["canBeEmptyString"]="true";
992
		#$conf["skipableVariableName"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
992
		#$conf["skipableVariableName"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
993
		$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("class");
993
		$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("class");
994
		#$conf["skipableVariableType"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double"); 
994
		#$conf["skipableVariableType"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double");
995
		$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("array");
995
		$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("array");
996
		#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,「null」代表不指定,若預設值是必填參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
996
		#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,「null」代表不指定,若預設值是必填參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
997
		$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array(null);
997
		$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array(null);
998
		#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
998
		#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
999
		#$conf["arrayCountEqualCheck"][]=array();
999
		#$conf["arrayCountEqualCheck"][]=array();
1000
		$checkResult=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
1000
		$checkResult=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
1001
		unset($conf["variableCheck::checkArguments"]);
1001
		unset($conf["variableCheck::checkArguments"]);
1002
		
1002
 
1003
		#如果檢查參數失敗
1003
		#如果檢查參數失敗
1004
		if($checkResult["status"]=="false"){
1004
		if($checkResult["status"]=="false"){
1005
			
1005
 
1006
			#設置執行失敗
1006
			#設置執行失敗
1007
			$result["status"]="false";
1007
			$result["status"]="false";
1008
			
1008
 
1009
			#設置錯誤訊息
1009
			#設置錯誤訊息
1010
			$result["error"]=$checkResult;
1010
			$result["error"]=$checkResult;
1011
			
1011
 
1012
			#回傳結果
1012
			#回傳結果
1013
			return $result;
1013
			return $result;
1014
			
1014
 
1015
			}#if end
1015
			}#if end
1016
			
1016
 
1017
		#如果檢查參數不通過
1017
		#如果檢查參數不通過
1018
		if($checkResult["passed"]=="false"){
1018
		if($checkResult["passed"]=="false"){
1019
			
1019
 
1020
			#設置執行失敗
1020
			#設置執行失敗
1021
			$result["status"]="false";
1021
			$result["status"]="false";
1022
			
1022
 
1023
			#設置錯誤訊息
1023
			#設置錯誤訊息
1024
			$result["error"]=$checkResult;
1024
			$result["error"]=$checkResult;
1025
			
1025
 
1026
			#回傳結果
1026
			#回傳結果
1027
			return $result;
1027
			return $result;
1028
			
1028
 
1029
			}#if end
1029
			}#if end
1030
	
1030
 
1031
		#函式說明:
1031
		#函式說明:
1032
		#放置超鏈接,裏面可以放各種內容.
1032
		#放置超鏈接,裏面可以放各種內容.
1033
		#回傳內容:
1033
		#回傳內容:
1034
		#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
1034
		#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
1035
		#$result["error"],錯誤訊息
1035
		#$result["error"],錯誤訊息
Line 1037... Line 1037...
1037
		#$result["function"],當前執行的函數名稱
1037
		#$result["function"],當前執行的函數名稱
1038
		#必填參數:
1038
		#必填參數:
1039
		#$conf["linkLocation"],字串,爲連結的網路位置.
1039
		#$conf["linkLocation"],字串,爲連結的網路位置.
1040
		$conf["link::aTagSection"]["linkLocation"]="tel:".$conf["phone"];
1040
		$conf["link::aTagSection"]["linkLocation"]="tel:".$conf["phone"];
1041
		#$conf["content"],字串陣列,要放置的內容.
1041
		#$conf["content"],字串陣列,要放置的內容.
1042
		$conf["link::aTagSection"]["content"]=array($conf["content"]); 
1042
		$conf["link::aTagSection"]["content"]=array($conf["content"]);
1043
		#可省略參數:
1043
		#可省略參數:
1044
		
1044
 
1045
		#如果有設定 class
1045
		#如果有設定 class
1046
		if(isset($conf["class"])){
1046
		if(isset($conf["class"])){
1047
		
1047
 
1048
			#$conf["class"],陣列,爲link的css類別名稱.
1048
			#$conf["class"],陣列,爲link的css類別名稱.
1049
			$conf["link::aTagSection"]["class"]=$conf["class"];
1049
			$conf["link::aTagSection"]["class"]=$conf["class"];
1050
		
1050
 
1051
			}#if end
1051
			}#if end
1052
		
1052
 
1053
		#$conf["method"],爲點選該連結之後,新畫面要如何呈現,可留空,可用的選項有 _top(覆蓋目前的視窗來顯現新內容) _parent(在目前的父頁面顯示新畫面) _blank(跳新視窗) _self(在自己的頁面呈現),預設爲 _self。
1053
		#$conf["method"],爲點選該連結之後,新畫面要如何呈現,可留空,可用的選項有 _top(覆蓋目前的視窗來顯現新內容) _parent(在目前的父頁面顯示新畫面) _blank(跳新視窗) _self(在自己的頁面呈現),預設爲 _self。
1054
		#$conf["method"]="";		
1054
		#$conf["method"]="";
1055
		#$conf["no_outline"],字串,是否要取消連結的框線,"false為不取消,"true"代表要取消,預設為"true".
1055
		#$conf["no_outline"],字串,是否要取消連結的框線,"false為不取消,"true"代表要取消,預設為"true".
1056
		#$conf["no_outline"]="";
1056
		#$conf["no_outline"]="";
1057
		$aTagSection=link::aTagSection($conf["link::aTagSection"]);
1057
		$aTagSection=link::aTagSection($conf["link::aTagSection"]);
1058
		unset($conf["link::aTagSection"]);
1058
		unset($conf["link::aTagSection"]);
1059
	
1059
 
1060
		#如果檢查參數失敗
1060
		#如果檢查參數失敗
1061
		if($aTagSection["status"]=="false"){
1061
		if($aTagSection["status"]=="false"){
1062
			
1062
 
1063
			#設置執行失敗
1063
			#設置執行失敗
1064
			$result["status"]="false";
1064
			$result["status"]="false";
1065
			
1065
 
1066
			#設置錯誤訊息
1066
			#設置錯誤訊息
1067
			$result["error"]=$aTagSection;
1067
			$result["error"]=$aTagSection;
1068
			
1068
 
1069
			#回傳結果
1069
			#回傳結果
1070
			return $result;
1070
			return $result;
1071
			
1071
 
1072
			}#if end
1072
			}#if end
1073
			
1073
 
1074
		#取得內容
1074
		#取得內容
1075
		$result["content"]=$aTagSection["content"];
1075
		$result["content"]=$aTagSection["content"];
1076
		
1076
 
1077
		#設置執行結果
1077
		#設置執行結果
1078
		$result["status"]="true";
1078
		$result["status"]="true";
1079
	
1079
 
1080
		#回傳結果
1080
		#回傳結果
1081
		return $result;
1081
		return $result;
1082
	
1082
 
1083
		}#function call end 
1083
		}#function call end
1084
 
1084
 
1085
	}#class link end
1085
	}#class link end
1086
 
1086
 
1087
?>
1087
?>