Subversion Repositories php-qbpwcf

Rev

Rev 226 | Details | Compare with Previous | Last modification | View Log | RSS feed

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