summaryrefslogtreecommitdiffstats
path: root/lib/viewfunctions.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2008-05-15 20:15:32 +0000
committerTed Trask <ttrask01@yahoo.com>2008-05-15 20:15:32 +0000
commit846a69204d0d2e54638f8e08a3052b2316827cab (patch)
treef1e567623b6be1e62f91ba1cfe9383308790bcc9 /lib/viewfunctions.lua
parentc1c2252c53ffcb14b98443f8ee2c6da40551f160 (diff)
downloadacf-core-846a69204d0d2e54638f8e08a3052b2316827cab.tar.bz2
acf-core-846a69204d0d2e54638f8e08a3052b2316827cab.tar.xz
For cfe.type='form', use cfe.option as the command to save the form data i.e. can be used as button name. Modified pages that use 'form' to also use 'option'.
git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@1122 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'lib/viewfunctions.lua')
-rw-r--r--lib/viewfunctions.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/viewfunctions.lua b/lib/viewfunctions.lua
index bb6e6ec..801e7e4 100644
--- a/lib/viewfunctions.lua
+++ b/lib/viewfunctions.lua
@@ -108,7 +108,7 @@ function displayformitem(myitem, name, viewtype)
--myitem.type = "select"
--myitem.multiple = "true"
local tempname = myitem.name
- local tempval = myitem.value
+ local tempval = myitem.value or {}
local reverseval = {}
for x,val in ipairs(tempval) do
reverseval[val] = x
@@ -137,7 +137,7 @@ function displayform(myform, order)
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
- io.write('<form action="' .. myform.action .. '" method="POST">\n')
+ io.write('<form action="' .. (myform.action or "") .. '" method="POST">\n')
io.write('<DL>\n')
local reverseorder= {}
if order then
@@ -155,7 +155,7 @@ function displayform(myform, order)
displayformitem(item)
end
end
- io.write('<DT><input class="submit" type="submit" name="save" value="' .. myform.submit .. '"></DT>\n')
+ io.write('<DT><input class="submit" type="submit" name="' .. myform.option .. '" value="' .. (myform.submit or myform.option) .. '"></DT>\n')
io.write('</DL>\n')
io.write('</FORM>')
end