From de0371bc26857be6e92a23ccaaaae5936a2c740e Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Fri, 15 Feb 2008 17:09:55 +0000 Subject: Starting to read config-files. There is some debug output where you can se some default parameters and a list of all objects in the config-files. git-svn-id: svn://svn.alpinelinux.org/acf/tinydns/trunk@725 ab2d0c66-481e-0410-8bed-d214d4d58bed --- tinydns-status-html.lsp | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) (limited to 'tinydns-status-html.lsp') diff --git a/tinydns-status-html.lsp b/tinydns-status-html.lsp index 20b5dcc..b8ac060 100644 --- a/tinydns-status-html.lsp +++ b/tinydns-status-html.lsp @@ -7,34 +7,22 @@ io.write("") --]] ?> ") for k,v in pairs(tags) do - if (myform[v]) then + if (myform[v]) and (myform[v]["value"]) then local val = myform[v] io.write("\t 0) then io.write(" class='error'") end + if (#val.errtxt > 0) then + val.class = "error" + 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 (viewonly) then + io.write("\t\t
" .. val.value .. "\n") + else + io.write("\t\t
" .. html.form[val.type](val) .. "\n") + end 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") @@ -48,7 +36,7 @@ end