From e3b7de100ac11887cb8abfa9336be995eda1520f Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Wed, 13 Feb 2008 17:51:51 +0000 Subject: Initial commit on tinydns git-svn-id: svn://svn.alpinelinux.org/acf/tinydns/trunk@716 ab2d0c66-481e-0410-8bed-d214d4d58bed --- viewfunctions.lua | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 viewfunctions.lua (limited to 'viewfunctions.lua') diff --git a/viewfunctions.lua b/viewfunctions.lua new file mode 100644 index 0000000..ed590cf --- /dev/null +++ b/viewfunctions.lua @@ -0,0 +1,38 @@ +module (..., package.seeall) + +function informationform(myform,tags) + io.write("
") + for k,v in pairs(tags) do + if (myform[v]) then + local val = myform[v] + io.write("\t 0) then io.write(" class='error'") end + io.write(">" .. val.label .. "\n") + + io.write("\t\t
" .. val.value .. "\n") + if (val.descr) and (#val.descr > 0) then io.write("\t\t

" .. string.gsub(val.descr, "\n", "
") .. "

\n") end + if (#val.errtxt > 0) then io.write("\t\t

" .. string.gsub(val.errtxt, "\n", "
") .. "

\n") end + io.write("\t\t
\n") + end + end + io.write("
") +end + +function configform(myform,tags) + io.write("
") + for k,v in pairs(tags) do + if (myform[v]) then + local val = myform[v] + io.write("\t 0) then io.write(" class='error'") end + io.write(">" .. val.label .. "\n") + + io.write("\t\t
" .. html.form[val.type](val) .. "\n") + if (val.descr) and (#val.descr > 0) then io.write("\t\t

" .. string.gsub(val.descr, "\n", "
") .. "

\n") end + if (#val.errtxt > 0) then io.write("\t\t

" .. string.gsub(val.errtxt, "\n", "
") .. "

\n") end + io.write("\t\t
\n") + end + end + io.write("
") +end + -- cgit v1.2.3