local form = ... ?>
--[[ DEBUG INFORMATION
io.write("
DEBUGGING
DEBUG INFO: CFE
")
io.write(html.cfe_unpack(form))
io.write("")
--]]
?>
function displayinfo(myform,tags,viewonly)
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'")
end
io.write(">" .. val.label .. "
\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")
end
end
io.write("
")
end
?>
SYSTEM INFO
local myform = form.status
local tags = { "status", "version", }
displayinfo(myform,tags,"viewonly")
?>
PROGRAM SPECIFIC OPTIONS/INFORMATION
-- DEBUGGING
--local myform = form.config
--local tags = { "debug", }
--displayinfo(myform,tags)
local myform = form.config.locations
--displayinfo(myform,tags)
io.write("")
--for k,v in pairs(tags) do
if (myform) and (myform.value) then
local val = myform
io.write("\n\t- 0) then
-- val.class = "error"
io.write(" class='error'")
end
io.write(">" .. val.label .. "
")
io.write("\n\t\t- ")
for k,v in pairs(myform.value) do
io.write(" " .. tostring(k) .. "")
for kk,vv in pairs(v) do
io.write(tostring("
" .. vv .. "\n"))
end
io.write("
")
end
if (val.descr) and (#val.descr > 0) then io.write("\n\t\t" .. string.gsub(val.descr, "\n", "
") .. "
") end
if (#val.errtxt > 0) then io.write("\n\t\t" .. string.gsub(val.errtxt, "\n", "
") .. "
") end
io.write("\n\t\t ")
end
--end
io.write("
")
?>
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["name"]) == "string") then
io.write("\n\t\t\t ".. tostring(v["label"]) .. "
")
if (#v > 0) then
io.write("\n\t\t\t")
for i=1,#v do
if (type(v[i]["label"]) == "string") then
io.write("\n\t\t\t\t\n\t\t\t\t\t".. tostring(v[i]["label"]) .. ": | \n\t\t\t\t\t".. tostring(v[i]["value"]) .." | \n\t\t\t\t
")
end
end
io.write("\n\t\t\t
")
end
else
io.write("\n\t\t\t "..
tostring(k) .. "
")
recurseoutput(v,cnt)
end
end
end
?>
local tags = {"nsourdomain", "nsdomain", "host", "alias", "mx", "ptr", "cname", "soa", "generic", "all" }
local myform = form.config.settings
io.write("")
for k,v in pairs(tags) do
local myform = myform[v]
if (myform) and (myform.value) then
io.write("\n\t- " .. myform.label .. "
")
io.write("\n\t\t- ")
for k,v in pairs(myform.value) do
recurseoutput(v)
end
io.write("\n\t\t
")
end
end
io.write("
")
?>
--[[ DEBUG INFORMATION
io.write("DEBUGGING
DEBUG INFO: CFE
")
io.write(html.cfe_unpack(form))
io.write("")
--]]
?>