diff options
author | Mika Havela <mika.havela@gmail.com> | 2008-04-09 13:23:31 +0000 |
---|---|---|
committer | Mika Havela <mika.havela@gmail.com> | 2008-04-09 13:23:31 +0000 |
commit | f83a1a729f68ab79138857a884308084e23cd595 (patch) | |
tree | 2850811ad13f0ba62a22b36435d34c8377be6f46 /lbu-expert-html.lsp | |
parent | 17b2b7ad8ab66c4911cff345ddcbf1594cd2418e (diff) | |
download | acf-alpine-conf-f83a1a729f68ab79138857a884308084e23cd595.tar.bz2 acf-alpine-conf-f83a1a729f68ab79138857a884308084e23cd595.tar.xz |
Cleaning up the code.
git-svn-id: svn://svn.alpinelinux.org/acf/alpine-conf/trunk@966 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'lbu-expert-html.lsp')
-rw-r--r-- | lbu-expert-html.lsp | 44 |
1 files changed, 9 insertions, 35 deletions
diff --git a/lbu-expert-html.lsp b/lbu-expert-html.lsp index 219d748..ed87ade 100644 --- a/lbu-expert-html.lsp +++ b/lbu-expert-html.lsp @@ -1,4 +1,6 @@ -<? local form = ... ?> +<? local form = ... +require("viewfunctions") +?> <? --[[ DEBUG INFORMATION io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>") @@ -7,38 +9,14 @@ io.write("</span>") --]] ?> -<? -function displayinfo(myform,tags,viewonly) - io.write("<DL>") - for k,v in pairs(tags) do - if (myform[v]) and (myform[v]["value"]) then - local val = myform[v] - io.write("\t<DT") - if (#val.errtxt > 0) then - val.class = "error" - io.write(" class='error'") - end - io.write(">" .. val.label .. "</DT>\n") - if (viewonly) then - io.write("\t\t<DD>" .. val.value .. "\n") - else - io.write("\t\t<DD>" .. html.form[val.type](val) .. "\n") - end - if (val.descr) and (#val.descr > 0) then io.write("\t\t<P CLASS='descr'>" .. string.gsub(val.descr, "\n", "<BR>") .. "</P>\n") end - if (#val.errtxt > 0) then io.write("\t\t<P CLASS='error'>" .. string.gsub(val.errtxt, "\n", "<BR>") .. "</P>\n") end - io.write("\t\t</DD>\n") - end - end - io.write("</DL>") -end -?> - <H1>SYSTEM INFO</H1> +<DL> <? local myform = form.status local tags = { "status", "version", } displayinfo(myform,tags,"viewonly") ?> +</DL> <h1>CONFIGURATION</h1> @@ -46,11 +24,13 @@ displayinfo(myform,tags,"viewonly") <H2>EXPERT CONFIGURATION</H2> <H3>FILE DETAILS</H3> +<DL> <? local myform = form.file local tags = { "filename", "filesize", "mtime", "sumerrors" } displayinfo(myform,tags,"viewonly") ?> +</DL> <H3>FILE CONTENT</H3> <? @@ -58,17 +38,11 @@ io.write(html.form[myform.filecontent.type](myform.filecontent)) ?> <H2>Save and apply above settings</H2> +<DL> <? local myform = form.file local tags = { "cmdsave", } displayinfo(myform,tags) ?> +</DL> </form> - -<? ---[[ DEBUG INFORMATION -io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>") -io.write(html.cfe_unpack(form)) -io.write("</span>") ---]] -?> |