webif: add more useful functions to the shared awk file
authorFelix Fietkau <nbd@openwrt.org>
Tue, 7 Feb 2006 04:36:56 +0000 (04:36 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 7 Feb 2006 04:36:56 +0000 (04:36 +0000)
SVN-Revision: 3174

openwrt/package/webif/files/usr/lib/webif/common.awk

index f8f44207d3e6253005d9a91e08a594096b56afa0..298dc251ddf41d79a15043ce118873f79df5a4e2 100644 (file)
@@ -10,3 +10,17 @@ function end_form(form_help, form_help_link) {
        print "<div class=\"settings-help\"><blockquote><h3><strong>@TR<<Short help>>:</strong></h3>" form_help form_help_link "</blockquote></div>"
        print "<div style=\"clear: both\">&nbsp;</div></div>"
 }
+
+function textinput(name, value) {
+       return "<input type=\"text\" name=\"" name "\" value=\"" value "\" />"
+}
+
+function button(name, caption) {
+       return "<input type=\"submit\" name=\"" name "\" value=\"@TR<<" caption ">>\" />"
+}
+
+function sel_option(name, caption, default, sel) {
+       if (default == name) sel = " selected=\"selected\""
+       else sel = ""
+       return "<option value=\"" name "\"" sel ">" caption "</option>"
+}