| 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 |
輸出各種用途文字的類別.
|
|
|
29 |
備註:
|
|
|
30 |
無.
|
|
|
31 |
*/
|
|
|
32 |
class text{
|
|
|
33 |
|
|
|
34 |
/*
|
|
|
35 |
#函式說明:
|
|
|
36 |
#當前類別被呼叫的靜態方法不存在時,將會執行該函數,回報該方法不存在.
|
|
|
37 |
#回傳結果:
|
|
|
38 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
|
|
39 |
#$reuslt["error"],執行不正常結束的錯訊息陣列.
|
|
|
40 |
#$result["function"],當前執行的函式名稱.
|
|
|
41 |
#必填參數:
|
|
|
42 |
#$method,物件,為物件實體或類別名稱,會自動置入該參數.
|
|
|
43 |
#$arguments,陣列,為呼叫方法時所用的參數.
|
|
|
44 |
#可省略參數:
|
|
|
45 |
#無.
|
|
|
46 |
#參考資料:
|
|
|
47 |
#__call=>http://php.net/manual/en/language.oop5.overloading.php#object.callstatic
|
|
|
48 |
#備註:
|
|
|
49 |
#無.
|
|
|
50 |
*/
|
|
|
51 |
public function __call($method,$arguments){
|
| 226 |
liveuser |
52 |
|
| 3 |
liveuser |
53 |
#取得當前執行的函式
|
|
|
54 |
$result["function"]=__FUNCTION__;
|
| 226 |
liveuser |
55 |
|
| 3 |
liveuser |
56 |
#設置執行不正常
|
|
|
57 |
$result["status"]="false";
|
| 226 |
liveuser |
58 |
|
| 3 |
liveuser |
59 |
#設置執行錯誤
|
|
|
60 |
$result["error"][]=__NAMESPACE__ ."/".$method."() 不存在!";
|
| 226 |
liveuser |
61 |
|
| 3 |
liveuser |
62 |
#設置所丟入的參數
|
|
|
63 |
$result["error"][]=$arguments;
|
| 226 |
liveuser |
64 |
|
| 3 |
liveuser |
65 |
#回傳結果
|
|
|
66 |
return $result;
|
| 226 |
liveuser |
67 |
|
| 3 |
liveuser |
68 |
}#function __call end
|
| 226 |
liveuser |
69 |
|
| 3 |
liveuser |
70 |
/*
|
|
|
71 |
#函式說明:
|
|
|
72 |
#當前類別被呼叫的靜態方法不存在時,將會執行該函數,回報該方法不存在.
|
|
|
73 |
#回傳結果:
|
|
|
74 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
|
|
75 |
#$reuslt["error"],執行不正常結束的錯訊息陣列.
|
|
|
76 |
#$result["function"],當前執行的函式名稱.
|
|
|
77 |
#必填參數:
|
|
|
78 |
#$method,物件,為物件實體或類別名稱,會自動置入該參數.
|
|
|
79 |
#$arguments,陣列,為呼叫方法時所用的參數.
|
|
|
80 |
#可省略參數:
|
|
|
81 |
#無.
|
|
|
82 |
#參考資料:
|
|
|
83 |
#__callStatic=>http://php.net/manual/en/language.oop5.overloading.php#object.callstatic
|
|
|
84 |
#備註:
|
|
|
85 |
#無.
|
|
|
86 |
*/
|
|
|
87 |
public static function __callStatic($method,$arguments){
|
| 226 |
liveuser |
88 |
|
| 3 |
liveuser |
89 |
#取得當前執行的函式
|
|
|
90 |
$result["function"]=__FUNCTION__;
|
| 226 |
liveuser |
91 |
|
| 3 |
liveuser |
92 |
#設置執行不正常
|
|
|
93 |
$result["status"]="false";
|
| 226 |
liveuser |
94 |
|
| 3 |
liveuser |
95 |
#設置執行錯誤
|
|
|
96 |
$result["error"][]="欲呼叫的". __NAMESPACE__ ."/".$method."() 不存在!";
|
| 226 |
liveuser |
97 |
|
| 3 |
liveuser |
98 |
#設置所丟入的參數
|
|
|
99 |
$result["error"][]=$arguments;
|
| 226 |
liveuser |
100 |
|
| 3 |
liveuser |
101 |
#回傳結果
|
|
|
102 |
return $result;
|
| 226 |
liveuser |
103 |
|
| 3 |
liveuser |
104 |
}#function __callStatic end
|
|
|
105 |
|
|
|
106 |
/*
|
|
|
107 |
#函式說明:
|
|
|
108 |
#顯示html的註解.
|
|
|
109 |
#回傳的結果:
|
|
|
110 |
#$result["status"],執行是否正常,"true"為正常,"false"為不正常.
|
|
|
111 |
#$result["error"],錯誤訊息陣列.
|
|
|
112 |
#$result["function"],當前執行的函數名稱.
|
|
|
113 |
#$result["output"],我們所要的內容.
|
|
|
114 |
#必填的參數:
|
|
|
115 |
#$conf["contentArray"],陣列型態,代表每一行的註解內容.
|
|
|
116 |
$conf["contentArray"]=array("");
|
|
|
117 |
#可省略的參數:
|
|
|
118 |
#無.
|
|
|
119 |
#參考資料:
|
|
|
120 |
#w3c HTML <!--...--> Tag,http://www.w3schools.com/tags/tag_comment.asp.
|
|
|
121 |
#備註:
|
|
|
122 |
#\r與\n代表換行.
|
|
|
123 |
*/
|
| 207 |
liveuser |
124 |
public static function htmlComment(&$conf){
|
| 226 |
liveuser |
125 |
|
| 3 |
liveuser |
126 |
#初始化要回傳的結果
|
|
|
127 |
$result=array();
|
|
|
128 |
|
|
|
129 |
#儲存當前執行的函數
|
|
|
130 |
$result["function"]=__FUNCTION__;
|
|
|
131 |
|
|
|
132 |
#如果 $conf 不為陣列
|
|
|
133 |
if(gettype($conf)!="array"){
|
| 226 |
liveuser |
134 |
|
| 3 |
liveuser |
135 |
#設置執行失敗
|
|
|
136 |
$result["status"]="false";
|
| 226 |
liveuser |
137 |
|
| 3 |
liveuser |
138 |
#設置執行錯誤訊息
|
|
|
139 |
$result["error"][]="\$conf變數須為陣列形態";
|
|
|
140 |
|
|
|
141 |
#如果傳入的參數為 null
|
|
|
142 |
if($conf==null){
|
| 226 |
liveuser |
143 |
|
| 3 |
liveuser |
144 |
#設置執行錯誤訊息
|
|
|
145 |
$result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
|
| 226 |
liveuser |
146 |
|
| 3 |
liveuser |
147 |
}#if end
|
|
|
148 |
|
|
|
149 |
#回傳結果
|
|
|
150 |
return $result;
|
| 226 |
liveuser |
151 |
|
| 3 |
liveuser |
152 |
}#if end
|
| 226 |
liveuser |
153 |
|
| 3 |
liveuser |
154 |
#檢查參數
|
|
|
155 |
#函式說明:
|
|
|
156 |
#檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容。
|
|
|
157 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
|
|
158 |
#$reuslt["error"],執行不正常結束的錯訊息陣列.
|
|
|
159 |
#$result["function"],當前執行的函式名稱.
|
|
|
160 |
#$result["passed"],識別要檢查的全體變數是否存在以及型態是否正確的變數,"true"代表檢查全部通過;"false"代表檢查不通過
|
|
|
161 |
#$result[$shouldBtCheckedVarName]["varExist"],所檢查的變數是否存在,"false"代表不存在;"true"代表存在
|
|
|
162 |
#$result[$shouldBtCheckedVarName]["varType"],所檢查的變數型態是否正確,"false"代表錯誤;"true"代表正確
|
|
|
163 |
#$result[$shouldBtCheckedVarName]["error"],每個參數設定的錯誤訊息
|
|
|
164 |
#$result["argu"],字串陣列,目前輸入的參數名稱陣列.
|
|
|
165 |
#$result["legalVarName"],字串陣列,合法可用的參數名稱陣列.
|
|
|
166 |
#$result["notNeedVar"],字串陣列,多餘的參數名稱.
|
|
|
167 |
#必填寫的參數:
|
|
|
168 |
#$conf["varInput"],陣列變數,要檢查的陣列變數,請在要檢查的參數前面加上&,這樣變動的結果才能被套用。
|
|
|
169 |
$conf["variableCheck::checkArguments"]["varInput"]=&$conf;
|
|
|
170 |
#$conf["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,元素數量需要跟"mustBeFilledVariableType"參數的元素數量一致,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
|
|
|
171 |
$conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("contentArray");
|
| 226 |
liveuser |
172 |
#$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列,元素數量需要跟"mustBeFilledVariableName"參數的元素數量一致,例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double","resource","object");
|
| 3 |
liveuser |
173 |
$conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("array");
|
|
|
174 |
#$conf["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
|
|
|
175 |
$conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
|
|
|
176 |
#可以省略的參數:
|
|
|
177 |
#$conf["canBeEmptyString"],必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true"。
|
|
|
178 |
#$conf["variableCheck::checkArguments"]["canBeEmptyString"]="false";
|
|
|
179 |
#$conf["skipableVariableName"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
|
|
|
180 |
#$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("customSettings");
|
| 226 |
liveuser |
181 |
#$conf["skipableVariableType"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double");
|
| 3 |
liveuser |
182 |
#$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("array");
|
|
|
183 |
#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,null與代表不指定,若預設值是參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
|
|
|
184 |
#$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array(null);
|
|
|
185 |
#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
|
|
|
186 |
#$conf["arrayCountEqualCheck"][]=array();
|
|
|
187 |
#參考資料來源:
|
|
|
188 |
#array_keys=>http://php.net/manual/en/function.array-keys.php
|
|
|
189 |
$checkArguments=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
|
|
|
190 |
unset($conf["variableCheck::checkArguments"]);
|
| 226 |
liveuser |
191 |
|
| 3 |
liveuser |
192 |
#如果檢查失敗
|
|
|
193 |
if($checkArguments["status"]=="false"){
|
| 226 |
liveuser |
194 |
|
| 3 |
liveuser |
195 |
#設置錯誤識別
|
|
|
196 |
$result["status"]="false";
|
| 226 |
liveuser |
197 |
|
| 3 |
liveuser |
198 |
#設置錯誤訊息
|
|
|
199 |
$result["error"]=$checkArguments;
|
| 226 |
liveuser |
200 |
|
| 3 |
liveuser |
201 |
#回傳結果
|
|
|
202 |
return $result;
|
| 226 |
liveuser |
203 |
|
| 3 |
liveuser |
204 |
}#if end
|
| 226 |
liveuser |
205 |
|
| 3 |
liveuser |
206 |
#如果檢查不通過
|
|
|
207 |
if($checkArguments["passed"]=="false"){
|
| 226 |
liveuser |
208 |
|
| 3 |
liveuser |
209 |
#設置錯誤識別
|
|
|
210 |
$result["status"]="false";
|
| 226 |
liveuser |
211 |
|
| 3 |
liveuser |
212 |
#設置錯誤訊息
|
|
|
213 |
$result["error"]=$checkArguments;
|
| 226 |
liveuser |
214 |
|
| 3 |
liveuser |
215 |
#回傳結果
|
|
|
216 |
return $result;
|
| 226 |
liveuser |
217 |
|
| 3 |
liveuser |
218 |
}#if end
|
| 226 |
liveuser |
219 |
|
| 3 |
liveuser |
220 |
#初始化用來儲存輸出內容的元素.
|
|
|
221 |
$result["output"]="";
|
| 226 |
liveuser |
222 |
|
| 3 |
liveuser |
223 |
#初始化要輸出的註解標籤開頭
|
|
|
224 |
$result["output"]=$result["output"]."<!-- \r\n";
|
| 226 |
liveuser |
225 |
|
| 3 |
liveuser |
226 |
#執行到這邊代表參數正確
|
|
|
227 |
#針對每個 $conf["contentArray"]
|
|
|
228 |
foreach($conf["contentArray"] as $lineContent){
|
| 226 |
liveuser |
229 |
|
| 3 |
liveuser |
230 |
#串接要輸出的註解內容
|
|
|
231 |
$result["output"]=$result["output"].$lineContent."\r\n";
|
| 226 |
liveuser |
232 |
|
| 3 |
liveuser |
233 |
}#foreach end
|
| 226 |
liveuser |
234 |
|
| 3 |
liveuser |
235 |
#加上要輸出的註解標籤結束
|
|
|
236 |
$result["output"]=$result["output"]." --> \r\n";
|
| 226 |
liveuser |
237 |
|
| 3 |
liveuser |
238 |
#執行到這邊代表執行成功
|
|
|
239 |
$result["status"]="true";
|
| 226 |
liveuser |
240 |
|
| 3 |
liveuser |
241 |
#回傳結果
|
|
|
242 |
return $result;
|
| 226 |
liveuser |
243 |
|
| 3 |
liveuser |
244 |
}#function htmlComment end
|
| 226 |
liveuser |
245 |
|
| 3 |
liveuser |
246 |
/*
|
|
|
247 |
#函式說明:
|
| 207 |
liveuser |
248 |
#顯示一行文字,太常會自動換行.
|
| 3 |
liveuser |
249 |
#回傳的結果:
|
|
|
250 |
#$result["status"],執行是否正常,"true"為正常,"false"為不正常.
|
|
|
251 |
#$result["error"],錯誤訊息陣列.
|
|
|
252 |
#$result["function"],當前執行的函數名稱.
|
|
|
253 |
#$result["content"],語法.
|
|
|
254 |
#必填參數:
|
|
|
255 |
#$conf["string"],字串
|
|
|
256 |
$conf["string"]="";
|
|
|
257 |
#可省略參數:
|
|
|
258 |
#$conf["class"],字串,要使用的css樣式名稱,預設為"__qbpwcf_divFontCssStyle".
|
|
|
259 |
#$conf["class"]="";
|
|
|
260 |
#參考資料:
|
|
|
261 |
#無.
|
|
|
262 |
#備註:
|
|
|
263 |
#無.
|
| 207 |
liveuser |
264 |
*/
|
|
|
265 |
public static function oneLine(&$conf){
|
| 3 |
liveuser |
266 |
|
|
|
267 |
#初始化要回傳的結果
|
|
|
268 |
$result=array();
|
|
|
269 |
|
|
|
270 |
#儲存當前執行的函數
|
|
|
271 |
$result["function"]=__FUNCTION__;
|
|
|
272 |
|
|
|
273 |
#如果 $conf 不為陣列
|
|
|
274 |
if(gettype($conf)!="array"){
|
| 226 |
liveuser |
275 |
|
| 3 |
liveuser |
276 |
#設置執行失敗
|
|
|
277 |
$result["status"]="false";
|
| 226 |
liveuser |
278 |
|
| 3 |
liveuser |
279 |
#設置執行錯誤訊息
|
|
|
280 |
$result["error"][]="\$conf變數須為陣列形態";
|
|
|
281 |
|
|
|
282 |
#如果傳入的參數為 null
|
|
|
283 |
if($conf==null){
|
| 226 |
liveuser |
284 |
|
| 3 |
liveuser |
285 |
#設置執行錯誤訊息
|
|
|
286 |
$result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
|
| 226 |
liveuser |
287 |
|
| 3 |
liveuser |
288 |
}#if end
|
|
|
289 |
|
|
|
290 |
#回傳結果
|
|
|
291 |
return $result;
|
| 226 |
liveuser |
292 |
|
| 3 |
liveuser |
293 |
}#if end
|
|
|
294 |
|
|
|
295 |
#初始化要回傳的語法
|
|
|
296 |
$result["content"]="";
|
|
|
297 |
|
|
|
298 |
#函式說明:
|
|
|
299 |
#檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容。
|
|
|
300 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
|
|
301 |
#$reuslt["error"],執行不正常結束的錯訊息陣列.
|
|
|
302 |
#$result["function"],當前執行的函式名稱.
|
|
|
303 |
#$result["passed"],識別要檢查的全體變數是否存在以及型態是否正確的變數,"true"代表檢查全部通過;"false"代表檢查不通過
|
|
|
304 |
#$result[$shouldBtCheckedVarName]["varExist"],所檢查的變數是否存在,"false"代表不存在;"true"代表存在
|
|
|
305 |
#$result[$shouldBtCheckedVarName]["varType"],所檢查的變數型態是否正確,"false"代表錯誤;"true"代表正確
|
|
|
306 |
#$result[$shouldBtCheckedVarName]["error"],每個參數設定的錯誤訊息
|
|
|
307 |
#必填寫的參數:
|
|
|
308 |
#$conf["varInput"],陣列變數,要檢查的陣列變數,請在要檢查的參數前面加上&,這樣變動的結果才能被套用。
|
|
|
309 |
$conf["variableCheck::checkArguments"]["varInput"]=&$conf;
|
|
|
310 |
#$conf["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
|
|
|
311 |
$conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("string");
|
| 226 |
liveuser |
312 |
#$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列 例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double");
|
| 3 |
liveuser |
313 |
$conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("string");
|
|
|
314 |
#$conf["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
|
|
|
315 |
$conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
|
|
|
316 |
#可以省略的參數:
|
|
|
317 |
#$conf["canBeEmptyString"],必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true"。
|
|
|
318 |
#$conf["variableCheck::checkArguments"]["canBeEmptyString"]="false";
|
|
|
319 |
#$conf["skipableVariableName"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
|
|
|
320 |
$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("class");
|
| 226 |
liveuser |
321 |
#$conf["skipableVariableType"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double");
|
| 3 |
liveuser |
322 |
$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("string");
|
|
|
323 |
#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,"null"代表不指定,若預設值是必填參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
|
|
|
324 |
$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array("__qbpwcf_divFontCssStyle");
|
|
|
325 |
#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
|
|
|
326 |
#$conf["arrayCountEqualCheck"][]=array();
|
|
|
327 |
$checkResult=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
|
|
|
328 |
unset($conf["variableCheck::checkArguments"]);
|
| 226 |
liveuser |
329 |
|
| 3 |
liveuser |
330 |
#如果 $checkResult["status"] 等於 "false"
|
|
|
331 |
if($checkResult["status"]==="false"){
|
|
|
332 |
|
|
|
333 |
#設置執行失敗識別
|
|
|
334 |
$result["status"]="false";
|
|
|
335 |
|
|
|
336 |
#設置錯誤訊息
|
|
|
337 |
$result["error"]=$checkResult;
|
|
|
338 |
|
|
|
339 |
#回傳結果
|
|
|
340 |
return $result;
|
|
|
341 |
|
|
|
342 |
}#if end
|
|
|
343 |
|
|
|
344 |
#如果 $checkResult["passed"] 等於 "false"
|
|
|
345 |
if($checkResult["passed"]==="false"){
|
|
|
346 |
|
|
|
347 |
#設置執行失敗識別
|
|
|
348 |
$result["status"]="false";
|
|
|
349 |
|
|
|
350 |
#設置錯誤訊息
|
|
|
351 |
$result["error"]=$checkResult;
|
|
|
352 |
|
|
|
353 |
#回傳結果
|
|
|
354 |
return $result;
|
|
|
355 |
|
|
|
356 |
}#if end
|
|
|
357 |
|
|
|
358 |
#設置要顯示的字串
|
|
|
359 |
$result["content"]=$result["content"].$conf["string"];
|
| 226 |
liveuser |
360 |
|
| 3 |
liveuser |
361 |
#設置文字要用的css樣式
|
|
|
362 |
#涵式說明:
|
|
|
363 |
#<div>區塊,裡面可以指定css的class樣式,可以指定提示文字.
|
|
|
364 |
#$result["status"],字串,執行否正常,"true"代表正常,"false"代表不正常.
|
|
|
365 |
#$result["functin"],字串,當前函數的名稱.
|
|
|
366 |
#$result["error"],陣列,錯訊訊息.
|
|
|
367 |
#$result["content"],字串,含有<div>標籤的內容.
|
|
|
368 |
#必填參數:
|
|
|
369 |
#$conf["contentArray"],字串陣列,要放入的內容陣列.
|
|
|
370 |
$conf["css::divSection"]["contentArray"]=array($result["content"]);
|
|
|
371 |
#可省略參數
|
|
|
372 |
#$conf["class"],字串,div區段要套用的css樣式.
|
|
|
373 |
$conf["css::divSection"]["class"]=$conf["class"];
|
|
|
374 |
#$conf["title"],陣列,滑鼠移到上面時要顯示的內容,每個元素代表一列內容
|
|
|
375 |
$conf["css::divSection"]["title"]=array($conf["string"]);
|
|
|
376 |
$divSection=css::divSection($conf["css::divSection"]);
|
| 226 |
liveuser |
377 |
|
| 3 |
liveuser |
378 |
#如果建立div區塊失敗
|
|
|
379 |
if($divSection["status"]=="false"){
|
| 226 |
liveuser |
380 |
|
| 3 |
liveuser |
381 |
#設置執行失敗識別
|
|
|
382 |
$result["status"]="false";
|
|
|
383 |
|
|
|
384 |
#設置錯誤訊息
|
|
|
385 |
$result["error"]=$divSection;
|
|
|
386 |
|
|
|
387 |
#回傳結果
|
|
|
388 |
return $result;
|
| 226 |
liveuser |
389 |
|
| 207 |
liveuser |
390 |
}#if end
|
| 3 |
liveuser |
391 |
|
|
|
392 |
#取得套用css樣式後的字串
|
|
|
393 |
$result["content"]=$divSection["content"];
|
|
|
394 |
|
|
|
395 |
#設置執行成功的識別
|
|
|
396 |
$result["status"]="true";
|
|
|
397 |
|
|
|
398 |
#回傳結果
|
|
|
399 |
return $result;
|
|
|
400 |
|
|
|
401 |
}#function oneLine end
|
| 226 |
liveuser |
402 |
|
| 3 |
liveuser |
403 |
/*
|
|
|
404 |
#函式說明:
|
|
|
405 |
#顯示一行文字,太長會自動省略,後面不段行.
|
|
|
406 |
#回傳的結果:
|
|
|
407 |
#$result["status"],執行是否正常,"true"為正常,"false"為不正常.
|
|
|
408 |
#$result["error"],錯誤訊息陣列.
|
|
|
409 |
#$result["function"],當前執行的函數名稱.
|
|
|
410 |
#$result["content"],語法.
|
|
|
411 |
#必填參數:
|
|
|
412 |
#$conf["string"],字串
|
|
|
413 |
$conf["string"]="";
|
|
|
414 |
#可省略參數:
|
|
|
415 |
#$conf["class"],字串,要使用的css樣式名稱,預設為"__defaultTextStyle"
|
|
|
416 |
#$conf["class"]="";
|
|
|
417 |
#參考資料:
|
|
|
418 |
#無.
|
|
|
419 |
#備註:
|
|
|
420 |
#無.
|
| 207 |
liveuser |
421 |
*/
|
|
|
422 |
public static function oneLineNotEnd(&$conf){
|
| 3 |
liveuser |
423 |
|
|
|
424 |
#初始化要回傳的結果
|
|
|
425 |
$result=array();
|
|
|
426 |
|
|
|
427 |
#儲存當前執行的函數
|
|
|
428 |
$result["function"]=__FUNCTION__;
|
|
|
429 |
|
|
|
430 |
#如果 $conf 不為陣列
|
|
|
431 |
if(gettype($conf)!="array"){
|
| 226 |
liveuser |
432 |
|
| 3 |
liveuser |
433 |
#設置執行失敗
|
|
|
434 |
$result["status"]="false";
|
| 226 |
liveuser |
435 |
|
| 3 |
liveuser |
436 |
#設置執行錯誤訊息
|
|
|
437 |
$result["error"][]="\$conf變數須為陣列形態";
|
|
|
438 |
|
|
|
439 |
#如果傳入的參數為 null
|
|
|
440 |
if($conf==null){
|
| 226 |
liveuser |
441 |
|
| 3 |
liveuser |
442 |
#設置執行錯誤訊息
|
|
|
443 |
$result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
|
| 226 |
liveuser |
444 |
|
| 3 |
liveuser |
445 |
}#if end
|
|
|
446 |
|
|
|
447 |
#回傳結果
|
|
|
448 |
return $result;
|
| 226 |
liveuser |
449 |
|
| 3 |
liveuser |
450 |
}#if end
|
|
|
451 |
|
|
|
452 |
#初始化要回傳的語法
|
|
|
453 |
$result["content"]="";
|
|
|
454 |
|
|
|
455 |
#函式說明:
|
|
|
456 |
#檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容。
|
|
|
457 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
|
|
458 |
#$reuslt["error"],執行不正常結束的錯訊息陣列.
|
|
|
459 |
#$result["function"],當前執行的函式名稱.
|
|
|
460 |
#$result["passed"],識別要檢查的全體變數是否存在以及型態是否正確的變數,"true"代表檢查全部通過;"false"代表檢查不通過
|
|
|
461 |
#$result[$shouldBtCheckedVarName]["varExist"],所檢查的變數是否存在,"false"代表不存在;"true"代表存在
|
|
|
462 |
#$result[$shouldBtCheckedVarName]["varType"],所檢查的變數型態是否正確,"false"代表錯誤;"true"代表正確
|
|
|
463 |
#$result[$shouldBtCheckedVarName]["error"],每個參數設定的錯誤訊息
|
|
|
464 |
#必填寫的參數:
|
|
|
465 |
#$conf["varInput"],陣列變數,要檢查的陣列變數,請在要檢查的參數前面加上&,這樣變動的結果才能被套用。
|
|
|
466 |
$conf["variableCheck::checkArguments"]["varInput"]=&$conf;
|
|
|
467 |
#$conf["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
|
|
|
468 |
$conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("string");
|
| 226 |
liveuser |
469 |
#$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列 例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double");
|
| 3 |
liveuser |
470 |
$conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("string");
|
|
|
471 |
#$conf["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
|
|
|
472 |
$conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
|
|
|
473 |
#可以省略的參數:
|
|
|
474 |
#$conf["canBeEmptyString"],必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true"。
|
|
|
475 |
#$conf["variableCheck::checkArguments"]["canBeEmptyString"]="false";
|
|
|
476 |
#$conf["skipableVariableName"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
|
|
|
477 |
$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("class");
|
| 226 |
liveuser |
478 |
#$conf["skipableVariableType"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double");
|
| 3 |
liveuser |
479 |
$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("string");
|
|
|
480 |
#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,"null"代表不指定,若預設值是必填參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
|
| 207 |
liveuser |
481 |
$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array("__defaultTextNoWrapStyle");
|
| 3 |
liveuser |
482 |
#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
|
|
|
483 |
#$conf["arrayCountEqualCheck"][]=array();
|
|
|
484 |
$checkResult=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
|
|
|
485 |
unset($conf["variableCheck::checkArguments"]);
|
| 226 |
liveuser |
486 |
|
| 3 |
liveuser |
487 |
#如果 $checkResult["status"] 等於 "false"
|
|
|
488 |
if($checkResult["status"]==="false"){
|
|
|
489 |
|
|
|
490 |
#設置執行失敗識別
|
|
|
491 |
$result["status"]="false";
|
|
|
492 |
|
|
|
493 |
#設置錯誤訊息
|
|
|
494 |
$result["error"]=$checkResult;
|
|
|
495 |
|
|
|
496 |
#回傳結果
|
|
|
497 |
return $result;
|
|
|
498 |
|
|
|
499 |
}#if end
|
|
|
500 |
|
|
|
501 |
#如果 $checkResult["passed"] 等於 "false"
|
|
|
502 |
if($checkResult["passed"]==="false"){
|
|
|
503 |
|
|
|
504 |
#設置執行失敗識別
|
|
|
505 |
$result["status"]="false";
|
|
|
506 |
|
|
|
507 |
#設置錯誤訊息
|
|
|
508 |
$result["error"]=$checkResult;
|
|
|
509 |
|
|
|
510 |
#回傳結果
|
|
|
511 |
return $result;
|
|
|
512 |
|
|
|
513 |
}#if end
|
|
|
514 |
|
|
|
515 |
#設置要顯示的字串
|
|
|
516 |
$result["content"]=$result["content"].$conf["string"];
|
| 226 |
liveuser |
517 |
|
| 3 |
liveuser |
518 |
#設置文字要用的css樣式
|
|
|
519 |
#涵式說明:
|
|
|
520 |
#<div>區塊,裡面可以指定css的class樣式,可以指定提示文字.
|
|
|
521 |
#$result["status"],字串,執行否正常,"true"代表正常,"false"代表不正常.
|
|
|
522 |
#$result["functin"],字串,當前函數的名稱.
|
|
|
523 |
#$result["error"],陣列,錯訊訊息.
|
|
|
524 |
#$result["content"],字串,含有<div>標籤的內容.
|
|
|
525 |
#必填參數:
|
|
|
526 |
#$conf["contentArray"],字串陣列,要放入的內容陣列.
|
|
|
527 |
$conf["css::divSection"]["contentArray"]=array($result["content"]);
|
|
|
528 |
#可省略參數
|
|
|
529 |
#$conf["class"],字串,div區段要套用的css樣式.
|
|
|
530 |
$conf["css::divSection"]["class"]=$conf["class"];
|
|
|
531 |
#$conf["title"],陣列,滑鼠移到上面時要顯示的內容,每個元素代表一列內容
|
|
|
532 |
$conf["css::divSection"]["title"]=array($conf["string"]);
|
| 207 |
liveuser |
533 |
$divSection=css::divSection($conf["css::divSection"]);
|
| 226 |
liveuser |
534 |
|
| 3 |
liveuser |
535 |
#如果建立div區塊失敗
|
|
|
536 |
if($divSection["status"]=="false"){
|
| 226 |
liveuser |
537 |
|
| 3 |
liveuser |
538 |
#設置執行失敗識別
|
|
|
539 |
$result["status"]="false";
|
|
|
540 |
|
|
|
541 |
#設置錯誤訊息
|
|
|
542 |
$result["error"]=$divSection;
|
|
|
543 |
|
|
|
544 |
#回傳結果
|
|
|
545 |
return $result;
|
| 226 |
liveuser |
546 |
|
| 207 |
liveuser |
547 |
}#if end
|
| 3 |
liveuser |
548 |
|
|
|
549 |
#取得套用css樣式後的字串
|
|
|
550 |
$result["content"]=$divSection["content"];
|
|
|
551 |
|
|
|
552 |
#設置執行成功的識別
|
|
|
553 |
$result["status"]="true";
|
|
|
554 |
|
|
|
555 |
#回傳結果
|
|
|
556 |
return $result;
|
|
|
557 |
|
|
|
558 |
}#function oneLineNotEnd end
|
| 226 |
liveuser |
559 |
|
| 3 |
liveuser |
560 |
/*
|
|
|
561 |
#函式說明:
|
|
|
562 |
#顯示多行文字.
|
|
|
563 |
#回傳的結果:
|
|
|
564 |
#$result["status"],執行是否正常,"true"為正常,"false"為不正常.
|
|
|
565 |
#$result["error"],錯誤訊息陣列.
|
|
|
566 |
#$result["function"],當前執行的函數名稱.
|
|
|
567 |
#$result["content"],語法.
|
|
|
568 |
#必填參數:
|
|
|
569 |
#$conf["string"],字串陣列,要放置的內容.
|
|
|
570 |
$conf["string"]=array();
|
|
|
571 |
#可省略參數:
|
|
|
572 |
#$conf["class"],字串,要使用的css樣式名稱,預設為"__defaultTextStyle"
|
|
|
573 |
#$conf["class"]="";
|
| 207 |
liveuser |
574 |
#$conf["type"],字串,要用"div"或"divNoWrap"或"span"或"br"或"p"或"EOL"或"textarea"來段行,預設為"EOL".
|
| 3 |
liveuser |
575 |
#$conf["type"]="EOL";
|
|
|
576 |
#參考資料:
|
|
|
577 |
#無.
|
|
|
578 |
#備註:
|
|
|
579 |
#無.
|
| 226 |
liveuser |
580 |
*/
|
| 207 |
liveuser |
581 |
public static function multiLine(&$conf){
|
| 3 |
liveuser |
582 |
|
|
|
583 |
#初始化要回傳的結果
|
|
|
584 |
$result=array();
|
|
|
585 |
|
|
|
586 |
#儲存當前執行的函數
|
|
|
587 |
$result["function"]=__FUNCTION__;
|
|
|
588 |
|
|
|
589 |
#如果 $conf 不為陣列
|
|
|
590 |
if(gettype($conf)!="array"){
|
| 226 |
liveuser |
591 |
|
| 3 |
liveuser |
592 |
#設置執行失敗
|
|
|
593 |
$result["status"]="false";
|
| 226 |
liveuser |
594 |
|
| 3 |
liveuser |
595 |
#設置執行錯誤訊息
|
|
|
596 |
$result["error"][]="\$conf變數須為陣列形態";
|
|
|
597 |
|
|
|
598 |
#如果傳入的參數為 null
|
|
|
599 |
if($conf==null){
|
| 226 |
liveuser |
600 |
|
| 3 |
liveuser |
601 |
#設置執行錯誤訊息
|
|
|
602 |
$result["error"][]="\$conf變數不得為null,請檢查函數「".$result["function"]."」的參數設置有無正確!";
|
| 226 |
liveuser |
603 |
|
| 3 |
liveuser |
604 |
}#if end
|
|
|
605 |
|
|
|
606 |
#回傳結果
|
|
|
607 |
return $result;
|
| 226 |
liveuser |
608 |
|
| 3 |
liveuser |
609 |
}#if end
|
| 226 |
liveuser |
610 |
|
| 3 |
liveuser |
611 |
#初始化要回傳的語法
|
|
|
612 |
$result["content"]="";
|
|
|
613 |
|
|
|
614 |
#函式說明:
|
|
|
615 |
#檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容。
|
|
|
616 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
|
|
617 |
#$reuslt["error"],執行不正常結束的錯訊息陣列.
|
|
|
618 |
#$result["function"],當前執行的函式名稱.
|
|
|
619 |
#$result["passed"],識別要檢查的全體變數是否存在以及型態是否正確的變數,"true"代表檢查全部通過;"false"代表檢查不通過
|
|
|
620 |
#$result[$shouldBtCheckedVarName]["varExist"],所檢查的變數是否存在,"false"代表不存在;"true"代表存在
|
|
|
621 |
#$result[$shouldBtCheckedVarName]["varType"],所檢查的變數型態是否正確,"false"代表錯誤;"true"代表正確
|
|
|
622 |
#$result[$shouldBtCheckedVarName]["error"],每個參數設定的錯誤訊息
|
|
|
623 |
#必填寫的參數:
|
|
|
624 |
#$conf["varInput"],陣列變數,要檢查的陣列變數,請在要檢查的參數前面加上&,這樣變動的結果才能被套用。
|
|
|
625 |
$conf["variableCheck::checkArguments"]["varInput"]=&$conf;
|
|
|
626 |
#$conf["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
|
|
|
627 |
$conf["variableCheck::checkArguments"]["mustBeFilledVariableName"]=array("string");
|
| 226 |
liveuser |
628 |
#$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列 例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double");
|
| 3 |
liveuser |
629 |
$conf["variableCheck::checkArguments"]["mustBeFilledVariableType"]=array("array");
|
|
|
630 |
#$conf["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
|
|
|
631 |
$conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
|
|
|
632 |
#可以省略的參數:
|
|
|
633 |
#$conf["canBeEmptyString"],必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true"。
|
|
|
634 |
#$conf["variableCheck::checkArguments"]["canBeEmptyString"]="false";
|
|
|
635 |
#$conf["skipableVariableName"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
|
|
|
636 |
$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("type","class");
|
| 226 |
liveuser |
637 |
#$conf["skipableVariableType"],爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double");
|
| 3 |
liveuser |
638 |
$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("string","string");
|
|
|
639 |
#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,"null"代表不指定,若預設值是必填參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
|
|
|
640 |
$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array("EOL","__defaultTextStyle");
|
|
|
641 |
#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
|
|
|
642 |
#$conf["arrayCountEqualCheck"][]=array();
|
|
|
643 |
$checkResult=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
|
|
|
644 |
unset($conf["variableCheck::checkArguments"]);
|
| 226 |
liveuser |
645 |
|
| 3 |
liveuser |
646 |
#如果 $checkResult["status"] 等於 "false"
|
|
|
647 |
if($checkResult["status"]=="false"){
|
|
|
648 |
|
|
|
649 |
#設置執行失敗識別
|
|
|
650 |
$result["status"]="false";
|
|
|
651 |
|
|
|
652 |
#設置錯誤訊息
|
|
|
653 |
$result["error"]=$checkResult;
|
|
|
654 |
|
|
|
655 |
#回傳結果
|
|
|
656 |
return $result;
|
|
|
657 |
|
|
|
658 |
}#if end
|
|
|
659 |
|
|
|
660 |
#如果 $checkResult["passed"] 等於 "false"
|
|
|
661 |
if($checkResult["passed"]=="false"){
|
|
|
662 |
|
|
|
663 |
#設置執行失敗識別
|
|
|
664 |
$result["status"]="false";
|
|
|
665 |
|
|
|
666 |
#設置錯誤訊息
|
|
|
667 |
$result["error"]=$checkResult;
|
|
|
668 |
|
|
|
669 |
#回傳結果
|
|
|
670 |
return $result;
|
|
|
671 |
|
|
|
672 |
}#if end
|
|
|
673 |
|
|
|
674 |
#判斷 $conf["type"]
|
|
|
675 |
switch($conf["type"]){
|
| 226 |
liveuser |
676 |
|
| 3 |
liveuser |
677 |
#如果是 "div"
|
|
|
678 |
case "div":
|
| 226 |
liveuser |
679 |
|
| 3 |
liveuser |
680 |
#針對每行
|
|
|
681 |
foreach($conf["string"] as $line){
|
| 226 |
liveuser |
682 |
|
| 3 |
liveuser |
683 |
#函式說明:
|
|
|
684 |
#顯示一行文字,太長會自動省略.
|
|
|
685 |
#回傳的結果:
|
|
|
686 |
#$result["status"],執行是否正常,"true"為正常,"false"為不正常.
|
|
|
687 |
#$result["error"],錯誤訊息陣列.
|
|
|
688 |
#$result["function"],當前執行的函數名稱.
|
|
|
689 |
#$result["content"],語法.
|
|
|
690 |
#必填的參數:
|
|
|
691 |
#$conf["string"],字串
|
|
|
692 |
$conf["self::oneLine"]["string"]=$line;
|
|
|
693 |
#可省略的參數:
|
| 226 |
liveuser |
694 |
|
| 3 |
liveuser |
695 |
#如果有設置 $conf["class"]
|
|
|
696 |
if(isset($conf["class"])){
|
| 226 |
liveuser |
697 |
|
| 3 |
liveuser |
698 |
#$conf["class"],字串,要使用的css樣式名稱,預設為"__defaultTextStyle"
|
|
|
699 |
$conf["self::oneLine"]["class"]=$conf["class"];
|
| 226 |
liveuser |
700 |
|
| 3 |
liveuser |
701 |
}#if end
|
| 226 |
liveuser |
702 |
|
| 3 |
liveuser |
703 |
$oneLine=self::oneLine($conf["self::oneLine"]);
|
|
|
704 |
unset($conf["self::oneLine"]);
|
| 226 |
liveuser |
705 |
|
| 3 |
liveuser |
706 |
#如果執行失敗
|
|
|
707 |
if($oneLine["status"]==="false"){
|
| 226 |
liveuser |
708 |
|
| 3 |
liveuser |
709 |
#設置執行失敗識別
|
|
|
710 |
$result["status"]="false";
|
|
|
711 |
|
|
|
712 |
#設置錯誤訊息
|
|
|
713 |
$result["error"]=$oneLine;
|
|
|
714 |
|
|
|
715 |
#回傳結果
|
|
|
716 |
return $result;
|
| 226 |
liveuser |
717 |
|
| 3 |
liveuser |
718 |
}#if end
|
| 226 |
liveuser |
719 |
|
| 3 |
liveuser |
720 |
#串接要印出的內容
|
|
|
721 |
$result["content"]=$result["content"].$oneLine["content"];
|
| 226 |
liveuser |
722 |
|
| 3 |
liveuser |
723 |
}#foreach end
|
| 226 |
liveuser |
724 |
|
| 3 |
liveuser |
725 |
#跳出 switch
|
|
|
726 |
break;
|
| 226 |
liveuser |
727 |
|
| 207 |
liveuser |
728 |
#如果是 "divNoWrap"
|
|
|
729 |
case "divNoWrap":
|
| 226 |
liveuser |
730 |
|
| 207 |
liveuser |
731 |
#針對每行
|
|
|
732 |
foreach($conf["string"] as $line){
|
| 226 |
liveuser |
733 |
|
| 207 |
liveuser |
734 |
#函式說明:
|
|
|
735 |
#顯示一行文字,太長會自動省略,後面不段行.
|
|
|
736 |
#回傳的結果:
|
|
|
737 |
#$result["status"],執行是否正常,"true"為正常,"false"為不正常.
|
|
|
738 |
#$result["error"],錯誤訊息陣列.
|
|
|
739 |
#$result["function"],當前執行的函數名稱.
|
|
|
740 |
#$result["content"],語法.
|
|
|
741 |
#必填參數:
|
|
|
742 |
#$conf["string"],字串
|
|
|
743 |
$conf["text::oneLineNotEnd"]["string"]=$line;
|
|
|
744 |
#可省略參數:
|
|
|
745 |
#$conf["class"],字串,要使用的css樣式名稱,預設為"__defaultTextStyle"
|
|
|
746 |
#$conf["class"]="";
|
|
|
747 |
#參考資料:
|
|
|
748 |
#無.
|
|
|
749 |
#備註:
|
|
|
750 |
#無.
|
|
|
751 |
$oneLineNotEnd=text::oneLineNotEnd($conf["text::oneLineNotEnd"]);
|
|
|
752 |
unset($conf["text::oneLineNotEnd"]);
|
| 226 |
liveuser |
753 |
|
| 207 |
liveuser |
754 |
#如果執行失敗
|
|
|
755 |
if($oneLineNotEnd["status"]==="false"){
|
| 226 |
liveuser |
756 |
|
| 207 |
liveuser |
757 |
#設置執行失敗識別
|
|
|
758 |
$result["status"]="false";
|
|
|
759 |
|
|
|
760 |
#設置錯誤訊息
|
|
|
761 |
$result["error"]=$oneLineNotEnd;
|
|
|
762 |
|
|
|
763 |
#回傳結果
|
|
|
764 |
return $result;
|
| 226 |
liveuser |
765 |
|
| 207 |
liveuser |
766 |
}#if end
|
| 226 |
liveuser |
767 |
|
| 207 |
liveuser |
768 |
#串接要印出的內容
|
|
|
769 |
$result["content"]=$result["content"].$oneLineNotEnd["content"];
|
| 226 |
liveuser |
770 |
|
| 207 |
liveuser |
771 |
}#foreach end
|
| 226 |
liveuser |
772 |
|
| 207 |
liveuser |
773 |
#跳出 switch
|
|
|
774 |
break;
|
| 226 |
liveuser |
775 |
|
| 3 |
liveuser |
776 |
#如果是 "span"
|
|
|
777 |
case "span":
|
| 226 |
liveuser |
778 |
|
| 3 |
liveuser |
779 |
#針對每行
|
|
|
780 |
foreach($conf["string"] as $line){
|
| 226 |
liveuser |
781 |
|
| 3 |
liveuser |
782 |
#函式說明:
|
|
|
783 |
#顯示一行文字,太長會自動省略.
|
|
|
784 |
#回傳的結果:
|
|
|
785 |
#$result["status"],執行是否正常,"true"為正常,"false"為不正常.
|
|
|
786 |
#$result["error"],錯誤訊息陣列.
|
|
|
787 |
#$result["function"],當前執行的函數名稱.
|
|
|
788 |
#$result["content"],語法.
|
|
|
789 |
#必填的參數:
|
|
|
790 |
#$conf["string"],字串
|
|
|
791 |
$conf["self::oneLine"]["string"]=$line;
|
|
|
792 |
#可省略的參數:
|
| 226 |
liveuser |
793 |
|
| 3 |
liveuser |
794 |
#如果有設置 $conf["class"]
|
|
|
795 |
if(isset($conf["class"])){
|
| 226 |
liveuser |
796 |
|
| 3 |
liveuser |
797 |
#$conf["class"],字串,要使用的css樣式名稱,預設為"__defaultTextStyle"
|
|
|
798 |
$conf["self::oneLine"]["class"]=$conf["class"];
|
| 226 |
liveuser |
799 |
|
| 3 |
liveuser |
800 |
}#if end
|
| 226 |
liveuser |
801 |
|
| 3 |
liveuser |
802 |
$oneLine=self::oneLineNotEnd($conf["self::oneLine"]);
|
|
|
803 |
unset($conf["self::oneLine"]);
|
| 226 |
liveuser |
804 |
|
| 3 |
liveuser |
805 |
#如果執行失敗
|
|
|
806 |
if($oneLine["status"]==="false"){
|
| 226 |
liveuser |
807 |
|
| 3 |
liveuser |
808 |
#設置執行失敗識別
|
|
|
809 |
$result["status"]="false";
|
|
|
810 |
|
|
|
811 |
#設置錯誤訊息
|
|
|
812 |
$result["error"]=$oneLine;
|
|
|
813 |
|
|
|
814 |
#回傳結果
|
|
|
815 |
return $result;
|
| 226 |
liveuser |
816 |
|
| 3 |
liveuser |
817 |
}#if end
|
| 226 |
liveuser |
818 |
|
| 3 |
liveuser |
819 |
#串接要印出的內容
|
|
|
820 |
$result["content"]=$result["content"].$oneLine["content"];
|
| 226 |
liveuser |
821 |
|
| 3 |
liveuser |
822 |
}#foreach end
|
| 226 |
liveuser |
823 |
|
| 3 |
liveuser |
824 |
#跳出 switch
|
|
|
825 |
break;
|
| 226 |
liveuser |
826 |
|
| 3 |
liveuser |
827 |
#如果是 "p"
|
|
|
828 |
case "p":
|
| 226 |
liveuser |
829 |
|
| 3 |
liveuser |
830 |
#針對每行
|
|
|
831 |
foreach($conf["string"] as $line){
|
| 226 |
liveuser |
832 |
|
| 3 |
liveuser |
833 |
#串接要印出的內容
|
|
|
834 |
$result["content"]=$result["content"].$line."<p>";
|
| 226 |
liveuser |
835 |
|
| 3 |
liveuser |
836 |
}#foreach end
|
| 226 |
liveuser |
837 |
|
| 3 |
liveuser |
838 |
#跳出 switch
|
|
|
839 |
break;
|
| 226 |
liveuser |
840 |
|
| 3 |
liveuser |
841 |
#如果是 "br"
|
|
|
842 |
case "br":
|
| 226 |
liveuser |
843 |
|
| 3 |
liveuser |
844 |
#針對每行
|
|
|
845 |
foreach($conf["string"] as $line){
|
| 226 |
liveuser |
846 |
|
| 3 |
liveuser |
847 |
#串接要印出的內容
|
|
|
848 |
$result["content"]=$result["content"].$line."<br>";
|
| 226 |
liveuser |
849 |
|
| 3 |
liveuser |
850 |
}#foreach end
|
| 226 |
liveuser |
851 |
|
| 3 |
liveuser |
852 |
#跳出 switch
|
|
|
853 |
break;
|
| 226 |
liveuser |
854 |
|
| 3 |
liveuser |
855 |
#如果是 "EOL"
|
|
|
856 |
case "EOL":
|
| 226 |
liveuser |
857 |
|
| 3 |
liveuser |
858 |
#針對每行
|
|
|
859 |
foreach($conf["string"] as $line){
|
| 226 |
liveuser |
860 |
|
| 3 |
liveuser |
861 |
#串接要印出的內容
|
|
|
862 |
$result["content"]=$result["content"].$line.PHP_EOL;
|
| 226 |
liveuser |
863 |
|
| 3 |
liveuser |
864 |
}#foreach end
|
| 226 |
liveuser |
865 |
|
| 3 |
liveuser |
866 |
#跳出 switch
|
|
|
867 |
break;
|
| 226 |
liveuser |
868 |
|
| 3 |
liveuser |
869 |
#如果是 "textarea"
|
|
|
870 |
case "textarea":
|
| 226 |
liveuser |
871 |
|
| 3 |
liveuser |
872 |
#函式說明:
|
|
|
873 |
#建立不會重複的class名稱.
|
|
|
874 |
#回傳結果:
|
|
|
875 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
|
|
876 |
#$result["error"],錯誤訊息.
|
|
|
877 |
#$result["function"],當前執行的函數名稱.
|
|
|
878 |
#$result["content"],語法.
|
|
|
879 |
#必填參數:
|
|
|
880 |
#無.
|
|
|
881 |
#可省略參數:
|
|
|
882 |
#無.
|
|
|
883 |
#參考資料:
|
|
|
884 |
#無.
|
|
|
885 |
#備註:
|
|
|
886 |
#無.
|
|
|
887 |
$uuidClassName=css::uuidClassName();
|
| 226 |
liveuser |
888 |
|
| 3 |
liveuser |
889 |
#如果執行失敗
|
|
|
890 |
if($uuidClassName["status"]==="false"){
|
| 226 |
liveuser |
891 |
|
| 3 |
liveuser |
892 |
#設置執行失敗識別
|
|
|
893 |
$result["status"]="false";
|
|
|
894 |
|
|
|
895 |
#設置錯誤訊息
|
|
|
896 |
$result["error"]=$uuidClassName;
|
|
|
897 |
|
|
|
898 |
#回傳結果
|
|
|
899 |
return $result;
|
| 226 |
liveuser |
900 |
|
| 3 |
liveuser |
901 |
}#if end
|
| 226 |
liveuser |
902 |
|
| 3 |
liveuser |
903 |
#設置要用的不會重複 class 名稱
|
| 207 |
liveuser |
904 |
$classNameForText_multi_line="text_multi_line_".$uuidClassName["content"];
|
| 226 |
liveuser |
905 |
|
| 3 |
liveuser |
906 |
#函式說明:
|
|
|
907 |
#創建針對html標籤的立即css樣式或限定套用類型的css樣式.
|
|
|
908 |
#回傳結果:
|
|
|
909 |
#$result["status"],執行是否正常,"true"代表正常;"false"代表不正常.
|
|
|
910 |
#$result["error"],涵式錯誤訊息陣列
|
|
|
911 |
#$result["content"],css語法
|
|
|
912 |
#$result["function"],當前執行的函式名稱.
|
|
|
913 |
#$result["argu"],所使用的參數.
|
|
|
914 |
#必填參數:
|
|
|
915 |
#$conf["htmlTagName"],字串陣列,為多個要套用樣式的html標籤名稱,若有階層請用「>」表示,ex:「a:hover」代表在<a></a>上滑過去時的樣式;若有從上而下的層級關係,則請用「>」表示,ex:「div>span>img」,就是針對有div標籤裡面的span標籤裡面的img標籤內容的樣式;也可以針對使用特定類別的html標籤來套用css樣式,ex:「div.pink」,就是針對套用pink類別的div標籤來套用css樣式;可以指定擁有特定屬性的標籤與class的元素來套用css樣式,ex:「div['data-selected=true'].specifyClassName」。
|
|
|
916 |
$conf["css::createApplyCssStyle"]["htmlTagName"]=array("input[type='text'].".$classNameForText_multi_line);
|
|
|
917 |
#$conf["attributes"],字串陣列,為屬性名稱
|
|
|
918 |
$conf["css::createApplyCssStyle"]["attributes"]=array("font-size","width","border-width","overflow","text-overflow");
|
|
|
919 |
#$conf["content"],字串陣列,為屬性值
|
|
|
920 |
$conf["css::createApplyCssStyle"]["content"]=array("30px","100%","0px","hidden","ellipsis");
|
|
|
921 |
#可省略參數:
|
|
|
922 |
#無.
|
|
|
923 |
#參考資料:
|
|
|
924 |
#無.
|
|
|
925 |
#備註:
|
|
|
926 |
#無.
|
|
|
927 |
$createApplyCssStyle=css::createApplyCssStyle($conf["css::createApplyCssStyle"]);
|
|
|
928 |
unset($conf["css::createApplyCssStyle"]);
|
| 226 |
liveuser |
929 |
|
| 3 |
liveuser |
930 |
#如果執行失敗
|
|
|
931 |
if($createApplyCssStyle["status"]==="false"){
|
| 226 |
liveuser |
932 |
|
| 3 |
liveuser |
933 |
#設置執行失敗識別
|
|
|
934 |
$result["status"]="false";
|
|
|
935 |
|
|
|
936 |
#設置錯誤訊息
|
|
|
937 |
$result["error"]=$createApplyCssStyle;
|
|
|
938 |
|
|
|
939 |
#回傳結果
|
|
|
940 |
return $result;
|
| 226 |
liveuser |
941 |
|
| 3 |
liveuser |
942 |
}#if end
|
| 226 |
liveuser |
943 |
|
| 3 |
liveuser |
944 |
#串接css樣式
|
|
|
945 |
$result["content"]=$result["content"].$createApplyCssStyle["content"];
|
| 226 |
liveuser |
946 |
|
| 3 |
liveuser |
947 |
#針對每行
|
|
|
948 |
foreach($conf["string"] as $lineNo=>$line){
|
| 226 |
liveuser |
949 |
|
| 3 |
liveuser |
950 |
#設置用於識別行的變數
|
|
|
951 |
$lineId="lineNo_".$lineNo;
|
| 226 |
liveuser |
952 |
|
| 3 |
liveuser |
953 |
#設置用於設別行div的變數
|
|
|
954 |
$lineDivId="div_".$lineId;
|
| 226 |
liveuser |
955 |
|
| 3 |
liveuser |
956 |
#函式說明:
|
|
|
957 |
#可以輸入文字的表單
|
|
|
958 |
#回傳結果:
|
|
|
959 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
|
|
960 |
#$result["function"],當前執行的函數.
|
|
|
961 |
#$result["error"],錯誤訊息陣列.
|
|
|
962 |
#$result["content"],按鈕語法.
|
|
|
963 |
#必填參數:
|
|
|
964 |
#$conf["name"],字串,爲該文字輸入框的名稱,用於讓接收頁面讀取的名稱。
|
|
|
965 |
$conf["form::inputText"]["name"]=$lineId;
|
|
|
966 |
#$conf["readOnly"],字串,爲該文字框是否可以填寫資料,若要只能觀看不能填寫,那麼就必須將其值設爲"true",反之要設爲"false".
|
|
|
967 |
$conf["form::inputText"]["readOnly"]="true";
|
|
|
968 |
#可省略參數:
|
|
|
969 |
#$conf["width"]="";#爲文字框的外觀長度,預設為"100%".
|
|
|
970 |
#$conf["maxInputLength"]="";#爲可輸入的最大位元長度,預設不限制。
|
|
|
971 |
#$conf["autoFocus"]="true";#是否為將填寫的指標移到該表單,"true"代表要,預設為"false".
|
|
|
972 |
$conf["form::inputText"]["value"]=$line;#爲該文字框預設要顯示的文字,預設爲""。
|
|
|
973 |
$conf["form::inputText"]["class"]=$classNameForText_multi_line;#爲要套用的css樣式,若省略,則會套用預設的 "__qbpwcf_inputTextCssStyle" 樣式,其屬性爲 "width:100%","font-size:30px"
|
|
|
974 |
#$conf["form::inputText"]["jsActivitor"]="onfocus";#爲觸發js的條件,可以是"onChange"(已改變內容時)、"onClick"(按下按鈕時)、"onkeyup"(當鍵盤按下放開後)、"onmouseover"(當滑鼠移過去的時候)...,須搭配$conf["jsSubmitActionTarget"]參數。
|
|
|
975 |
#$conf["form::inputText"]["jsAction"]="'return false;'";#爲該js是要做什麼,可以是"document.testForm.submit()"(傳送名爲testForm的表單內容)...,須搭配$conf["jsActivitor"]參數。
|
|
|
976 |
#$conf["trStart"]="true";#爲是否要以<tr>開頭,"true"表示"是"。也可以看作新的一列開始,預設為"false".
|
|
|
977 |
#$conf["tdStart"]="true";#爲是否要以<td>開頭,"true"表示"是"。也可以看成列裏面的元素開始,預設為"false".
|
|
|
978 |
#$conf["formStart"]="true";#爲是否要以<form>開頭,"true"表示"是",也可以看成表單的開始,預設為"false".
|
|
|
979 |
#$conf["formAction"]="";#表單遞交的目的地,若$conf["formStart"]為"true",則該參數不能省略.
|
|
|
980 |
#$conf["formName"]="";#爲該表單的名稱
|
|
|
981 |
#$conf["formMethod"]="";#爲傳輸的方法,若沒設定則預設爲post,其他可用的參數爲get。
|
|
|
982 |
#$conf["formTarget"]="";#為顯示的方式,若沒設定則預設爲"_self",其他可用的參數爲 "_blank"、"_parent"、"_top",也可以是iframe的名稱。
|
|
|
983 |
#$conf["tableStart"]="true";#爲該表單是否要以<table>開始。"true"爲是,預設為"false".
|
|
|
984 |
#$conf["tableClass"]="";#表格要套用的css樣式,若爲"__withoutBorder"的話則套用無框線的預設樣式;若爲"__withBorder"的話,則爲有框線的預設樣式,預設為"__withoutBorder".
|
|
|
985 |
#$conf["formEnd"]="true";#爲是否要以<form>結尾,"true"表示"是",也可以看成表單的結束,預設為"false".
|
|
|
986 |
#$conf["tdEnd"]="true";#爲是否要以</td>結尾,"true"表示"是"。也可以看成列裏面的元素結束,預設為"false".
|
|
|
987 |
#$conf["trEnd"]="true";#爲是否要以</tr>結尾,"true"表示"是"。也可以看作該列結束,預設為"false".
|
|
|
988 |
#$conf["tableEnd"]="true";#爲該表單是否要以</table>結尾,"true"爲是,預設為"false".
|
|
|
989 |
#$conf["autocomplete"],字串,是否依據使用者過往輸入的記錄來提示可能要的輸入內容,"on"為啟用,"off"為停用,預設為"on".
|
|
|
990 |
#$conf["autocomplete"]="off";
|
|
|
991 |
#$conf["required"],字串,該欄位是否必填,"true"為必填,"false"為可留空,預設為"false".
|
|
|
992 |
#$conf["required"]="true";
|
|
|
993 |
#$conf["comment"],字串,輸入方框上面要放哪些註解文字,亦即用label來呈現,同時指定"for"屬性的數值為當前"input"標籤的id,意即參數"name"的內容.
|
|
|
994 |
#$conf["comment"]="";
|
|
|
995 |
#$conf["placeholder"],字串,當沒有內容時要顯示的內容.
|
|
|
996 |
#$conf["placeholder"]="";
|
|
|
997 |
#$conf["br"],字串,"true"代表最後要換行,預設為"false".
|
|
|
998 |
#$conf["br"]="true";
|
|
|
999 |
#$conf["p"],字串,"true"代表最後要空一行,預設為"false".
|
|
|
1000 |
#$conf["p"]="true";
|
|
|
1001 |
#$conf["id"],字串,該元素的id,預設不使用.
|
|
|
1002 |
$conf["form::inputText"]["id"]=$lineId;
|
|
|
1003 |
#$conf["dataFormId"],字串,提供用於識別哪一張表單的data屬性名稱.
|
|
|
1004 |
#$conf["dataFormId"]="";
|
|
|
1005 |
#參考資料:
|
|
|
1006 |
#input=>http://www.w3schools.com/tags/tag_input.asp
|
|
|
1007 |
#備註:
|
|
|
1008 |
#無.
|
|
|
1009 |
$inputText=form::inputText($conf["form::inputText"]);
|
|
|
1010 |
unset($conf["form::inputText"]);
|
|
|
1011 |
|
|
|
1012 |
#如果執行失敗
|
|
|
1013 |
if($inputText["status"]==="false"){
|
| 226 |
liveuser |
1014 |
|
| 3 |
liveuser |
1015 |
#設置執行失敗識別
|
|
|
1016 |
$result["status"]="false";
|
|
|
1017 |
|
|
|
1018 |
#設置錯誤訊息
|
|
|
1019 |
$result["error"]=$inputText;
|
|
|
1020 |
|
|
|
1021 |
#回傳結果
|
|
|
1022 |
return $result;
|
| 226 |
liveuser |
1023 |
|
| 3 |
liveuser |
1024 |
}#if end
|
| 226 |
liveuser |
1025 |
|
| 3 |
liveuser |
1026 |
#函式說明:
|
|
|
1027 |
#<div>區塊,裡面可以指定css的class樣式,可以指定提示文字.
|
|
|
1028 |
#$result["status"],字串,執行否正常,"true"代表正常,"false"代表不正常.
|
|
|
1029 |
#$result["functin"],字串,當前函數的名稱.
|
|
|
1030 |
#$result["error"],陣列,錯訊訊息.
|
|
|
1031 |
#$result["content"],字串,含有<div>標籤的內容.
|
|
|
1032 |
#必填參數:
|
|
|
1033 |
#$conf["contentArray"],字串陣列,要放入的內容陣列.
|
|
|
1034 |
$conf["css::divSection"]["contentArray"]=array($inputText["content"]);
|
|
|
1035 |
#可省略參數
|
|
|
1036 |
#$conf["id"],字串,div區塊的id.
|
|
|
1037 |
$conf["css::divSection"]["id"]=$lineDivId;
|
|
|
1038 |
#$conf["styleAttr"],字串陣列,給div區段要套用的style樣式屬性.
|
|
|
1039 |
#$conf["styleAttr"]=array();
|
|
|
1040 |
#$conf["styleVal"],字串陣列,給div區段要套用的style樣式數值.
|
|
|
1041 |
#$conf["styleVal"]=array();
|
|
|
1042 |
#$conf["class"],字串,div區段要套用的css樣式.
|
|
|
1043 |
$conf["css::divSection"]["class"]=$classNameForText_multi_line;
|
|
|
1044 |
#$conf["title"],陣列,滑鼠移到上面時要顯示的內容,每個元素代表一列內容.
|
|
|
1045 |
#$conf["title"]=array();
|
|
|
1046 |
#$conf["oneScreenSize"],字串,div區塊是否要占一個螢幕的大小,預設為"false"不設定,"true"為設定成一個螢幕的大小.
|
|
|
1047 |
#$conf["oneScreenSize"]="false";
|
|
|
1048 |
#$conf["textAlignCenter"],字串,div區塊是否要置中,預設為$conf["oneScreenSize"]的值,"false"為不置中,"true"代表要置中.
|
|
|
1049 |
#$conf["textAlignCenter"]="";
|
|
|
1050 |
#$conf["data"],字串陣列,每個要設置的屬性data內容,例如array("option1"=>"A","option2"=>"B"),預設不使用.
|
|
|
1051 |
#$conf["data"]=array();
|
|
|
1052 |
#參考資料:
|
|
|
1053 |
#無.
|
|
|
1054 |
#備註:
|
|
|
1055 |
#無.
|
|
|
1056 |
$divSection=css::divSection($conf["css::divSection"]);
|
|
|
1057 |
unset($conf["css::divSection"]);
|
| 226 |
liveuser |
1058 |
|
| 3 |
liveuser |
1059 |
#如果執行失敗
|
|
|
1060 |
if($divSection["status"]==="false"){
|
| 226 |
liveuser |
1061 |
|
| 3 |
liveuser |
1062 |
#設置執行失敗識別
|
|
|
1063 |
$result["status"]="false";
|
|
|
1064 |
|
|
|
1065 |
#設置錯誤訊息
|
|
|
1066 |
$result["error"]=$divSection;
|
|
|
1067 |
|
|
|
1068 |
#回傳結果
|
|
|
1069 |
return $result;
|
| 226 |
liveuser |
1070 |
|
| 3 |
liveuser |
1071 |
}#if end
|
| 226 |
liveuser |
1072 |
|
| 3 |
liveuser |
1073 |
#串接要印出的內容
|
|
|
1074 |
$result["content"]=$result["content"].$divSection["content"];
|
| 226 |
liveuser |
1075 |
|
| 3 |
liveuser |
1076 |
}#foreach end
|
| 226 |
liveuser |
1077 |
|
| 3 |
liveuser |
1078 |
#跳出 switch
|
|
|
1079 |
break;
|
| 226 |
liveuser |
1080 |
|
| 3 |
liveuser |
1081 |
#其他類型
|
|
|
1082 |
default:
|
| 226 |
liveuser |
1083 |
|
| 3 |
liveuser |
1084 |
#設置類型未 EOL
|
|
|
1085 |
$conf["type"]="EOL";
|
| 226 |
liveuser |
1086 |
|
| 3 |
liveuser |
1087 |
#從頭執行 switch
|
|
|
1088 |
#continue;
|
|
|
1089 |
break;
|
| 226 |
liveuser |
1090 |
|
| 3 |
liveuser |
1091 |
}#switch end
|
| 226 |
liveuser |
1092 |
|
| 3 |
liveuser |
1093 |
#設置執行成功的識別
|
|
|
1094 |
$result["status"]="true";
|
|
|
1095 |
|
|
|
1096 |
#回傳結果
|
|
|
1097 |
return $result;
|
|
|
1098 |
|
|
|
1099 |
}#function multiLine end
|
| 226 |
liveuser |
1100 |
|
| 3 |
liveuser |
1101 |
/*
|
|
|
1102 |
#函式說明:
|
|
|
1103 |
#echo函式的加強版,變數存在才會印出來.
|
|
|
1104 |
#回傳內容:
|
|
|
1105 |
#無.
|
|
|
1106 |
#必填參數:
|
|
|
1107 |
#$conf["var"],變數位址.
|
|
|
1108 |
$conf["var"]=&;
|
|
|
1109 |
#可省略參數:
|
|
|
1110 |
#無.
|
|
|
1111 |
#參考資料:
|
|
|
1112 |
#無.
|
|
|
1113 |
#備註:
|
|
|
1114 |
#無.
|
|
|
1115 |
*/
|
|
|
1116 |
public static function vecho(&$conf){
|
| 226 |
liveuser |
1117 |
|
| 3 |
liveuser |
1118 |
#如果變數存在
|
|
|
1119 |
if(isset($conf["var"])){
|
| 226 |
liveuser |
1120 |
|
| 3 |
liveuser |
1121 |
#印出變數
|
|
|
1122 |
echo $conf["var"];
|
| 226 |
liveuser |
1123 |
|
| 3 |
liveuser |
1124 |
}#if end
|
| 226 |
liveuser |
1125 |
|
| 3 |
liveuser |
1126 |
}#function vecho end
|
|
|
1127 |
|
|
|
1128 |
}#class text end
|
|
|
1129 |
|
|
|
1130 |
?>
|