summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/getopts.lua8
-rw-r--r--lib/viewfunctions.lua18
2 files changed, 24 insertions, 2 deletions
diff --git a/lib/getopts.lua b/lib/getopts.lua
index 874d70d..0579bd3 100644
--- a/lib/getopts.lua
+++ b/lib/getopts.lua
@@ -87,6 +87,10 @@ function setoptsinfile (file, search_section, search_name, value, to_table, opti
for line in string.gmatch(file, "([^\n]*)\n") do
conf_file[#conf_file + 1] = line
end
+ local extra = string.match(file,"([^\n]*)$")
+ if extra ~= "" then
+ conf_file[#conf_file + 1] = extra
+ end
end
local new_conf_file = {}
local section = ""
@@ -163,6 +167,10 @@ function getoptsfromfile (file, search_section, search_name, to_table, filter)
for line in string.gmatch(file, "([^\n]*)\n") do
conf_file[#conf_file + 1] = line
end
+ local extra = string.match(file,"([^\n]*)$")
+ if extra ~= "" then
+ conf_file[#conf_file + 1] = extra
+ end
end
local section = ""
local skip_lines = 0
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>')