| 1 |
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
|
| 1 |
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 |
|
|
|
25 |
#使用命名空間qbpwcf
|
|
|
26 |
namespace qbpwcf;
|
|
|
27 |
|
|
|
28 |
#assets dir
|
|
|
29 |
$assetsDir="assets of form::inputText_xxxxxxxx";
|
|
|
30 |
|
|
|
31 |
#函式說明:
|
|
|
32 |
#可以輸入文字的表單
|
|
|
33 |
#回傳結果:
|
|
|
34 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
|
|
35 |
#$result["function"],當前執行的函數.
|
|
|
36 |
#$result["error"],錯誤訊息陣列.
|
|
|
37 |
#$result["content"],按鈕語法.
|
|
|
38 |
#必填參數:
|
|
|
39 |
#$conf["name"],字串,爲該文字輸入框的名稱,用於讓接收頁面讀取的名稱。
|
|
|
40 |
$conf["name"]="resource";
|
|
|
41 |
#$conf["readOnly"],字串,爲該文字框是否可以填寫資料,若要只能觀看不能填寫,那麼就必須將其值設爲"true",反之要設爲"false".
|
|
|
42 |
$conf["readOnly"]="false";
|
|
|
43 |
#可省略參數:
|
|
|
44 |
#$conf["width"],字串,爲文字框的外觀長度,預設為"100%".
|
|
|
45 |
#$conf["width"]="";
|
|
|
46 |
#$conf["maxInputLength"],字串,爲可輸入的最大位元長度,預設不限制.
|
|
|
47 |
#$conf["maxInputLength"]="";
|
|
|
48 |
#$conf["autoFocus"],字串,是否為將填寫的指標移到該表單,"true"代表要,預設為"false".
|
|
|
49 |
#$conf["autoFocus"]="";
|
|
|
50 |
#$conf["value"],字串,爲該文字框預設要顯示的文字,預設爲"".
|
|
|
51 |
#$conf["value"]="";
|
|
|
52 |
#$conf["class"],字串,爲要套用的css樣式,若省略,則會套用預設的 "__qbpwcf_inputTextCssStyle" 樣式,其屬性爲 "width:100%","font-size:30px"
|
|
|
53 |
#$conf["class"]="";
|
|
|
54 |
#$conf["classList"],字串陣列,為要使用的多個css class樣式,若有使用,則會取代"class"參數的設定.
|
|
|
55 |
$conf["classList"]=array("a","b","c");
|
|
|
56 |
#$conf["jsActivitor"],字串,爲觸發js的條件,可以是"onChange"(已改變內容時)、"onClick"(按下按鈕時)、"onkeyup"(當鍵盤按下放開後)、"onmouseover"(當滑鼠移過去的時候)...,須搭配$conf["jsSubmitActionTarget"]參數。
|
|
|
57 |
#$conf["jsActivitor"]="";
|
|
|
58 |
#$conf["jsAction"],字串,爲該js是要做什麼,可以是"document.testForm.submit()"(傳送名爲testForm的表單內容)...,須搭配$conf["jsActivitor"]參數。
|
|
|
59 |
#$conf["jsAction"]="";
|
|
|
60 |
#$conf["trStart"],字串,爲是否要以<tr>開頭,"true"表示"是"。也可以看作新的一列開始,預設為"false".
|
|
|
61 |
#$conf["trStart"]="";
|
|
|
62 |
#$conf["tdStart"],字串,爲是否要以<td>開頭,"true"表示"是"。也可以看成列裏面的元素開始,預設為"false".
|
|
|
63 |
#$conf["tdStart"]="";
|
|
|
64 |
#$conf["formStart"],字串,爲是否要以<form>開頭,"true"表示"是",也可以看成表單的開始,預設為"false".
|
|
|
65 |
#$conf["formStart"]="";
|
|
|
66 |
#$conf["formAction"],字串,表單遞交的目的地,若$conf["formStart"]為"true",則該參數不能省略.
|
|
|
67 |
#$conf["formAction"]="";
|
|
|
68 |
#$conf["formName"],字串,爲該表單的名稱
|
|
|
69 |
#$conf["formName"]="";
|
|
|
70 |
#$conf["formMethod"],字串,爲傳輸的方法,若沒設定則預設爲post,其他可用的參數爲get。
|
|
|
71 |
#$conf["formMethod"]="";
|
|
|
72 |
#$conf["formTarget"],字串,為顯示的方式,若沒設定則預設爲"_self",其他可用的參數爲 "_blank"、"_parent"、"_top",也可以是iframe的名稱。
|
|
|
73 |
#$conf["formTarget"]="";
|
|
|
74 |
#$conf["tableStart"],字串,爲該表單是否要以<table>開始。"true"爲是,預設為"false".
|
|
|
75 |
#$conf["tableStart"]="";
|
|
|
76 |
#$conf["tableClass"],字串,表格要套用的css樣式,若爲"__withoutBorder"的話則套用無框線的預設樣式;若爲"__withBorder"的話,則爲有框線的預設樣式,預設為"__withoutBorder".
|
|
|
77 |
#$conf["tableClass"]="";
|
|
|
78 |
#$conf["formEnd"],字串,爲是否要以<form>結尾,"true"表示"是",也可以看成表單的結束,預設為"false".
|
|
|
79 |
#$conf["formEnd"]="true";
|
|
|
80 |
#$conf["tdEnd"],字串,爲是否要以</td>結尾,"true"表示"是"。也可以看成列裏面的元素結束,預設為"false".
|
|
|
81 |
#$conf["tdEnd"]="true";
|
|
|
82 |
#$conf["trEnd"],字串,爲是否要以</tr>結尾,"true"表示"是"。也可以看作該列結束,預設為"false".
|
|
|
83 |
#$conf["trEnd"]="true";
|
|
|
84 |
#$conf["tableEnd"],字串,爲該表單是否要以</table>結尾,"true"爲是,預設為"false".
|
|
|
85 |
#$conf["tableEnd"]="true";
|
|
|
86 |
#$conf["autocomplete"],字串,是否依據使用者過往輸入的記錄來提示可能要的輸入內容,"on"為啟用,"off"為停用,預設為"on".
|
|
|
87 |
#$conf["autocomplete"]="off";
|
|
|
88 |
#$conf["required"],字串,該欄位是否必填,"true"為必填,"false"為可留空,預設為"false".
|
|
|
89 |
#$conf["required"]="true";
|
|
|
90 |
#$conf["comment"],字串,輸入方框上面要放哪些註解文字,亦即用label來呈現,同時指定"for"屬性的數值為當前"input"標籤的id,意即參數"name"的內容.
|
|
|
91 |
$conf["comment"]="文字輸入的表單";
|
|
|
92 |
#$conf["placeholder"],字串,當沒有內容時要顯示的內容.
|
|
|
93 |
$conf["placeholder"]="測試 classList 參數";
|
|
|
94 |
#$conf["br"],字串,"true"代表最後要換行,預設為"false".
|
|
|
95 |
#$conf["br"]="true";
|
|
|
96 |
#$conf["p"],字串,"true"代表最後要空一行,預設為"false".
|
|
|
97 |
#$conf["p"]="true";
|
|
|
98 |
#$conf["id"],字串,該元素的id,預設不使用.
|
|
|
99 |
#$conf["id"]="";
|
|
|
100 |
#$conf["dataFormId"],字串,提供用於識別哪一張表單的data屬性名稱.
|
|
|
101 |
#$conf["dataFormId"]="";
|
|
|
102 |
#參考資料:
|
|
|
103 |
#input=>http://www.w3schools.com/tags/tag_input.asp
|
|
|
104 |
#備註:
|
|
|
105 |
#無.
|
|
|
106 |
$inputText=form::inputText($conf);
|
|
|
107 |
unset($conf);
|
|
|
108 |
|
|
|
109 |
#debug
|
|
|
110 |
#var_dump($inputText);exit;
|
|
|
111 |
|
|
|
112 |
#如果執行失敗
|
|
|
113 |
if($inputText["status"]==="false"){
|
|
|
114 |
|
|
|
115 |
#函式說明:
|
|
|
116 |
#撰寫log
|
|
|
117 |
#回傳結果:
|
|
|
118 |
#$result["status"],狀態,"true"或"false".
|
|
|
119 |
#$result["error"],錯誤訊息陣列.
|
|
|
120 |
#$result["function"],當前函式的名稱.
|
|
|
121 |
#$result["argu"],使用的參數.
|
|
|
122 |
#必填參數:
|
|
|
123 |
#$conf["path"],字串,log檔案的路徑與名稱.
|
|
|
124 |
$conf["path"]=$logFile;
|
|
|
125 |
#$conf["content"],any,要寫的內容,若內容不為字串則會用var_dump的格式寫入.
|
|
|
126 |
$conf["content"]=$inputText;
|
|
|
127 |
#$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
|
|
|
128 |
$conf["fileArgu"]=__FILE__;
|
|
|
129 |
#可省略參數:
|
|
|
130 |
#$conf["rewrite"],預設為"false",接續寫入;反之"true"代表重新寫入.
|
|
|
131 |
#$conf["rewrite"]="false";
|
|
|
132 |
#參考資料:
|
|
|
133 |
#無.
|
|
|
134 |
#備註:
|
|
|
135 |
#無.
|
|
|
136 |
$record=logs::record($conf);
|
|
|
137 |
unset($conf);
|
| 226 |
liveuser |
138 |
|
| 1 |
liveuser |
139 |
#結束執行
|
|
|
140 |
exit(1);
|
|
|
141 |
|
|
|
142 |
}#if end
|
|
|
143 |
|
|
|
144 |
#印出結果
|
| 226 |
liveuser |
145 |
echo $inputText["content"];
|