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-config-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-config-html.lsp')
-rw-r--r-- | lbu-config-html.lsp | 52 |
1 files changed, 16 insertions, 36 deletions
diff --git a/lbu-config-html.lsp b/lbu-config-html.lsp index 22c1405..d9e1491 100644 --- a/lbu-config-html.lsp +++ b/lbu-config-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>") @@ -6,80 +8,58 @@ io.write(html.cfe_unpack(form)) 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>CONFIG</H1> <form name="config" action="" method="POST"> <H2>Advanced config</H2> <H3>Storage media</H3> -<? +<DL> +<? local myform = form.config local tags = { "LBU_MEDIA", } displayinfo(myform,tags) ?> +</DL> <H3>Included list</H3> +<DL> <? local tags = { "lbu_included","cmd_delete_included", "item_add_included", "cmd_add_included", } displayinfo(myform,tags) ?> +</DL> <H3>Excluded list</H3> +<DL> <? local tags = { "lbu_excluded","cmd_delete_excluded", "item_add_excluded", "cmd_add_excluded", } displayinfo(myform,tags) ?> +</DL> <H3>Security/Encryption</H3> +<DL> <? local tags = { "ENCRYPTION", "DEFAULT_CIPHER", "PASSWORD", } displayinfo(myform,tags) ?> +</DL> <H2>Save and apply above settings</H2> +<DL> <? local tags = { "config_submit" } 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>") ---]] -?> |