blob: d68a5fe018971fbe7e03bcb4a3917071bf313f5c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
<? local form = ... ?>
<?
function displayinfo(myform,tags,viewonly)
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) 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) 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
end
?>
<H1>SYSTEM INFO</H1>
<DL>
<?
local myform = form.info
local tags = { "status", "version", "autostart", }
displayinfo(myform,tags,"viewonly")
?>
</DL>
|