From 9c87ef46027f223be76d19ba0339f37c35ce23a5 Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Fri, 22 Feb 2008 10:52:11 +0000 Subject: Temporary save. Things are far from working git-svn-id: svn://svn.alpinelinux.org/acf/tinydns/trunk@764 ab2d0c66-481e-0410-8bed-d214d4d58bed --- tinydns-status-html.lsp | 130 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 102 insertions(+), 28 deletions(-) (limited to 'tinydns-status-html.lsp') diff --git a/tinydns-status-html.lsp b/tinydns-status-html.lsp index 27fe91a..5d5bd1d 100644 --- a/tinydns-status-html.lsp +++ b/tinydns-status-html.lsp @@ -1,6 +1,6 @@ DEBUGGING

DEBUG INFO: CFE

") io.write(html.cfe_unpack(form)) io.write("
") @@ -41,25 +41,25 @@ displayinfo(myform,tags,"viewonly")

PROGRAM SPECIFIC OPTIONS/INFORMATION

") --for k,v in pairs(tags) do -if (myform[v]) and (myform[v]["value"]) then - local val = myform[v] +if (myform) and (myform.value) then + local val = myform io.write("\t 0) then - val.class = "error" +-- val.class = "error" io.write(" class='error'") end io.write(">" .. val.label .. "\n") io.write("\t\t
\n") - for k,v in pairs(myform[v]["value"]) do + for k,v in pairs(myform.value) do io.write(" " .. tostring(k) .. "") for kk,vv in pairs(v) do - io.write(tostring("
" ..vv.option[3]).. "\n") + io.write(tostring("
" .. vv .. "\n")) end io.write("
") end @@ -72,37 +72,111 @@ end io.write("") ?> + ") ---for k,v in pairs(tags) do -if (myform[v]) and (myform[v]["value"]) then - local val = myform[v] - io.write("\t 0) then - val.class = "error" - io.write(" class='error'") +local function recurseoutput(table,cnt) + if not (cnt) then cnt=0 end + cnt = cnt + 1 + for k,v in pairs(table or {}) do + if (type(v) == "string") then + io.write(" ".. + tostring(v) .. "
") + else + io.write(" ".. + tostring(k) .. "
") + recurseoutput(v,cnt) + end end - io.write(">" .. val.label .. "\n") - +end +?> +" .. myform.label .. "\n") io.write("\t\t
\n") - for k,v in pairs(myform[v]["value"]) do - io.write(" " .. tostring(k) .. "") - for kk,vv in pairs(v) do - io.write(tostring("
" ..vv.option[3]).. "\n") + + for k,v in pairs(myform.value) do + recurseoutput(v) + end + +--[[ +local function recursedir(path, filearray) + local k,v + for k,v in pairs(posix.dir(path) or {}) do + -- Ignore files that begins with a '.' + if not string.match(v, "^%.") then + local f = path .. "/" .. v + -- If subfolder exists, list files in this subfolder + if (posix.stat(f).type == "directory") then + recursedir(f, filearray) + else + table.insert(filearray, f) + end end - io.write("
") end +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") +--[[ + local output = k + io.write("".. k .. "
") + if (#v == 0) then + for k1,v1 in pairs(v) do + output = k1 .. "." .. output + io.write("".. output .. "
") + if (#v1 == 0) then + for k2,v2 in pairs(v1) do + output = k2 .. "." .. output + io.write("".. output .. "
") + if (#v2 == 0) then + for k3,v3 in pairs(v2) do + output = k3 .. "." .. output + io.write("".. output .. "
") + if (#v3 == 0) then + for k4,v4 in pairs(v3) do + output = k4 .. "." .. output + io.write("".. output .. "
") + if (#v4 == 0) then + for k5,v5 in pairs(v4) do + output = k5 .. "." .. output + io.write("".. output .. "
") + if (#v5 == 0) then + for k6,v6 in pairs(v5) do + output = k6 .. "." .. output + io.write("".. output .. "
") + end + else + computer(output,7) + end + end + else + computer(output,6) + end + end + else + computer(output,5) + end + end + else + computer(output,5) + end + end + else + computer(output,5) + end + end + else + computer(output,4) + end + end + --]] end ---end io.write("") +--]==] ?> + DEBUGGING

DEBUG INFO: CFE

") -- cgit v1.2.3