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", "autostart", }
displayinfo(myform,tags,"viewonly")
?>
PROGRAM SPECIFIC OPTIONS/INFORMATION
Locations
-- 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
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
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 (table[k].label) then
if not (tonumber(k)) or (v.value) then
-- if v.label then
io.write("\n\t\t\t " .. tostring(v.label) .. "
")
io.write("\n\t\t\t")
for k1,v1 in pairs(v.option) do
if (v1.label) then
io.write("\n\t\t\t\t\n\t\t\t\t\t".. tostring(v1.label) ..
": | \n\t\t\t\t\t".. tostring(v1.value) .." | \n\t\t\t\t
")
end
end
io.write("\n\t\t\t
")
-- end
else
io.write("\n\t\t\t "..
tostring(table[k].label) .. "
")
recurseoutput(v,cnt)
end
end
end
end
?>
Records
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("")
--]]
?>