summaryrefslogtreecommitdiffstats
path: root/lib/viewfunctions.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lib/viewfunctions.lua')
-rw-r--r--lib/viewfunctions.lua18
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/viewfunctions.lua b/lib/viewfunctions.lua
index dd2fcda..62a87c6 100644
--- a/lib/viewfunctions.lua
+++ b/lib/viewfunctions.lua
@@ -145,7 +145,7 @@ function displayformitem(myitem, name, viewtype)
io.write("</DD>\n")
end
-function displayform(myform, order)
+function displayform(myform, order, finishingorder)
if not myform then return end
if myform.descr then io.write('<P CLASS="descr">' .. string.gsub(myform.descr, "\n", "<BR>") .. "</P>\n") end
if myform.errtxt then io.write('<P CLASS="error">' .. string.gsub(myform.errtxt, "\n", "<BR>") .. "</P>\n") end
@@ -161,12 +161,26 @@ function displayform(myform, order)
end
end
end
+ local reversefinishingorder = {}
+ if finishingorder then
+ for x,name in ipairs(finishingorder) do
+ reversefinishingorder[name] = x
+ end
+ end
for name,item in pairs(myform.value) do
- if nil == reverseorder[name] then
+ if nil == reverseorder[name] and nil == reversefinishingorder[name] then
item.name = name
displayformitem(item)
end
end
+ if finishingorder then
+ for x,name in ipairs(finishingorder) do
+ if myform.value[name] then
+ myform.value[name].name = name
+ displayformitem(myform.value[name])
+ end
+ end
+ end
io.write('<DT></DT><DD><input class="submit" type="submit" name="' .. myform.option .. '" value="' .. (myform.submit or myform.option) .. '"></DD>\n')
io.write('</DL>\n')
io.write('</FORM>')