tag rc6
[openwrt/svn-archive/openwrt.git] / package / webif / files / usr / lib / webif / common.awk
1 function start_form(title, field_opts, field_opts2) {
2 print "<div class=\"settings\"" field_opts ">"
3 if (title != "") print "<div class=\"settings-title\"><h3><strong>" title "</strong></h3></div>"
4 print "<div class=\"settings-content\"" field_opts2 ">"
5 }
6
7 function end_form(form_help, form_help_link) {
8 print "</div>"
9 if (form_help != "") form_help = "<dl>" form_help "</dl>"
10 print "<div class=\"settings-help\"><blockquote><h3><strong>@TR<<Short help>>:</strong></h3>" form_help form_help_link "</blockquote></div>"
11 print "<div style=\"clear: both\">&nbsp;</div></div>"
12 }
13
14 function textinput(name, value) {
15 return "<input type=\"text\" name=\"" name "\" value=\"" value "\" />"
16 }
17
18 function hidden(name, value) {
19 return "<input type=\"hidden\" name=\"" name "\" value=\"" value "\" />"
20 }
21
22 function button(name, caption) {
23 return "<input type=\"submit\" name=\"" name "\" value=\"@TR<<" caption ">>\" />"
24 }
25
26 function helpitem(name) {
27 return "<dt>@TR<<" name ">>: </dt>"
28 }
29
30 function helptext(short, name) {
31 return "<dd>@TR<<" short "|" name ">>: </dd>"
32 }
33
34 function sel_option(name, caption, default, sel) {
35 if (default == name) sel = " selected=\"selected\""
36 else sel = ""
37 return "<option value=\"" name "\"" sel ">@TR<<" caption ">></option>"
38 }