Subversion Repositories php-qbpwcf

Rev

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

Rev 30 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~2025 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 43... Line 43...
43
	#$arguments,陣列,為呼叫方法時所用的參數.
43
	#$arguments,陣列,為呼叫方法時所用的參數.
44
	#參考資料:
44
	#參考資料:
45
	#__call=>http://php.net/manual/en/language.oop5.overloading.php#object.callstatic
45
	#__call=>http://php.net/manual/en/language.oop5.overloading.php#object.callstatic
46
	*/
46
	*/
47
	public function __call($method,$arguments){
47
	public function __call($method,$arguments){
48
		
48
 
49
		#取得當前執行的函式
49
		#取得當前執行的函式
50
		$result["function"]=__FUNCTION__;
50
		$result["function"]=__FUNCTION__;
51
		
51
 
52
		#設置執行不正常
52
		#設置執行不正常
53
		$result["status"]="false";
53
		$result["status"]="false";
54
		
54
 
55
		#設置執行錯誤
55
		#設置執行錯誤
56
		$result["error"][]=__NAMESPACE__ ."/".$method."() 不存在!";
56
		$result["error"][]=__NAMESPACE__ ."/".$method."() 不存在!";
57
		
57
 
58
		#設置所丟入的參數
58
		#設置所丟入的參數
59
		$result["error"][]=$arguments;
59
		$result["error"][]=$arguments;
60
		
60
 
61
		#回傳結果
61
		#回傳結果
62
		return $result;
62
		return $result;
63
		
63
 
64
		}#function __call end
64
		}#function __call end
65
		
65
 
66
	/*
66
	/*
67
	#函式說明:
67
	#函式說明:
68
	#當前類別被呼叫的靜態方法不存在時,將會執行該函數,回報該方法不存在.
68
	#當前類別被呼叫的靜態方法不存在時,將會執行該函數,回報該方法不存在.
69
	#回傳結果:
69
	#回傳結果:
70
	#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
70
	#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
Line 75... Line 75...
75
	#$arguments,陣列,為呼叫方法時所用的參數.
75
	#$arguments,陣列,為呼叫方法時所用的參數.
76
	#參考資料:
76
	#參考資料:
77
	#__call=>http://php.net/manual/en/language.oop5.overloading.php#object.callstatic
77
	#__call=>http://php.net/manual/en/language.oop5.overloading.php#object.callstatic
78
	*/
78
	*/
79
	public static function __callStatic($method,$arguments){
79
	public static function __callStatic($method,$arguments){
80
		
80
 
81
		#取得當前執行的函式
81
		#取得當前執行的函式
82
		$result["function"]=__FUNCTION__;
82
		$result["function"]=__FUNCTION__;
83
		
83
 
84
		#設置執行不正常
84
		#設置執行不正常
85
		$result["status"]="false";
85
		$result["status"]="false";
86
		
86
 
87
		#設置執行錯誤
87
		#設置執行錯誤
88
		$result["error"][]="欲呼叫的". __NAMESPACE__ ."/".$method."() 不存在!";
88
		$result["error"][]="欲呼叫的". __NAMESPACE__ ."/".$method."() 不存在!";
89
		
89
 
90
		#設置所丟入的參數
90
		#設置所丟入的參數
91
		$result["error"][]=$arguments;
91
		$result["error"][]=$arguments;
92
		
92
 
93
		#回傳結果
93
		#回傳結果
94
		return $result;
94
		return $result;
95
		
95
 
96
		}#function __callStatic end
96
		}#function __callStatic end
97
 
97
 
98
	/*
98
	/*
99
	#函式說明:
99
	#函式說明:
100
	#建立一個 iframe 框架
100
	#建立一個 iframe 框架
Line 111... Line 111...
111
	#$conf["br"],字串,爲放置完該iframe後是否要換行,"true"爲要換行;"flase"爲不要換行。
111
	#$conf["br"],字串,爲放置完該iframe後是否要換行,"true"爲要換行;"flase"爲不要換行。
112
	$conf["br"]="true";
112
	$conf["br"]="true";
113
	#可省略參數:
113
	#可省略參數:
114
	#$conf["class"],字串陣列,爲該 iframe 要套用的css樣式類別名稱.
114
	#$conf["class"],字串陣列,爲該 iframe 要套用的css樣式類別名稱.
115
	#$conf["class"]=array("");
115
	#$conf["class"]=array("");
116
	#$conf["scrolling"],字串,是否要取消滾軸功能,"false"代表取消滾軸功能. 
116
	#$conf["scrolling"],字串,是否要取消滾軸功能,"false"代表取消滾軸功能.
117
	#$conf["scrolling"]="";
117
	#$conf["scrolling"]="";
118
	#$conf["width"],字串,iframe的寬度.
118
	#$conf["width"],字串,iframe的寬度.
119
	#$conf["width"]="";
119
	#$conf["width"]="";
120
	#$conf["height"],字串,iframe的高度.
120
	#$conf["height"],字串,iframe的高度.
121
	#$conf["height"]="";
121
	#$conf["height"]="";
Line 139... Line 139...
139
	#https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#sandbox
139
	#https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#sandbox
140
	#備註:
140
	#備註:
141
	#無.
141
	#無.
142
	*/
142
	*/
143
	public static function createIframe(&$conf){
143
	public static function createIframe(&$conf){
144
	
144
 
145
		#初始化要回傳的結果
145
		#初始化要回傳的結果
146
		$result=array();
146
		$result=array();
147
 
147
 
148
		#取得當前執行的函數名稱
148
		#取得當前執行的函數名稱
149
		$result["function"]=__FUNCTION__;
149
		$result["function"]=__FUNCTION__;
150
 
150
 
151
		#如果沒有參數
151
		#如果沒有參數
152
		if(func_num_args()==0){
152
		if(func_num_args()==0){
153
			
153
 
154
			#設置執行失敗
154
			#設置執行失敗
155
			$result["status"]="false";
155
			$result["status"]="false";
156
			
156
 
157
			#設置執行錯誤訊息
157
			#設置執行錯誤訊息
158
			$result["error"]="函數".$result["function"]."需要參數";
158
			$result["error"]="函數".$result["function"]."需要參數";
159
			
159
 
160
			#回傳結果
160
			#回傳結果
161
			return $result;
161
			return $result;
162
			
162
 
163
			}#if end
163
			}#if end
164
 
164
 
165
		#取得參數
165
		#取得參數
166
		$result["argu"]=$conf;
166
		$result["argu"]=$conf;
167
 
167
 
168
		#如果 $conf 不為陣列
168
		#如果 $conf 不為陣列
169
		if(gettype($conf)!=="array"){
169
		if(gettype($conf)!=="array"){
170
			
170
 
171
			#設置執行失敗
171
			#設置執行失敗
172
			$result["status"]="false";
172
			$result["status"]="false";
173
			
173
 
174
			#設置執行錯誤訊息
174
			#設置執行錯誤訊息
175
			$result["error"][]="\$conf變數須為陣列形態";
175
			$result["error"][]="\$conf變數須為陣列形態";
176
			
176
 
177
			#如果傳入的參數為 null
177
			#如果傳入的參數為 null
178
			if($conf===null){
178
			if($conf===null){
179
				
179
 
180
				#設置執行錯誤訊息
180
				#設置執行錯誤訊息
181
				$result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
181
				$result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
182
				
182
 
183
				}#if end
183
				}#if end
184
 
184
 
185
			#回傳結果
185
			#回傳結果
186
			return $result;
186
			return $result;
187
			
187
 
188
			}#if end
188
			}#if end
189
		
189
 
190
		#檢查參數
190
		#檢查參數
191
		#函式說明:
191
		#函式說明:
192
		#檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容。
192
		#檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容。
193
		#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
193
		#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
194
		#$reuslt["error"],執行不正常結束的錯訊息陣列.
194
		#$reuslt["error"],執行不正常結束的錯訊息陣列.
Line 200... Line 200...
200
		#必填寫的參數:
200
		#必填寫的參數:
201
		#$conf["varInput"],陣列變數,要檢查的陣列變數,請在要檢查的參數前面加上&,這樣變動的結果才能被套用。
201
		#$conf["varInput"],陣列變數,要檢查的陣列變數,請在要檢查的參數前面加上&,這樣變動的結果才能被套用。
202
		$conf["variableCheck::checkArguments"]["varInput"]=&$conf;
202
		$conf["variableCheck::checkArguments"]["varInput"]=&$conf;
203
		#$conf["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
203
		#$conf["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
204
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("webPage","name","br");
204
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("webPage","name","br");
205
		#$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列 例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double"); 
205
		#$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列 例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double");
206
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("string","string","string");
206
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("string","string","string");
207
		#$conf["variableCheck::checkArguments"]["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
207
		#$conf["variableCheck::checkArguments"]["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
208
		$conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
208
		$conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
209
		#可以省略的參數:
209
		#可以省略的參數:
210
		#$conf["canBeEmptyString"],必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true"。
210
		#$conf["canBeEmptyString"],必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true"。
211
		#$conf["variableCheck::checkArguments"]["canBeEmptyString"]="true";
211
		#$conf["variableCheck::checkArguments"]["canBeEmptyString"]="true";
212
		#$conf["skipableVariableName"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
212
		#$conf["skipableVariableName"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
213
		$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("class","scrolling","width","height","minWidth","maxWidth","minHeight","maxHeight","soucreId","sandbox","extraAttrAndValue","frameExtraAttrAndValue");
213
		$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("class","scrolling","width","height","minWidth","maxWidth","minHeight","maxHeight","soucreId","sandbox","extraAttrAndValue","frameExtraAttrAndValue");
214
		#$conf["skipableVariableType"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double"); 
214
		#$conf["skipableVariableType"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double");
215
		$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("array","string","string","string","string","string","string","string","string","string","array","array");
215
		$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("array","string","string","string","string","string","string","string","string","string","array","array");
216
		#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,null代表不指定,若預設值是必填參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
216
		#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,null代表不指定,若預設值是必填參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
217
		$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array(null,"true",null,null,null,null,null,null,null,"false",null,null);
217
		$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array(null,"true",null,null,null,null,null,null,null,"false",null,null);
218
		#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
218
		#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
219
		#$conf["arrayCountEqualCheck"][]=array();
219
		#$conf["arrayCountEqualCheck"][]=array();
220
		$checkResult=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
220
		$checkResult=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
221
		unset($conf["variableCheck::checkArguments"]);
221
		unset($conf["variableCheck::checkArguments"]);
222
		
222
 
223
		#如果檢查失敗
223
		#如果檢查失敗
224
		if($checkResult["status"]=="false"){
224
		if($checkResult["status"]=="false"){
225
			
225
 
226
			#設置執行不正常
226
			#設置執行不正常
227
			$result["status"]="false";
227
			$result["status"]="false";
228
			
228
 
229
			#設置錯誤訊息
229
			#設置錯誤訊息
230
			$result["error"]=$checkResult;
230
			$result["error"]=$checkResult;
231
			
231
 
232
			#回傳結果
232
			#回傳結果
233
			return $result;
233
			return $result;
234
			
234
 
235
			}#if end
235
			}#if end
236
			
236
 
237
		#如果檢查不通過
237
		#如果檢查不通過
238
		if($checkResult["passed"]=="false"){
238
		if($checkResult["passed"]=="false"){
239
			
239
 
240
			#設置執行不正常
240
			#設置執行不正常
241
			$result["status"]="false";
241
			$result["status"]="false";
242
			
242
 
243
			#設置錯誤訊息
243
			#設置錯誤訊息
244
			$result["error"]=$checkResult;
244
			$result["error"]=$checkResult;
245
			
245
 
246
			#回傳結果
246
			#回傳結果
247
			return $result;
247
			return $result;
248
			
248
 
249
			}#if end
249
			}#if end
250
	
250
 
251
		#如果$conf["class"]不存在
251
		#如果$conf["class"]不存在
252
		if(!isset($conf["class"])){
252
		if(!isset($conf["class"])){
253
			
253
 
254
			#不設定要套用的類別樣式
254
			#不設定要套用的類別樣式
255
			$conf["frameCssStyle"]="";
255
			$conf["frameCssStyle"]="";
256
 
256
 
257
			}#if end
257
			}#if end
258
 
258
 
Line 261... Line 261...
261
 
261
 
262
			#取得class字串
262
			#取得class字串
263
			#涵式說明:
263
			#涵式說明:
264
			#建立class屬性字串,亦即套用多個class樣式的設定字串.
264
			#建立class屬性字串,亦即套用多個class樣式的設定字串.
265
			#回傳結果:
265
			#回傳結果:
266
			#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.		
266
			#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
267
			#$result["function"],當前執行的函數
267
			#$result["function"],當前執行的函數
268
			#$result["error"],錯誤訊息陣列
268
			#$result["error"],錯誤訊息陣列
269
			#$result["content"],class屬性字串的內容
269
			#$result["content"],class屬性字串的內容
270
			#必填參數:
270
			#必填參數:
271
			#$conf["class"],字串陣列,要套用的類別樣式名稱.
271
			#$conf["class"],字串陣列,要套用的類別樣式名稱.
272
			$conf["css::classStr"]["class"]=$conf["class"];
272
			$conf["css::classStr"]["class"]=$conf["class"];
273
			$classStr=css::classStr($conf["css::classStr"]);
273
			$classStr=css::classStr($conf["css::classStr"]);
274
			unset($conf["css::classStr"]);
274
			unset($conf["css::classStr"]);
275
			
275
 
276
			#如果建立class類別字串失敗
276
			#如果建立class類別字串失敗
277
			if($classStr["status"]=="false"){
277
			if($classStr["status"]=="false"){
278
				
278
 
279
				#設置執行不正常
279
				#設置執行不正常
280
				$result["status"]="false";
280
				$result["status"]="false";
281
				
281
 
282
				#設置錯誤訊息
282
				#設置錯誤訊息
283
				$result["error"]=$classStr;
283
				$result["error"]=$classStr;
284
				
284
 
285
				#回傳結果
285
				#回傳結果
286
				return $result;
286
				return $result;
287
				
287
 
288
				}#if end
288
				}#if end
289
			
289
 
290
			#取得類別樣式字串
290
			#取得類別樣式字串
291
			$conf["frameCssStyle"]=$classStr["content"];
291
			$conf["frameCssStyle"]=$classStr["content"];
292
			
292
 
293
			}#else end
293
			}#else end
294
		
294
 
295
		#如果 $conf["scrolling"] 有設置
295
		#如果 $conf["scrolling"] 有設置
296
		if(isset($conf["scrolling"])){
296
		if(isset($conf["scrolling"])){
297
			
297
 
298
			#如果 $conf["scrolling"] 等於 "false"
298
			#如果 $conf["scrolling"] 等於 "false"
299
			if($conf["scrolling"]=="false"){
299
			if($conf["scrolling"]=="false"){
300
				
300
 
301
				#設定關閉滾軸
301
				#設定關閉滾軸
302
				$conf["scrolling"]=" scrolling=no ";
302
				$conf["scrolling"]=" scrolling=no ";
303
				
303
 
304
				}#if end
304
				}#if end
305
				
305
 
306
			#反之
306
			#反之
307
			else{
307
			else{
308
				
308
 
309
				#不做設定
309
				#不做設定
310
				$conf["scrolling"]="";
310
				$conf["scrolling"]="";
311
				
311
 
312
				}#else end
312
				}#else end
313
			
313
 
314
			}#if end
314
			}#if end
315
			
315
 
316
		#反之
316
		#反之
317
		else{
317
		else{
318
			
318
 
319
			#不做設定
319
			#不做設定
320
			$conf["scrolling"]="";
320
			$conf["scrolling"]="";
321
			
321
 
322
			}#else end
322
			}#else end
323
		
323
 
324
		#初始化 style 字串
324
		#初始化 style 字串
325
		$conf["styleStr"]="";
325
		$conf["styleStr"]="";
326
			
326
 
327
		#如果有設定寬度或高度
327
		#如果有設定寬度或高度
328
		if(isset($conf["width"]) || isset($conf["height"])){
328
		if(isset($conf["width"]) || isset($conf["height"])){
329
			
329
 
330
			#如果有設定寬度
330
			#如果有設定寬度
331
			if(isset($conf["width"])){
331
			if(isset($conf["width"])){
332
				
332
 
333
				#設定寬度
333
				#設定寬度
334
				$conf["css::styleStr"]["styleName"][]="width";
334
				$conf["css::styleStr"]["styleName"][]="width";
335
				$conf["css::styleStr"]["styleValue"][]=$conf["width"];
335
				$conf["css::styleStr"]["styleValue"][]=$conf["width"];
336
				
336
 
337
				}#if end
337
				}#if end
338
		
338
 
339
			#如果有設定高度
339
			#如果有設定高度
340
			if(isset($conf["height"])){
340
			if(isset($conf["height"])){
341
				
341
 
342
				#設定高度
342
				#設定高度
343
				$conf["css::styleStr"]["styleName"][]="height";
343
				$conf["css::styleStr"]["styleName"][]="height";
344
				$conf["css::styleStr"]["styleValue"][]=$conf["height"];
344
				$conf["css::styleStr"]["styleValue"][]=$conf["height"];
345
				
345
 
346
				}#if end
346
				}#if end
347
				
347
 
348
			#如果有設定最小寬度
348
			#如果有設定最小寬度
349
			if(isset($conf["minWidth"])){
349
			if(isset($conf["minWidth"])){
350
				
350
 
351
				#設定寬度
351
				#設定寬度
352
				$conf["css::styleStr"]["styleName"][]="min-width";
352
				$conf["css::styleStr"]["styleName"][]="min-width";
353
				$conf["css::styleStr"]["styleValue"][]=$conf["minWidth"];
353
				$conf["css::styleStr"]["styleValue"][]=$conf["minWidth"];
354
				
354
 
355
				}#if end
355
				}#if end
356
				
356
 
357
			#如果有設定最大寬度
357
			#如果有設定最大寬度
358
			if(isset($conf["maxWidth"])){
358
			if(isset($conf["maxWidth"])){
359
				
359
 
360
				#設定寬度
360
				#設定寬度
361
				$conf["css::styleStr"]["styleName"][]="max-width";
361
				$conf["css::styleStr"]["styleName"][]="max-width";
362
				$conf["css::styleStr"]["styleValue"][]=$conf["maxWidth"];
362
				$conf["css::styleStr"]["styleValue"][]=$conf["maxWidth"];
363
				
363
 
364
				}#if end
364
				}#if end
365
				
365
 
366
			#如果有設定最小高度
366
			#如果有設定最小高度
367
			if(isset($conf["minHeight"])){
367
			if(isset($conf["minHeight"])){
368
				
368
 
369
				#設定寬度
369
				#設定寬度
370
				$conf["css::styleStr"]["styleName"][]="min-height";
370
				$conf["css::styleStr"]["styleName"][]="min-height";
371
				$conf["css::styleStr"]["styleValue"][]=$conf["minHeight"];
371
				$conf["css::styleStr"]["styleValue"][]=$conf["minHeight"];
372
				
372
 
373
				}#if end
373
				}#if end
374
				
374
 
375
			#如果有設定最大高度
375
			#如果有設定最大高度
376
			if(isset($conf["maxHeight"])){
376
			if(isset($conf["maxHeight"])){
377
				
377
 
378
				#設定寬度
378
				#設定寬度
379
				$conf["css::styleStr"]["styleName"][]="max-height";
379
				$conf["css::styleStr"]["styleName"][]="max-height";
380
				$conf["css::styleStr"]["styleValue"][]=$conf["maxHeight"];
380
				$conf["css::styleStr"]["styleValue"][]=$conf["maxHeight"];
381
				
381
 
382
				}#if end
382
				}#if end
383
				
383
 
384
			#函式說明: 
384
			#函式說明:
385
			#建立給與html標籤使用的style屬性字串.
385
			#建立給與html標籤使用的style屬性字串.
386
			#回傳的結果:
386
			#回傳的結果:
387
			#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.		
387
			#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
388
			#$result["function"],當前執行的函數
388
			#$result["function"],當前執行的函數
389
			#$result["error"],錯誤訊息陣列
389
			#$result["error"],錯誤訊息陣列
390
			#$result["content"],css設定內容
390
			#$result["content"],css設定內容
391
			#必填參數:
391
			#必填參數:
392
			#$conf["css::styleStr"]["styleName"]=array("");#為屬性名稱,須為陣列值
392
			#$conf["css::styleStr"]["styleName"]=array("");#為屬性名稱,須為陣列值
393
			#$conf["css::styleStr"]["styleValue"]=array("");#為屬性值,須為陣列值
393
			#$conf["css::styleStr"]["styleValue"]=array("");#為屬性值,須為陣列值
394
			$styleStr=css::styleStr($conf["css::styleStr"]);
394
			$styleStr=css::styleStr($conf["css::styleStr"]);
395
			unset($conf["css::styleStr"]);
395
			unset($conf["css::styleStr"]);
396
			
396
 
397
			#如果建立 style 字串失敗
397
			#如果建立 style 字串失敗
398
			if($styleStr["status"]=="false"){
398
			if($styleStr["status"]=="false"){
399
				
399
 
400
				#設置執行不正常
400
				#設置執行不正常
401
				$result["status"]="false";
401
				$result["status"]="false";
402
				
402
 
403
				#設置錯誤訊息
403
				#設置錯誤訊息
404
				$result["error"]=$styleStr;
404
				$result["error"]=$styleStr;
405
				
405
 
406
				#回傳結果
406
				#回傳結果
407
				return $result;
407
				return $result;
408
				
408
 
409
				}#if end
409
				}#if end
410
			
410
 
411
			#取得 style 字串	
411
			#取得 style 字串
412
			$conf["styleStr"]=$styleStr["content"];
412
			$conf["styleStr"]=$styleStr["content"];
413
			
413
 
414
			}#if end
414
			}#if end
415
 
415
 
416
		#iframe語法,frameborder = 0 可以讓IE9看起來不會有外框
416
		#iframe語法,frameborder = 0 可以讓IE9看起來不會有外框
417
		#$result["content"]="<iframe src = ".$conf["webPage"]." name = ".$conf["name"].$conf["scrolling"]." id = ".$conf["name"]." frameborder = 0 ".$conf["frameCssStyle"]." ".$conf["styleStr"]." ></iframe>";
417
		#$result["content"]="<iframe src = ".$conf["webPage"]." name = ".$conf["name"].$conf["scrolling"]." id = ".$conf["name"]." frameborder = 0 ".$conf["frameCssStyle"]." ".$conf["styleStr"]." ></iframe>";
418
 
418
 
419
		#初始化儲存div或span其餘的屬性與數值
419
		#初始化儲存div或span其餘的屬性與數值
420
		$extraAttrAndValue="";
420
		$extraAttrAndValue="";
421
 
421
 
422
		#如果有設置 $conf["extraAttrAndValue"]
422
		#如果有設置 $conf["extraAttrAndValue"]
423
		if(isset($conf["extraAttrAndValue"])){
423
		if(isset($conf["extraAttrAndValue"])){
424
		
424
 
425
			#針對每個屬性與數值
425
			#針對每個屬性與數值
426
			foreach($conf["extraAttrAndValue"] as $attr=>$val ){
426
			foreach($conf["extraAttrAndValue"] as $attr=>$val ){
427
				
427
 
428
				#串接每個屬性與數值
428
				#串接每個屬性與數值
429
				$extraAttrAndValue=$extraAttrAndValue." ".$attr."=\"".$val."\"";
429
				$extraAttrAndValue=$extraAttrAndValue." ".$attr."=\"".$val."\"";
430
				
430
 
431
				}#foreach end
431
				}#foreach end
432
		
432
 
433
			}#if end
433
			}#if end
434
 
434
 
435
		#初始化儲存frame其餘的屬性與數值
435
		#初始化儲存frame其餘的屬性與數值
436
		$frameExtraAttrAndValue="";
436
		$frameExtraAttrAndValue="";
437
 
437
 
438
		#如果有設置 $conf["frameExtraAttrAndValue"]
438
		#如果有設置 $conf["frameExtraAttrAndValue"]
439
		if(isset($conf["frameExtraAttrAndValue"])){
439
		if(isset($conf["frameExtraAttrAndValue"])){
440
		
440
 
441
			#如果要用 sandbox 參數
441
			#如果要用 sandbox 參數
442
			if($conf["sandbox"]==="true"){
442
			if($conf["sandbox"]==="true"){
443
			
443
 
444
				#增加 sandbox 參數與屬性
444
				#增加 sandbox 參數與屬性
445
				$conf["frameExtraAttrAndValue"][]=array("sandbox"=>"allow-popups allow-scripts allow-modals allow-forms allow-downloads");
445
				$conf["frameExtraAttrAndValue"][]=array("sandbox"=>"allow-popups allow-scripts allow-modals allow-forms allow-downloads");
446
			
446
 
447
				}#if end
447
				}#if end
448
		
448
 
449
			#針對每個屬性與數值
449
			#針對每個屬性與數值
450
			foreach($conf["frameExtraAttrAndValue"] as $attr=>$val ){
450
			foreach($conf["frameExtraAttrAndValue"] as $attr=>$val ){
451
				
451
 
452
				#串接每個屬性與數值
452
				#串接每個屬性與數值
453
				$frameExtraAttrAndValue=$frameExtraAttrAndValue." ".$attr."=\"".$val."\"";
453
				$frameExtraAttrAndValue=$frameExtraAttrAndValue." ".$attr."=\"".$val."\"";
454
				
454
 
455
				}#foreach end
455
				}#foreach end
456
		
456
 
457
			}#if end
457
			}#if end
458
		
458
 
459
		#反之沒有設置 $conf["frameExtraAttrAndValue"]
459
		#反之沒有設置 $conf["frameExtraAttrAndValue"]
460
		else{
460
		else{
461
		
461
 
462
			#設置 sandbox 參數與屬性
462
			#設置 sandbox 參數與屬性
463
			$frameExtraAttrAndValue="sandbox=\"allow-popups allow-scripts allow-modals allow-forms allow-downloads\"";
463
			$frameExtraAttrAndValue="sandbox=\"allow-popups allow-scripts allow-modals allow-forms allow-downloads\"";
464
		
464
 
465
			}#else end
465
			}#else end
466
 
466
 
467
		#如果 $conf["br"] 爲 "true"
467
		#如果 $conf["br"] 爲 "true"
468
		if($conf["br"]==="true"){
468
		if($conf["br"]==="true"){
469
 
469
 
470
			#用div包起來,寬高的style與class套用在div上面.
470
			#用div包起來,寬高的style與class套用在div上面.
471
			$result["content"]="<div ".$extraAttrAndValue." ".$conf["frameCssStyle"]." ".$conf["styleStr"].">"."<iframe ".$frameExtraAttrAndValue." style=\"width:100%;height:100%;\" src=\"".$conf["webPage"]."\" name=\"".$conf["name"]."\" ".$conf["scrolling"]." id = \"".$conf["name"]."\" frameborder=0></iframe></div>";
471
			$result["content"]="<div ".$extraAttrAndValue." ".$conf["frameCssStyle"]." ".$conf["styleStr"].">"."<iframe ".$frameExtraAttrAndValue." style=\"width:100%;height:100%;\" src=\"".$conf["webPage"]."\" name=\"".$conf["name"]."\" ".$conf["scrolling"]." id = \"".$conf["name"]."\" frameborder=0></iframe></div>";
472
 
472
 
473
			#如果存在 $conf["soucreId"]
473
			#如果存在 $conf["soucreId"]
474
			if(isset($conf["soucreId"])){
474
			if(isset($conf["soucreId"])){
475
				
475
 
476
				#函式說明:
476
				#函式說明:
477
				#將要執行的script語法透過該函式執行(會在程式外層用<script></script>包起來).
477
				#將要執行的script語法透過該函式執行(會在程式外層用<script></script>包起來).
478
				#回傳結果:
478
				#回傳結果:
479
				#$result["status"],執行是否正常,"true"為正常,"false"為不正常.
479
				#$result["status"],執行是否正常,"true"為正常,"false"為不正常.
480
				#$result["error"],錯誤訊息陣列
480
				#$result["error"],錯誤訊息陣列
Line 487... Line 487...
487
					window.changeFrameEleHeightToFullLessSource.changeSizeFrameId='".$conf["name"]."';
487
					window.changeFrameEleHeightToFullLessSource.changeSizeFrameId='".$conf["name"]."';
488
					window.changeFrameEleHeightToFullLessSource.fixedSizeFrameId='".$conf["soucreId"]."';
488
					window.changeFrameEleHeightToFullLessSource.fixedSizeFrameId='".$conf["soucreId"]."';
489
				";
489
				";
490
				#可省略參數:
490
				#可省略參數:
491
				#$conf["onReady"],字串,是否要在網頁完全載入後再執行,"false"為不等載入完就先執行,預設為"true"要等載入完再執行.
491
				#$conf["onReady"],字串,是否要在網頁完全載入後再執行,"false"為不等載入完就先執行,預設為"true"要等載入完再執行.
492
				$conf["javascript::toScript"]["onReady"]="false";	
492
				$conf["javascript::toScript"]["onReady"]="false";
493
				#$conf["globalJs"],字串陣列,為要放入<script>標籤的js全域變數.
493
				#$conf["globalJs"],字串陣列,為要放入<script>標籤的js全域變數.
494
				#$conf["globalJs"]=array();
494
				#$conf["globalJs"]=array();
495
				#$conf["jsFunciton"],字串陣列,為要放入<script>標籤的js函數.
495
				#$conf["jsFunciton"],字串陣列,為要放入<script>標籤的js函數.
496
				#$conf["jsFunciton"]=array();
496
				#$conf["jsFunciton"]=array();
497
				#參考資料:
497
				#參考資料:
498
				#http://stackoverflow.com/questions/9899372/pure-javascript-equivalent-to-jquerys-ready-how-to-call-a-function-when-the
498
				#http://stackoverflow.com/questions/9899372/pure-javascript-equivalent-to-jquerys-ready-how-to-call-a-function-when-the
499
				$toScript=javascript::toScript($conf["javascript::toScript"]);
499
				$toScript=javascript::toScript($conf["javascript::toScript"]);
500
				unset($conf["javascript::toScript"]);
500
				unset($conf["javascript::toScript"]);
501
				
501
 
502
				#如果建立script失敗
502
				#如果建立script失敗
503
				if($toScript["status"]==="false"){
503
				if($toScript["status"]==="false"){
504
					
504
 
505
					#設置執行不正常
505
					#設置執行不正常
506
					$result["status"]="false";
506
					$result["status"]="false";
507
					
507
 
508
					#設置錯誤訊息
508
					#設置錯誤訊息
509
					$result["error"]=$toScript;
509
					$result["error"]=$toScript;
510
					
510
 
511
					#回傳結果
511
					#回傳結果
512
					return $result;
512
					return $result;
513
					
513
 
514
					}#if end
514
					}#if end
515
				
515
 
516
				#串接語法
516
				#串接語法
517
				$result["content"]=$result["content"].$toScript["content"];
517
				$result["content"]=$result["content"].$toScript["content"];
518
				
518
 
519
				}#if end
519
				}#if end
520
			
520
 
521
			}#if end
521
			}#if end
522
			
522
 
523
		#改用span將iframe包起來
523
		#改用span將iframe包起來
524
		else{
524
		else{
525
			
525
 
526
			#用span包起來,寬高的style與class套用在iframe上面.
526
			#用span包起來,寬高的style與class套用在iframe上面.
527
			$result["content"]="<span ".$extraAttrAndValue.">"."<iframe ".$frameExtraAttrAndValue." ".$conf["frameCssStyle"]." ".$conf["styleStr"]." src=\"".$conf["webPage"]."\" name=\"".$conf["name"]."\" ".$conf["scrolling"]." id = \"".$conf["name"]."\" frameborder=0></iframe></span>";
527
			$result["content"]="<span ".$extraAttrAndValue.">"."<iframe ".$frameExtraAttrAndValue." ".$conf["frameCssStyle"]." ".$conf["styleStr"]." src=\"".$conf["webPage"]."\" name=\"".$conf["name"]."\" ".$conf["scrolling"]." id = \"".$conf["name"]."\" frameborder=0></iframe></span>";
528
			
528
 
529
			}#else end
529
			}#else end
530
		
530
 
531
		#執行到這邊,代表執行成功
531
		#執行到這邊,代表執行成功
532
		$result["status"]="true";
532
		$result["status"]="true";
533
		
533
 
534
		#回傳結果
534
		#回傳結果
535
		return $result;
535
		return $result;
536
 
536
 
537
		}#function createIframe end
537
		}#function createIframe end
538
 
538
 
Line 574... Line 574...
574
	#無.
574
	#無.
575
	#備註:
575
	#備註:
576
	#無.
576
	#無.
577
	*/
577
	*/
578
	public static function createMultiIframe(&$conf){
578
	public static function createMultiIframe(&$conf){
579
		
579
 
580
		#初始化要回傳的結果
580
		#初始化要回傳的結果
581
		$result=array();
581
		$result=array();
582
 
582
 
583
		#取得當前執行的函數名稱
583
		#取得當前執行的函數名稱
584
		$result["function"]=__FUNCTION__;
584
		$result["function"]=__FUNCTION__;
585
 
585
 
586
		#如果沒有參數
586
		#如果沒有參數
587
		if(func_num_args()==0){
587
		if(func_num_args()==0){
588
			
588
 
589
			#設置執行失敗
589
			#設置執行失敗
590
			$result["status"]="false";
590
			$result["status"]="false";
591
			
591
 
592
			#設置執行錯誤訊息
592
			#設置執行錯誤訊息
593
			$result["error"]="函數".$result["function"]."需要參數";
593
			$result["error"]="函數".$result["function"]."需要參數";
594
			
594
 
595
			#回傳結果
595
			#回傳結果
596
			return $result;
596
			return $result;
597
			
597
 
598
			}#if end
598
			}#if end
599
 
599
 
600
		#取得參數
600
		#取得參數
601
		$result["argu"]=$conf;
601
		$result["argu"]=$conf;
602
 
602
 
603
		#如果 $conf 不為陣列
603
		#如果 $conf 不為陣列
604
		if(gettype($conf)!=="array"){
604
		if(gettype($conf)!=="array"){
605
			
605
 
606
			#設置執行失敗
606
			#設置執行失敗
607
			$result["status"]="false";
607
			$result["status"]="false";
608
			
608
 
609
			#設置執行錯誤訊息
609
			#設置執行錯誤訊息
610
			$result["error"][]="\$conf變數須為陣列形態";
610
			$result["error"][]="\$conf變數須為陣列形態";
611
			
611
 
612
			#如果傳入的參數為 null
612
			#如果傳入的參數為 null
613
			if($conf===null){
613
			if($conf===null){
614
				
614
 
615
				#設置執行錯誤訊息
615
				#設置執行錯誤訊息
616
				$result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
616
				$result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
617
				
617
 
618
				}#if end
618
				}#if end
619
 
619
 
620
			#回傳結果
620
			#回傳結果
621
			return $result;
621
			return $result;
622
			
622
 
623
			}#if end
623
			}#if end
624
			
624
 
625
		#初始化要回傳的語法
625
		#初始化要回傳的語法
626
		$result["content"]="";	
626
		$result["content"]="";
627
			
627
 
628
		#檢查參數
628
		#檢查參數
629
		#函式說明:
629
		#函式說明:
630
		#檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容。
630
		#檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容。
631
		#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
631
		#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
632
		#$reuslt["error"],執行不正常結束的錯訊息陣列.
632
		#$reuslt["error"],執行不正常結束的錯訊息陣列.
Line 638... Line 638...
638
		#必填寫的參數:
638
		#必填寫的參數:
639
		#$conf["varInput"],陣列變數,要檢查的陣列變數,請在要檢查的參數前面加上&,這樣變動的結果才能被套用。
639
		#$conf["varInput"],陣列變數,要檢查的陣列變數,請在要檢查的參數前面加上&,這樣變動的結果才能被套用。
640
		$conf["variableCheck::checkArguments"]["varInput"]=&$conf;
640
		$conf["variableCheck::checkArguments"]["varInput"]=&$conf;
641
		#$conf["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
641
		#$conf["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
642
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("webPage","name","br");
642
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("webPage","name","br");
643
		#$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列 例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double"); 
643
		#$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列 例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double");
644
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("array","array","array");
644
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("array","array","array");
645
		#$conf["variableCheck::checkArguments"]["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
645
		#$conf["variableCheck::checkArguments"]["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
646
		$conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
646
		$conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
647
		#可以省略的參數:
647
		#可以省略的參數:
648
		#$conf["canBeEmptyString"],必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true"。
648
		#$conf["canBeEmptyString"],必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true"。
649
		#$conf["variableCheck::checkArguments"]["canBeEmptyString"]="true";
649
		#$conf["variableCheck::checkArguments"]["canBeEmptyString"]="true";
650
		#$conf["skipableVariableName"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
650
		#$conf["skipableVariableName"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
651
		$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("class","scrolling","width","height","minWidth","maxWidth","minHeight","maxHeight","soucreId");
651
		$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("class","scrolling","width","height","minWidth","maxWidth","minHeight","maxHeight","soucreId");
652
		#$conf["skipableVariableType"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double"); 
652
		#$conf["skipableVariableType"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double");
653
		$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("array","array","array","array","array","array","array","array","array");
653
		$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("array","array","array","array","array","array","array","array","array");
654
		#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,null代表不指定,若預設值是必填參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
654
		#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,null代表不指定,若預設值是必填參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
655
		$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array(null,null,null,null,null,null,null,null,null);
655
		$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array(null,null,null,null,null,null,null,null,null);
656
		#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
656
		#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
657
		$conf["variableCheck::checkArguments"]["arrayCountEqualCheck"][]=array("webPage","name","br");
657
		$conf["variableCheck::checkArguments"]["arrayCountEqualCheck"][]=array("webPage","name","br");
658
		$conf["variableCheck::checkArguments"]["arrayCountEqualCheck"][]=array("br","class","scrolling","width","height","minWidth","maxWidth","minHeight","maxHeight","soucreId");
658
		$conf["variableCheck::checkArguments"]["arrayCountEqualCheck"][]=array("br","class","scrolling","width","height","minWidth","maxWidth","minHeight","maxHeight","soucreId");
659
		$checkResult=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
659
		$checkResult=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
660
		unset($conf["variableCheck::checkArguments"]);
660
		unset($conf["variableCheck::checkArguments"]);
661
		
661
 
662
		#如果檢查失敗
662
		#如果檢查失敗
663
		if($checkResult["status"]==="false"){
663
		if($checkResult["status"]==="false"){
664
			
664
 
665
			#設置執行不正常
665
			#設置執行不正常
666
			$result["status"]="false";
666
			$result["status"]="false";
667
			
667
 
668
			#設置錯誤訊息
668
			#設置錯誤訊息
669
			$result["error"]=$checkResult;
669
			$result["error"]=$checkResult;
670
			
670
 
671
			#回傳結果
671
			#回傳結果
672
			return $result;
672
			return $result;
673
			
673
 
674
			}#if end
674
			}#if end
675
			
675
 
676
		#如果檢查不通過
676
		#如果檢查不通過
677
		if($checkResult["passed"]==="false"){
677
		if($checkResult["passed"]==="false"){
678
			
678
 
679
			#設置執行不正常
679
			#設置執行不正常
680
			$result["status"]="false";
680
			$result["status"]="false";
681
			
681
 
682
			#設置錯誤訊息
682
			#設置錯誤訊息
683
			$result["error"]=$checkResult;
683
			$result["error"]=$checkResult;
684
			
684
 
685
			#回傳結果
685
			#回傳結果
686
			return $result;
686
			return $result;
687
			
687
 
688
			}#if end
688
			}#if end
689
 
689
 
690
		#針對每個 $conf["webPage"]
690
		#針對每個 $conf["webPage"]
691
		foreach($conf["webPage"] as $index=>$url){
691
		foreach($conf["webPage"] as $index=>$url){
692
			
692
 
693
			#初始化參數
693
			#初始化參數
694
			$each=array();
694
			$each=array();
695
			
695
 
696
			#取得參數 "webPage"
696
			#取得參數 "webPage"
697
			$each["webPage"]=$url;
697
			$each["webPage"]=$url;
698
			
698
 
699
			#取得參數 "name"
699
			#取得參數 "name"
700
			$each["name"]=$conf["name"][$index];
700
			$each["name"]=$conf["name"][$index];
701
			
701
 
702
			#取得參數 "br"
702
			#取得參數 "br"
703
			$each["br"]=$conf["br"][$index];
703
			$each["br"]=$conf["br"][$index];
704
			
704
 
705
			#如果有設置 $conf["class"][$index] 參數
705
			#如果有設置 $conf["class"][$index] 參數
706
			if(isset($conf["class"][$index])){
706
			if(isset($conf["class"][$index])){
707
				
707
 
708
				#如果不是 null
708
				#如果不是 null
709
				if($conf["class"][$index]!==null){
709
				if($conf["class"][$index]!==null){
710
					
710
 
711
					#取得 "class" 參數
711
					#取得 "class" 參數
712
					$each["class"]=$conf["class"][$index];
712
					$each["class"]=$conf["class"][$index];
713
					
713
 
714
					}#if end
714
					}#if end
715
								
715
 
716
				}#if end
716
				}#if end
717
				
717
 
718
			#如果有設置 $conf["scrolling"] 參數
718
			#如果有設置 $conf["scrolling"] 參數
719
			if(isset($conf["scrolling"][$index])){
719
			if(isset($conf["scrolling"][$index])){
720
				
720
 
721
				#如果不是 null
721
				#如果不是 null
722
				if($conf["scrolling"][$index]!==null){
722
				if($conf["scrolling"][$index]!==null){
723
				
723
 
724
					#取得 "scrolling" 參數
724
					#取得 "scrolling" 參數
725
					$each["scrolling"]=$conf["scrolling"][$index];
725
					$each["scrolling"]=$conf["scrolling"][$index];
726
				
726
 
727
					}#if end
727
					}#if end
728
				
728
 
729
				}#if end
729
				}#if end
730
				
730
 
731
			#如果有設置 $conf["width"] 參數
731
			#如果有設置 $conf["width"] 參數
732
			if(isset($conf["width"][$index])){
732
			if(isset($conf["width"][$index])){
733
				
733
 
734
				#如果不是 null
734
				#如果不是 null
735
				if($conf["width"][$index]!==null){
735
				if($conf["width"][$index]!==null){
736
					
736
 
737
					#取得 "width" 參數
737
					#取得 "width" 參數
738
					$each["width"]=$conf["width"][$index];
738
					$each["width"]=$conf["width"][$index];
739
					
739
 
740
					}#if end
740
					}#if end
741
				
741
 
742
				}#if end
742
				}#if end
743
				
743
 
744
			#如果有設置 $conf["height"] 參數
744
			#如果有設置 $conf["height"] 參數
745
			if(isset($conf["height"][$index])){
745
			if(isset($conf["height"][$index])){
746
				
746
 
747
				#如果不是 null
747
				#如果不是 null
748
				if($conf["height"][$index]!==null){
748
				if($conf["height"][$index]!==null){
749
				
749
 
750
					#取得 "height" 參數
750
					#取得 "height" 參數
751
					$each["height"]=$conf["height"][$index];
751
					$each["height"]=$conf["height"][$index];
752
					
752
 
753
					}#if end
753
					}#if end
754
				
754
 
755
				}#if end	
755
				}#if end
756
				
756
 
757
			#如果有設置 $conf["minWidth"] 參數
757
			#如果有設置 $conf["minWidth"] 參數
758
			if(isset($conf["minWidth"][$index])){
758
			if(isset($conf["minWidth"][$index])){
759
				
759
 
760
				#如果不是 null
760
				#如果不是 null
761
				if($conf["minWidth"][$index]!==null){
761
				if($conf["minWidth"][$index]!==null){
762
				
762
 
763
					#取得 "minWidth" 參數
763
					#取得 "minWidth" 參數
764
					$each["minWidth"]=$conf["minWidth"][$index];
764
					$each["minWidth"]=$conf["minWidth"][$index];
765
					
765
 
766
					}#if end
766
					}#if end
767
				
767
 
768
				}#if end
768
				}#if end
769
				
769
 
770
			#如果有設置 $conf["maxWidth"] 參數
770
			#如果有設置 $conf["maxWidth"] 參數
771
			if(isset($conf["maxWidth"][$index])){
771
			if(isset($conf["maxWidth"][$index])){
772
				
772
 
773
				#如果不是 null
773
				#如果不是 null
774
				if($conf["maxWidth"][$index]!==null){
774
				if($conf["maxWidth"][$index]!==null){
775
					
775
 
776
					#取得 "maxWidth" 參數
776
					#取得 "maxWidth" 參數
777
					$each["maxWidth"]=$conf["maxWidth"][$index];
777
					$each["maxWidth"]=$conf["maxWidth"][$index];
778
					
778
 
779
					}#if end
779
					}#if end
780
				
780
 
781
				}#if end
781
				}#if end
782
				
782
 
783
			#如果有設置 $conf["minHeight"] 參數
783
			#如果有設置 $conf["minHeight"] 參數
784
			if(isset($conf["minHeight"][$index])){
784
			if(isset($conf["minHeight"][$index])){
785
				
785
 
786
				#如果不是 null
786
				#如果不是 null
787
				if($conf["minHeight"][$index]!==null){
787
				if($conf["minHeight"][$index]!==null){
788
				
788
 
789
					#取得 "minHeight" 參數
789
					#取得 "minHeight" 參數
790
					$each["minHeight"]=$conf["minHeight"][$index];
790
					$each["minHeight"]=$conf["minHeight"][$index];
791
					
791
 
792
					}#if end
792
					}#if end
793
				
793
 
794
				}#if end
794
				}#if end
795
				
795
 
796
			#如果有設置 $conf["maxHeight"] 參數
796
			#如果有設置 $conf["maxHeight"] 參數
797
			if(isset($conf["maxHeight"][$index])){
797
			if(isset($conf["maxHeight"][$index])){
798
				
798
 
799
				#如果不是 null
799
				#如果不是 null
800
				if($conf["maxHeight"][$index]!==null){
800
				if($conf["maxHeight"][$index]!==null){
801
				
801
 
802
					#取得 "maxHeight" 參數
802
					#取得 "maxHeight" 參數
803
					$each["maxHeight"]=$conf["maxHeight"][$index];
803
					$each["maxHeight"]=$conf["maxHeight"][$index];
804
				
804
 
805
					}#if end	
805
					}#if end
806
				
806
 
807
				}#if end
807
				}#if end
808
				
808
 
809
			#如果有設置 $conf["soucreId"] 參數
809
			#如果有設置 $conf["soucreId"] 參數
810
			if(isset($conf["soucreId"][$index])){
810
			if(isset($conf["soucreId"][$index])){
811
				
811
 
812
				#如果不是 null
812
				#如果不是 null
813
				if($conf["soucreId"][$index]!==null){
813
				if($conf["soucreId"][$index]!==null){
814
					
814
 
815
					#取得 "soucreId" 參數
815
					#取得 "soucreId" 參數
816
					$each["soucreId"]=$conf["soucreId"][$index];
816
					$each["soucreId"]=$conf["soucreId"][$index];
817
					
817
 
818
					}#if end
818
					}#if end
819
				
819
 
820
				}#if end
820
				}#if end
821
										
821
 
822
			#函式說明:
822
			#函式說明:
823
			#建立一個 iframe 框架
823
			#建立一個 iframe 框架
824
			#回傳的結果:
824
			#回傳的結果:
825
			#$result["status"],執行成功或失敗,成功為"true";"false"為失敗。
825
			#$result["status"],執行成功或失敗,成功為"true";"false"為失敗。
826
			#$result["functin"],字串,當前函數的名稱.
826
			#$result["functin"],字串,當前函數的名稱.
Line 832... Line 832...
832
			#$conf["name"],爲該 iframe 的名稱.
832
			#$conf["name"],爲該 iframe 的名稱.
833
			$conf["frame::createIframe"]["name"]=$each["name"];
833
			$conf["frame::createIframe"]["name"]=$each["name"];
834
			#$conf["br"],字串,爲放置完該iframe後是否要換行,"true"爲要換行;"flase"爲不要換行。
834
			#$conf["br"],字串,爲放置完該iframe後是否要換行,"true"爲要換行;"flase"爲不要換行。
835
			$conf["frame::createIframe"]["br"]=$each["br"];
835
			$conf["frame::createIframe"]["br"]=$each["br"];
836
			#可省略參數:
836
			#可省略參數:
837
			
837
 
838
			#如果存在 $each["class"]	
838
			#如果存在 $each["class"]
839
			if(isset($each["class"])){
839
			if(isset($each["class"])){
840
				
840
 
841
				#設置參數
841
				#設置參數
842
				#$conf["class"],字串陣列,爲該 iframe 要套用的css樣式類別名稱.
842
				#$conf["class"],字串陣列,爲該 iframe 要套用的css樣式類別名稱.
843
				$conf["frame::createIframe"]["class"]=$each["class"];
843
				$conf["frame::createIframe"]["class"]=$each["class"];
844
				
844
 
845
				}#if end
845
				}#if end
846
			
846
 
847
			#如果存在 $each["scrolling"]
847
			#如果存在 $each["scrolling"]
848
			if(isset($each["scrolling"])){
848
			if(isset($each["scrolling"])){
849
				
849
 
850
				#設置參數
850
				#設置參數
851
				#$conf["scrolling"],字串,是否要取消滾軸功能,"false"代表取消滾軸功能. 
851
				#$conf["scrolling"],字串,是否要取消滾軸功能,"false"代表取消滾軸功能.
852
				$conf["frame::createIframe"]["scrolling"]=$each["scrolling"];
852
				$conf["frame::createIframe"]["scrolling"]=$each["scrolling"];
853
				
853
 
854
				}#if end
854
				}#if end
855
			
855
 
856
			#如果存在 $each["width"]
856
			#如果存在 $each["width"]
857
			if(isset($each["width"])){
857
			if(isset($each["width"])){
858
				
858
 
859
				#設置參數
859
				#設置參數
860
				#$conf["width"],字串,iframe的寬度.
860
				#$conf["width"],字串,iframe的寬度.
861
				$conf["frame::createIframe"]["width"]=$each["width"];
861
				$conf["frame::createIframe"]["width"]=$each["width"];
862
				
862
 
863
				}#if end
863
				}#if end
864
			
864
 
865
			#如果存在 $each["height"]
865
			#如果存在 $each["height"]
866
			if(isset($each["height"])){
866
			if(isset($each["height"])){
867
				
867
 
868
				#設置參數
868
				#設置參數
869
				#$conf["height"],字串,iframe的寬度.
869
				#$conf["height"],字串,iframe的寬度.
870
				$conf["frame::createIframe"]["height"]=$each["height"];
870
				$conf["frame::createIframe"]["height"]=$each["height"];
871
				
871
 
872
				}#if end
872
				}#if end
873
			
873
 
874
			#如果存在 $each["minWidth"]
874
			#如果存在 $each["minWidth"]
875
			if(isset($each["minWidth"])){
875
			if(isset($each["minWidth"])){
876
			
876
 
877
				#$conf["minWidth"],字串,最小的寬度.
877
				#$conf["minWidth"],字串,最小的寬度.
878
				$conf["frame::createIframe"]["minWidth"]=$each["minWidth"];
878
				$conf["frame::createIframe"]["minWidth"]=$each["minWidth"];
879
			
879
 
880
				}#if end
880
				}#if end
881
			
881
 
882
			#如果存在 $each["maxWidth"]
882
			#如果存在 $each["maxWidth"]
883
			if(isset($each["maxWidth"])){
883
			if(isset($each["maxWidth"])){
884
				
884
 
885
				#$conf["maxWidth"],字串,最大寬度.
885
				#$conf["maxWidth"],字串,最大寬度.
886
				$conf["frame::createIframe"]["maxWidth"]=$each["minWidth"];
886
				$conf["frame::createIframe"]["maxWidth"]=$each["minWidth"];
887
				
887
 
888
				}#if end
888
				}#if end
889
			
889
 
890
			#如果存在 $each["maxWidth"]
890
			#如果存在 $each["maxWidth"]
891
			if(isset($each["maxWidth"])){
891
			if(isset($each["maxWidth"])){
892
		
892
 
893
				#$conf["minHeight"],字串,最小的高度.
893
				#$conf["minHeight"],字串,最小的高度.
894
				$conf["frame::createIframe"]["minHeight"]=$each["minHeight"];
894
				$conf["frame::createIframe"]["minHeight"]=$each["minHeight"];
895
			
895
 
896
				}#if end
896
				}#if end
897
				
897
 
898
			#如果存在 $each["maxHeight"]
898
			#如果存在 $each["maxHeight"]
899
			if(isset($each["maxHeight"])){
899
			if(isset($each["maxHeight"])){
900
				
900
 
901
				#$conf["maxHeight"],字串,最大的高度.
901
				#$conf["maxHeight"],字串,最大的高度.
902
				$conf["frame::createIframe"]["maxHeight"]=$each["maxHeight"];
902
				$conf["frame::createIframe"]["maxHeight"]=$each["maxHeight"];
903
				
903
 
904
				}#if end
904
				}#if end
905
			
905
 
906
			#如果存在 $each["soucreId"]			
906
			#如果存在 $each["soucreId"]
907
			if(isset($each["soucreId"])){
907
			if(isset($each["soucreId"])){
908
				
908
 
909
				#$conf["soucreId"],字串,如果要跟該function建立出來的ifame來動態調整高度為用戶看到的高度減去其高度,請給予來源iframe的id,此參數僅在$conf["br"]為"true"時生效.
909
				#$conf["soucreId"],字串,如果要跟該function建立出來的ifame來動態調整高度為用戶看到的高度減去其高度,請給予來源iframe的id,此參數僅在$conf["br"]為"true"時生效.
910
				$conf["frame::createIframe"]["soucreId"]=$each["soucreId"];
910
				$conf["frame::createIframe"]["soucreId"]=$each["soucreId"];
911
				
911
 
912
				}#if end			
912
				}#if end
913
		
913
 
914
			$createIframe=frame::createIframe($conf["frame::createIframe"]);
914
			$createIframe=frame::createIframe($conf["frame::createIframe"]);
915
			unset($conf["frame::createIframe"]);
915
			unset($conf["frame::createIframe"]);
916
			
916
 
917
			#如果建立失敗
917
			#如果建立失敗
918
			if($createIframe["status"]==="false"){
918
			if($createIframe["status"]==="false"){
919
				
919
 
920
				#設置執行不正常
920
				#設置執行不正常
921
				$result["status"]="false";
921
				$result["status"]="false";
922
				
922
 
923
				#設置錯誤訊息
923
				#設置錯誤訊息
924
				$result["error"]=$checkResult;
924
				$result["error"]=$checkResult;
925
				
925
 
926
				#回傳結果
926
				#回傳結果
927
				return $result;
927
				return $result;
928
				
928
 
929
				}#if end
929
				}#if end
930
				
930
 
931
			#串接iframe語法
931
			#串接iframe語法
932
			$result["content"]=$result["content"].$createIframe["content"];
932
			$result["content"]=$result["content"].$createIframe["content"];
933
			
933
 
934
			}#foreach end
934
			}#foreach end
935
			
935
 
936
		#設置執行正常
936
		#設置執行正常
937
		$result["status"]="true";
937
		$result["status"]="true";
938
		
938
 
939
		#回傳結果
939
		#回傳結果
940
		return $result;
940
		return $result;
941
 
941
 
942
		}#function createMultiIframe end
942
		}#function createMultiIframe end
943
			
943
 
944
	/*
944
	/*
945
	#函式說明:
945
	#函式說明:
946
	#用div做成的frame.
946
	#用div做成的frame.
947
	#回傳結果:
947
	#回傳結果:
948
	#$result["status"],執行成功或失敗,成功為"true";"false"為失敗.
948
	#$result["status"],執行成功或失敗,成功為"true";"false"為失敗.
Line 963... Line 963...
963
	#無.
963
	#無.
964
	#備註:
964
	#備註:
965
	#無.
965
	#無.
966
	*/
966
	*/
967
	public static function div(&$conf=array()){
967
	public static function div(&$conf=array()){
968
		
968
 
969
		#初始化要回傳的結果
969
		#初始化要回傳的結果
970
		$result=array();
970
		$result=array();
971
 
971
 
972
		#取得當前執行的函數名稱
972
		#取得當前執行的函數名稱
973
		$result["function"]=__FUNCTION__;
973
		$result["function"]=__FUNCTION__;
974
 
974
 
975
		#如果沒有參數
975
		#如果沒有參數
976
		if(func_num_args()==0){
976
		if(func_num_args()==0){
977
			
977
 
978
			#設置執行失敗
978
			#設置執行失敗
979
			$result["status"]="false";
979
			$result["status"]="false";
980
			
980
 
981
			#設置執行錯誤訊息
981
			#設置執行錯誤訊息
982
			$result["error"]="函數".$result["function"]."需要參數";
982
			$result["error"]="函數".$result["function"]."需要參數";
983
			
983
 
984
			#回傳結果
984
			#回傳結果
985
			return $result;
985
			return $result;
986
			
986
 
987
			}#if end
987
			}#if end
988
 
988
 
989
		#取得參數
989
		#取得參數
990
		$result["argu"]=$conf;
990
		$result["argu"]=$conf;
991
 
991
 
992
		#如果 $conf 不為陣列
992
		#如果 $conf 不為陣列
993
		if(gettype($conf)!=="array"){
993
		if(gettype($conf)!=="array"){
994
			
994
 
995
			#設置執行失敗
995
			#設置執行失敗
996
			$result["status"]="false";
996
			$result["status"]="false";
997
			
997
 
998
			#設置執行錯誤訊息
998
			#設置執行錯誤訊息
999
			$result["error"][]="\$conf變數須為陣列形態";
999
			$result["error"][]="\$conf變數須為陣列形態";
1000
			
1000
 
1001
			#如果傳入的參數為 null
1001
			#如果傳入的參數為 null
1002
			if($conf===null){
1002
			if($conf===null){
1003
				
1003
 
1004
				#設置執行錯誤訊息
1004
				#設置執行錯誤訊息
1005
				$result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
1005
				$result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
1006
				
1006
 
1007
				}#if end
1007
				}#if end
1008
 
1008
 
1009
			#回傳結果
1009
			#回傳結果
1010
			return $result;
1010
			return $result;
1011
			
1011
 
1012
			}#if end
1012
			}#if end
1013
		
1013
 
1014
		#檢查參數
1014
		#檢查參數
1015
		#函式說明:
1015
		#函式說明:
1016
		#檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容。
1016
		#檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容。
1017
		#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
1017
		#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
1018
		#$reuslt["error"],執行不正常結束的錯訊息陣列.
1018
		#$reuslt["error"],執行不正常結束的錯訊息陣列.
Line 1024... Line 1024...
1024
		#必填寫的參數:
1024
		#必填寫的參數:
1025
		#$conf["varInput"],陣列變數,要檢查的陣列變數,請在要檢查的參數前面加上&,這樣變動的結果才能被套用。
1025
		#$conf["varInput"],陣列變數,要檢查的陣列變數,請在要檢查的參數前面加上&,這樣變動的結果才能被套用。
1026
		$conf["variableCheck::checkArguments"]["varInput"]=&$conf;
1026
		$conf["variableCheck::checkArguments"]["varInput"]=&$conf;
1027
		#$conf["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
1027
		#$conf["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
1028
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("id");
1028
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("id");
1029
		#$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列 例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double"); 
1029
		#$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列 例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double");
1030
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("string");
1030
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("string");
1031
		#$conf["variableCheck::checkArguments"]["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
1031
		#$conf["variableCheck::checkArguments"]["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
1032
		$conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
1032
		$conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
1033
		#可以省略的參數:
1033
		#可以省略的參數:
1034
		#$conf["canBeEmptyString"],必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true"。
1034
		#$conf["canBeEmptyString"],必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true"。
1035
		#$conf["variableCheck::checkArguments"]["canBeEmptyString"]="true";
1035
		#$conf["variableCheck::checkArguments"]["canBeEmptyString"]="true";
1036
		#$conf["skipableVariableName"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
1036
		#$conf["skipableVariableName"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
1037
		$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("content","oneScreenSize","height");
1037
		$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("content","oneScreenSize","height");
1038
		#$conf["skipableVariableType"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double"); 
1038
		#$conf["skipableVariableType"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double");
1039
		$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("array","string","string");
1039
		$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("array","string","string");
1040
		#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,null代表不指定,若預設值是必填參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
1040
		#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,null代表不指定,若預設值是必填參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
1041
		$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array(array(),"false",null);
1041
		$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array(array(),"false",null);
1042
		#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
1042
		#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
1043
		#$conf["arrayCountEqualCheck"][]=array();
1043
		#$conf["arrayCountEqualCheck"][]=array();
1044
		$checkResult=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
1044
		$checkResult=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
1045
		unset($conf["variableCheck::checkArguments"]);
1045
		unset($conf["variableCheck::checkArguments"]);
1046
		
1046
 
1047
		#如果檢查失敗
1047
		#如果檢查失敗
1048
		if($checkResult["status"]=="false"){
1048
		if($checkResult["status"]=="false"){
1049
			
1049
 
1050
			#設置執行不正常
1050
			#設置執行不正常
1051
			$result["status"]="false";
1051
			$result["status"]="false";
1052
			
1052
 
1053
			#設置錯誤訊息
1053
			#設置錯誤訊息
1054
			$result["error"]=$checkResult;
1054
			$result["error"]=$checkResult;
1055
			
1055
 
1056
			#回傳結果
1056
			#回傳結果
1057
			return $result;
1057
			return $result;
1058
			
1058
 
1059
			}#if end
1059
			}#if end
1060
			
1060
 
1061
		#如果檢查不通過
1061
		#如果檢查不通過
1062
		if($checkResult["passed"]=="false"){
1062
		if($checkResult["passed"]=="false"){
1063
			
1063
 
1064
			#設置執行不正常
1064
			#設置執行不正常
1065
			$result["status"]="false";
1065
			$result["status"]="false";
1066
			
1066
 
1067
			#設置錯誤訊息
1067
			#設置錯誤訊息
1068
			$result["error"]=$checkResult;
1068
			$result["error"]=$checkResult;
1069
			
1069
 
1070
			#回傳結果
1070
			#回傳結果
1071
			return $result;
1071
			return $result;
1072
			
1072
 
1073
			}#if end
1073
			}#if end
1074
		
1074
 
1075
		#涵式說明:
1075
		#涵式說明:
1076
		#<div>區塊,裡面可以指定css的class樣式,可以指定提示文字.
1076
		#<div>區塊,裡面可以指定css的class樣式,可以指定提示文字.
1077
		#$result["status"],字串,執行否正常,"true"代表正常,"false"代表不正常.
1077
		#$result["status"],字串,執行否正常,"true"代表正常,"false"代表不正常.
1078
		#$result["functin"],字串,當前函數的名稱.
1078
		#$result["functin"],字串,當前函數的名稱.
1079
		#$result["error"],陣列,錯訊訊息.
1079
		#$result["error"],陣列,錯訊訊息.
Line 1086... Line 1086...
1086
		$conf["css::divSection"]["id"]=$conf["id"];
1086
		$conf["css::divSection"]["id"]=$conf["id"];
1087
		#$conf["styleAttr"],字串陣列,給div區段要套用的style樣式屬性.
1087
		#$conf["styleAttr"],字串陣列,給div區段要套用的style樣式屬性.
1088
		$conf["css::divSection"]["styleAttr"]=array("overflow-y");
1088
		$conf["css::divSection"]["styleAttr"]=array("overflow-y");
1089
		#$conf["styleVal"],字串陣列,給div區段要套用的style樣式數值.
1089
		#$conf["styleVal"],字串陣列,給div區段要套用的style樣式數值.
1090
		$conf["css::divSection"]["styleVal"]=array("auto");
1090
		$conf["css::divSection"]["styleVal"]=array("auto");
1091
		
1091
 
1092
			#如果 "oneScreenSize" 為 "false"
1092
			#如果 "oneScreenSize" 為 "false"
1093
			if($conf["oneScreenSize"]==="false"){
1093
			if($conf["oneScreenSize"]==="false"){
1094
				
1094
 
1095
				#如果有設置 "height"
1095
				#如果有設置 "height"
1096
				if(isset($conf["height"])){
1096
				if(isset($conf["height"])){
1097
					
1097
 
1098
					#設置高度屬性
1098
					#設置高度屬性
1099
					$conf["css::divSection"]["styleAttr"][]="height";
1099
					$conf["css::divSection"]["styleAttr"][]="height";
1100
					
1100
 
1101
					#設置高度屬性數值
1101
					#設置高度屬性數值
1102
					$conf["css::divSection"]["styleVal"][]=$conf["height"];
1102
					$conf["css::divSection"]["styleVal"][]=$conf["height"];
1103
					
1103
 
1104
					}#if end
1104
					}#if end
1105
				
1105
 
1106
				}#if end
1106
				}#if end
1107
		
1107
 
1108
		#$conf["class"],字串,div區段要套用的css樣式.
1108
		#$conf["class"],字串,div區段要套用的css樣式.
1109
		#$conf["class"]="";
1109
		#$conf["class"]="";
1110
		#$conf["title"],陣列,滑鼠移到上面時要顯示的內容,每個元素代表一列內容.
1110
		#$conf["title"],陣列,滑鼠移到上面時要顯示的內容,每個元素代表一列內容.
1111
		#$conf["title"]=array();
1111
		#$conf["title"]=array();
1112
		#$conf["oneScreenSize"],字串,div區塊是否要占一個螢幕的大小,預設為"false"不設定,"true"為設定成一個螢幕的大小.
1112
		#$conf["oneScreenSize"],字串,div區塊是否要占一個螢幕的大小,預設為"false"不設定,"true"為設定成一個螢幕的大小.
1113
		$conf["css::divSection"]["oneScreenSize"]=$conf["oneScreenSize"];
1113
		$conf["css::divSection"]["oneScreenSize"]=$conf["oneScreenSize"];
1114
		#$conf["textAlignCenter"],字串,div區塊是否要置中,預設為$conf["oneScreenSize"]的值,"false"為不置中,"true"代表要置中.
1114
		#$conf["textAlignCenter"],字串,div區塊是否要置中,預設為$conf["oneScreenSize"]的值,"false"為不置中,"true"代表要置中.
1115
		#$conf["textAlignCenter"]="";
1115
		#$conf["textAlignCenter"]="";
1116
		$divSection=css::divSection($conf["css::divSection"]);
1116
		$divSection=css::divSection($conf["css::divSection"]);
1117
		unset($conf["css::divSection"]);
1117
		unset($conf["css::divSection"]);
1118
		
1118
 
1119
		#如果建立div frame失敗
1119
		#如果建立div frame失敗
1120
		if($divSection["status"]==="false"){
1120
		if($divSection["status"]==="false"){
1121
			
1121
 
1122
			#設置執行失敗
1122
			#設置執行失敗
1123
			$result["status"]="false";
1123
			$result["status"]="false";
1124
			
1124
 
1125
			#設置執行錯誤訊息
1125
			#設置執行錯誤訊息
1126
			$result["error"]=$divSection;
1126
			$result["error"]=$divSection;
1127
			
1127
 
1128
			#回傳結果
1128
			#回傳結果
1129
			return $result;
1129
			return $result;
1130
			
1130
 
1131
			}#if end
1131
			}#if end
1132
			
1132
 
1133
		#設置要回傳的語法
1133
		#設置要回傳的語法
1134
		$result["content"]=$divSection["content"];
1134
		$result["content"]=$divSection["content"];
1135
		
1135
 
1136
		#設置執行正常
1136
		#設置執行正常
1137
		$result["status"]="true";
1137
		$result["status"]="true";
1138
		
1138
 
1139
		#回傳結果
1139
		#回傳結果
1140
		return $result;
1140
		return $result;
1141
		
1141
 
1142
		}#function div end	
1142
		}#function div end
1143
		
1143
 
1144
	/*
1144
	/*
1145
	#函式說明:
1145
	#函式說明:
1146
	#建立多個用div做成的frame.
1146
	#建立多個用div做成的frame.
1147
	#回傳結果:
1147
	#回傳結果:
1148
	#$result["status"],執行成功或失敗,成功為"true";"false"為失敗.
1148
	#$result["status"],執行成功或失敗,成功為"true";"false"為失敗.
Line 1165... Line 1165...
1165
	#無.
1165
	#無.
1166
	#備註:
1166
	#備註:
1167
	#無.
1167
	#無.
1168
	*/
1168
	*/
1169
	public static function multiDiv(&$conf=array()){
1169
	public static function multiDiv(&$conf=array()){
1170
		
1170
 
1171
		#初始化要回傳的結果
1171
		#初始化要回傳的結果
1172
		$result=array();
1172
		$result=array();
1173
 
1173
 
1174
		#取得當前執行的函數名稱
1174
		#取得當前執行的函數名稱
1175
		$result["function"]=__FUNCTION__;
1175
		$result["function"]=__FUNCTION__;
Line 1177... Line 1177...
1177
		#初始化語法
1177
		#初始化語法
1178
		$result["content"]="";
1178
		$result["content"]="";
1179
 
1179
 
1180
		#如果沒有參數
1180
		#如果沒有參數
1181
		if(func_num_args()==0){
1181
		if(func_num_args()==0){
1182
			
1182
 
1183
			#設置執行失敗
1183
			#設置執行失敗
1184
			$result["status"]="false";
1184
			$result["status"]="false";
1185
			
1185
 
1186
			#設置執行錯誤訊息
1186
			#設置執行錯誤訊息
1187
			$result["error"]="函數".$result["function"]."需要參數";
1187
			$result["error"]="函數".$result["function"]."需要參數";
1188
			
1188
 
1189
			#回傳結果
1189
			#回傳結果
1190
			return $result;
1190
			return $result;
1191
			
1191
 
1192
			}#if end
1192
			}#if end
1193
 
1193
 
1194
		#取得參數
1194
		#取得參數
1195
		$result["argu"]=$conf;
1195
		$result["argu"]=$conf;
1196
 
1196
 
1197
		#如果 $conf 不為陣列
1197
		#如果 $conf 不為陣列
1198
		if(gettype($conf)!=="array"){
1198
		if(gettype($conf)!=="array"){
1199
			
1199
 
1200
			#設置執行失敗
1200
			#設置執行失敗
1201
			$result["status"]="false";
1201
			$result["status"]="false";
1202
			
1202
 
1203
			#設置執行錯誤訊息
1203
			#設置執行錯誤訊息
1204
			$result["error"][]="\$conf變數須為陣列形態";
1204
			$result["error"][]="\$conf變數須為陣列形態";
1205
			
1205
 
1206
			#如果傳入的參數為 null
1206
			#如果傳入的參數為 null
1207
			if($conf===null){
1207
			if($conf===null){
1208
				
1208
 
1209
				#設置執行錯誤訊息
1209
				#設置執行錯誤訊息
1210
				$result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
1210
				$result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
1211
				
1211
 
1212
				}#if end
1212
				}#if end
1213
 
1213
 
1214
			#回傳結果
1214
			#回傳結果
1215
			return $result;
1215
			return $result;
1216
			
1216
 
1217
			}#if end
1217
			}#if end
1218
		
1218
 
1219
		#檢查參數
1219
		#檢查參數
1220
		#函式說明:
1220
		#函式說明:
1221
		#檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容。
1221
		#檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容。
1222
		#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
1222
		#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
1223
		#$reuslt["error"],執行不正常結束的錯訊息陣列.
1223
		#$reuslt["error"],執行不正常結束的錯訊息陣列.
Line 1229... Line 1229...
1229
		#必填寫的參數:
1229
		#必填寫的參數:
1230
		#$conf["varInput"],陣列變數,要檢查的陣列變數,請在要檢查的參數前面加上&,這樣變動的結果才能被套用。
1230
		#$conf["varInput"],陣列變數,要檢查的陣列變數,請在要檢查的參數前面加上&,這樣變動的結果才能被套用。
1231
		$conf["variableCheck::checkArguments"]["varInput"]=&$conf;
1231
		$conf["variableCheck::checkArguments"]["varInput"]=&$conf;
1232
		#$conf["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
1232
		#$conf["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
1233
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("id");
1233
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("id");
1234
		#$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列 例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double"); 
1234
		#$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列 例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double");
1235
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("array");
1235
		$conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("array");
1236
		#$conf["variableCheck::checkArguments"]["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
1236
		#$conf["variableCheck::checkArguments"]["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
1237
		$conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
1237
		$conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
1238
		#可以省略的參數:
1238
		#可以省略的參數:
1239
		#$conf["canBeEmptyString"],必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true"。
1239
		#$conf["canBeEmptyString"],必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true"。
1240
		#$conf["variableCheck::checkArguments"]["canBeEmptyString"]="true";
1240
		#$conf["variableCheck::checkArguments"]["canBeEmptyString"]="true";
1241
		#$conf["skipableVariableName"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
1241
		#$conf["skipableVariableName"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
1242
		$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("content","oneScreenSize","height","div2heightIsSeeHeightLessDiv1height");
1242
		$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("content","oneScreenSize","height","div2heightIsSeeHeightLessDiv1height");
1243
		#$conf["skipableVariableType"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double"); 
1243
		#$conf["skipableVariableType"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double");
1244
		$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("array","array","array","string");
1244
		$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("array","array","array","string");
1245
		#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,null代表不指定,若預設值是必填參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
1245
		#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,null代表不指定,若預設值是必填參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
1246
		$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array(null,null,null,"false");
1246
		$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array(null,null,null,"false");
1247
		#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
1247
		#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
1248
		#$conf["variableCheck::checkArguments"]["arrayCountEqualCheck"][]=array();
1248
		#$conf["variableCheck::checkArguments"]["arrayCountEqualCheck"][]=array();
1249
		$checkResult=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
1249
		$checkResult=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
1250
		unset($conf["variableCheck::checkArguments"]);
1250
		unset($conf["variableCheck::checkArguments"]);
1251
		
1251
 
1252
		#如果檢查失敗
1252
		#如果檢查失敗
1253
		if($checkResult["status"]=="false"){
1253
		if($checkResult["status"]=="false"){
1254
			
1254
 
1255
			#設置執行不正常
1255
			#設置執行不正常
1256
			$result["status"]="false";
1256
			$result["status"]="false";
1257
			
1257
 
1258
			#設置錯誤訊息
1258
			#設置錯誤訊息
1259
			$result["error"]=$checkResult;
1259
			$result["error"]=$checkResult;
1260
			
1260
 
1261
			#回傳結果
1261
			#回傳結果
1262
			return $result;
1262
			return $result;
1263
			
1263
 
1264
			}#if end
1264
			}#if end
1265
			
1265
 
1266
		#如果檢查不通過
1266
		#如果檢查不通過
1267
		if($checkResult["passed"]=="false"){
1267
		if($checkResult["passed"]=="false"){
1268
			
1268
 
1269
			#設置執行不正常
1269
			#設置執行不正常
1270
			$result["status"]="false";
1270
			$result["status"]="false";
1271
			
1271
 
1272
			#設置錯誤訊息
1272
			#設置錯誤訊息
1273
			$result["error"]=$checkResult;
1273
			$result["error"]=$checkResult;
1274
			
1274
 
1275
			#回傳結果
1275
			#回傳結果
1276
			return $result;
1276
			return $result;
1277
			
1277
 
1278
			}#if end
1278
			}#if end
1279
		
1279
 
1280
		#有幾個 $conf["id"] 就執行幾次
1280
		#有幾個 $conf["id"] 就執行幾次
1281
		for($i=0;$i<count($conf["id"]);$i++){
1281
		for($i=0;$i<count($conf["id"]);$i++){
1282
						
1282
 
1283
			#函式說明:
1283
			#函式說明:
1284
			#用div做成的frame.
1284
			#用div做成的frame.
1285
			#回傳結果:
1285
			#回傳結果:
1286
			#$result["status"],執行成功或失敗,成功為"true";"false"為失敗.
1286
			#$result["status"],執行成功或失敗,成功為"true";"false"為失敗.
1287
			#$result["functin"],字串,當前函數的名稱.
1287
			#$result["functin"],字串,當前函數的名稱.
Line 1290... Line 1290...
1290
			#必填參數:
1290
			#必填參數:
1291
			#$conf["id"],字串,div frame的id.
1291
			#$conf["id"],字串,div frame的id.
1292
			$conf["frame::div"]["id"]=$conf["id"][$i];
1292
			$conf["frame::div"]["id"]=$conf["id"][$i];
1293
			#可省略參數:
1293
			#可省略參數:
1294
			#$conf["content"],字串陣列,要放入到frame的內容,預設不使用.
1294
			#$conf["content"],字串陣列,要放入到frame的內容,預設不使用.
1295
				
1295
 
1296
				#如果存在 "content"
1296
				#如果存在 "content"
1297
				if(isset($conf["content"])){
1297
				if(isset($conf["content"])){
1298
					
1298
 
1299
					#如果存在 ["content"][$i]
1299
					#如果存在 ["content"][$i]
1300
					if(isset($conf["content"][$i])){
1300
					if(isset($conf["content"][$i])){
1301
					
1301
 
1302
						#如果不為
1302
						#如果不為
1303
						if($conf["content"][$i]!==null){
1303
						if($conf["content"][$i]!==null){
1304
					
1304
 
1305
							#設置frame的內容
1305
							#設置frame的內容
1306
							$conf["frame::div"]["content"]=$conf["content"][$i];
1306
							$conf["frame::div"]["content"]=$conf["content"][$i];
1307
						
1307
 
1308
							#var_dump($conf["frame::div"]["content"][$i]);
1308
							#var_dump($conf["frame::div"]["content"][$i]);
1309
						
1309
 
1310
							}#if end
1310
							}#if end
1311
						
1311
 
1312
						}#if end
1312
						}#if end
1313
					
1313
 
1314
					}#if end
1314
					}#if end
1315
			
1315
 
1316
			#$conf["oneScreenSize"],字串,是否要為視窗的高度,"true"代表要;"false"代表不要。裡面的div元素也會變成跟視窗一樣高.內部的div要使用line-height:normal樣式來取消效果.
1316
			#$conf["oneScreenSize"],字串,是否要為視窗的高度,"true"代表要;"false"代表不要。裡面的div元素也會變成跟視窗一樣高.內部的div要使用line-height:normal樣式來取消效果.
1317
						
1317
 
1318
				#如果存在 oneScreenSize
1318
				#如果存在 oneScreenSize
1319
				if(isset($conf["oneScreenSize"])){
1319
				if(isset($conf["oneScreenSize"])){
1320
			
1320
 
1321
					#如果存在 ["oneScreenSize"][$i]
1321
					#如果存在 ["oneScreenSize"][$i]
1322
					if(isset($conf["oneScreenSize"][$i])){
1322
					if(isset($conf["oneScreenSize"][$i])){
1323
					
1323
 
1324
						#如果不為
1324
						#如果不為
1325
						if($conf["oneScreenSize"][$i]!==null){
1325
						if($conf["oneScreenSize"][$i]!==null){
1326
					
1326
 
1327
							#設置frame的內容
1327
							#設置frame的內容
1328
							$conf["frame::div"]["oneScreenSize"]=$conf["oneScreenSize"][$i];
1328
							$conf["frame::div"]["oneScreenSize"]=$conf["oneScreenSize"][$i];
1329
						
1329
 
1330
							}#if end
1330
							}#if end
1331
						
1331
 
1332
						}#if end
1332
						}#if end
1333
			
1333
 
1334
					}#if end
1334
					}#if end
1335
											
1335
 
1336
			#$conf["height"],字串,frame的高度,若 "oneScreenSize" 設置為 "true",則忽略本參數.
1336
			#$conf["height"],字串,frame的高度,若 "oneScreenSize" 設置為 "true",則忽略本參數.
1337
			
1337
 
1338
				#如果存在 height
1338
				#如果存在 height
1339
				if(isset($conf["height"])){
1339
				if(isset($conf["height"])){
1340
			
1340
 
1341
					#如果存在 ["height"][$i]
1341
					#如果存在 ["height"][$i]
1342
					if(isset($conf["height"][$i])){
1342
					if(isset($conf["height"][$i])){
1343
					
1343
 
1344
						#如果不為
1344
						#如果不為
1345
						if($conf["height"][$i]!==null){
1345
						if($conf["height"][$i]!==null){
1346
					
1346
 
1347
							#設置frame的內容
1347
							#設置frame的內容
1348
							$conf["frame::div"]["height"]=$conf["height"][$i];
1348
							$conf["frame::div"]["height"]=$conf["height"][$i];
1349
						
1349
 
1350
							}#if end
1350
							}#if end
1351
						
1351
 
1352
						}#if end
1352
						}#if end
1353
			
1353
 
1354
					}#if end
1354
					}#if end
1355
			
1355
 
1356
			$div=frame::div($conf["frame::div"]);
1356
			$div=frame::div($conf["frame::div"]);
1357
			unset($conf["frame::div"]);
1357
			unset($conf["frame::div"]);
1358
			
1358
 
1359
			#如果建立失敗
1359
			#如果建立失敗
1360
			if($div["status"]==="false"){
1360
			if($div["status"]==="false"){
1361
				
1361
 
1362
				#設置執行不正常
1362
				#設置執行不正常
1363
				$result["status"]="false";
1363
				$result["status"]="false";
1364
				
1364
 
1365
				#設置錯誤訊息
1365
				#設置錯誤訊息
1366
				$result["error"]=$div;
1366
				$result["error"]=$div;
1367
				
1367
 
1368
				#回傳結果
1368
				#回傳結果
1369
				return $result;
1369
				return $result;
1370
				
1370
 
1371
				}#if end
1371
				}#if end
1372
				
1372
 
1373
			#串接 div frame
1373
			#串接 div frame
1374
			$result["content"]=$result["content"].$div["content"];
1374
			$result["content"]=$result["content"].$div["content"];
1375
			
1375
 
1376
			}#for end
1376
			}#for end
1377
			
1377
 
1378
		#如果剛好有兩個div frame
1378
		#如果剛好有兩個div frame
1379
		if(count($conf["id"])===2 && $conf["div2heightIsSeeHeightLessDiv1height"]==="true"){
1379
		if(count($conf["id"])===2 && $conf["div2heightIsSeeHeightLessDiv1height"]==="true"){
1380
			
1380
 
1381
			#函式說明:
1381
			#函式說明:
1382
			#將要執行的script語法透過該函式執行(會在程式外層用<script></script>包起來).
1382
			#將要執行的script語法透過該函式執行(會在程式外層用<script></script>包起來).
1383
			#回傳結果:
1383
			#回傳結果:
1384
			#$result["status"],執行是否正常,"true"為正常,"false"為不正常.
1384
			#$result["status"],執行是否正常,"true"為正常,"false"為不正常.
1385
			#$result["error"],錯誤訊息陣列
1385
			#$result["error"],錯誤訊息陣列
Line 1392... Line 1392...
1392
				window.changeDivFrameEleHeightToFullLessSource.changeSizeFrameId='".$conf["id"][0]."';
1392
				window.changeDivFrameEleHeightToFullLessSource.changeSizeFrameId='".$conf["id"][0]."';
1393
				window.changeDivFrameEleHeightToFullLessSource.fixedSizeFrameId='".$conf["id"][1]."';
1393
				window.changeDivFrameEleHeightToFullLessSource.fixedSizeFrameId='".$conf["id"][1]."';
1394
			";
1394
			";
1395
			#可省略參數:
1395
			#可省略參數:
1396
			#$conf["onReady"],字串,是否要在網頁完全載入後再執行,"false"為不等載入完就先執行,預設為"true"要等載入完再執行.
1396
			#$conf["onReady"],字串,是否要在網頁完全載入後再執行,"false"為不等載入完就先執行,預設為"true"要等載入完再執行.
1397
			$conf["javascript::toScript"]["onReady"]="false";	
1397
			$conf["javascript::toScript"]["onReady"]="false";
1398
			#$conf["globalJs"],字串陣列,為要放入<script>標籤的js全域變數.
1398
			#$conf["globalJs"],字串陣列,為要放入<script>標籤的js全域變數.
1399
			#$conf["globalJs"]=array();
1399
			#$conf["globalJs"]=array();
1400
			#$conf["jsFunciton"],字串陣列,為要放入<script>標籤的js函數.
1400
			#$conf["jsFunciton"],字串陣列,為要放入<script>標籤的js函數.
1401
			#$conf["jsFunciton"]=array();
1401
			#$conf["jsFunciton"]=array();
1402
			#參考資料:
1402
			#參考資料:
1403
			#http://stackoverflow.com/questions/9899372/pure-javascript-equivalent-to-jquerys-ready-how-to-call-a-function-when-the
1403
			#http://stackoverflow.com/questions/9899372/pure-javascript-equivalent-to-jquerys-ready-how-to-call-a-function-when-the
1404
			$toScript=javascript::toScript($conf["javascript::toScript"]);
1404
			$toScript=javascript::toScript($conf["javascript::toScript"]);
1405
			unset($conf["javascript::toScript"]);
1405
			unset($conf["javascript::toScript"]);
1406
			
1406
 
1407
			#如果建立script失敗
1407
			#如果建立script失敗
1408
			if($toScript["status"]==="false"){
1408
			if($toScript["status"]==="false"){
1409
				
1409
 
1410
				#設置執行不正常
1410
				#設置執行不正常
1411
				$result["status"]="false";
1411
				$result["status"]="false";
1412
				
1412
 
1413
				#設置錯誤訊息
1413
				#設置錯誤訊息
1414
				$result["error"]=$toScript;
1414
				$result["error"]=$toScript;
1415
				
1415
 
1416
				#回傳結果
1416
				#回傳結果
1417
				return $result;
1417
				return $result;
1418
				
1418
 
1419
				}#if end				
1419
				}#if end
1420
			
1420
 
1421
			#串接語法
1421
			#串接語法
1422
			$result["content"]=$result["content"].$toScript["content"];
1422
			$result["content"]=$result["content"].$toScript["content"];
1423
			
1423
 
1424
			}#if end
1424
			}#if end
1425
			
1425
 
1426
		#設置執行正常
1426
		#設置執行正常
1427
		$result["status"]="true";
1427
		$result["status"]="true";
1428
		
1428
 
1429
		#回傳結果
1429
		#回傳結果
1430
		return $result;
1430
		return $result;
1431
		
1431
 
1432
		}#function multiDiv end
1432
		}#function multiDiv end
1433
			
1433
 
1434
	/*
1434
	/*
1435
	#函式說明:
1435
	#函式說明:
1436
	#透過javaScript建立iframe獲得更多控制權限.
1436
	#透過javaScript建立iframe獲得更多控制權限.
1437
	#回傳結果:
1437
	#回傳結果:
1438
	#$result["status"],執行正常與否.
1438
	#$result["status"],執行正常與否.
Line 1447... Line 1447...
1447
	#無.
1447
	#無.
1448
	#備註:
1448
	#備註:
1449
	#建構中...
1449
	#建構中...
1450
	*/
1450
	*/
1451
	public static function js(&$conf){
1451
	public static function js(&$conf){
1452
	
1452
 
1453
		
1453
 
1454
	
1454
 
1455
		}#fucntion js end
1455
		}#fucntion js end
1456
			
1456
 
1457
	}#class frame end
1457
	}#class frame end
1458
 
1458
 
1459
?>
1459
?>