summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2012-02-22 13:49:36 +0000
committerTed Trask <ttrask01@yahoo.com>2012-02-22 13:49:36 +0000
commit3cb42e2c39d20d4dc7d0c8b294b883c39e837963 (patch)
tree0f97c0b0317ab88a9db8ea3cbda1d1b187329d6b
parent21b89eeaeb9a2192b552f842161973777de056d7 (diff)
downloadacf-core-3cb42e2c39d20d4dc7d0c8b294b883c39e837963.tar.bz2
acf-core-3cb42e2c39d20d4dc7d0c8b294b883c39e837963.tar.xz
Changed forms to always use 'submit' as name of submit button, plus allow multiple submit buttons
-rw-r--r--app/acf-util/logon-controller.lua2
-rw-r--r--lib/controllerfunctions.lua6
-rw-r--r--lib/htmlviewfunctions.lua11
3 files changed, 14 insertions, 5 deletions
diff --git a/app/acf-util/logon-controller.lua b/app/acf-util/logon-controller.lua
index 272af78..5404dbd 100644
--- a/app/acf-util/logon-controller.lua
+++ b/app/acf-util/logon-controller.lua
@@ -26,7 +26,7 @@ logon = function(self)
local password = cfe({ type="password", label="Password", seq=2 })
local redir = cfe({ type="hidden", value=clientdata.redir, label="" })
local cmdresult = cfe({ type="form", value={userid=userid, password=password, redir=redir}, label="Logon", option="Logon" })
- if clientdata.Logon then
+ if clientdata.submit then
local logonredirect = self.sessiondata.logonredirect
local logon = self.model:logon(clientdata.userid, clientdata.password, conf.clientip, conf.sessiondir, sessiondata)
-- If successful logon, redirect to welcome-page, otherwise try again
diff --git a/lib/controllerfunctions.lua b/lib/controllerfunctions.lua
index aba22ed..9c9af31 100644
--- a/lib/controllerfunctions.lua
+++ b/lib/controllerfunctions.lua
@@ -65,12 +65,12 @@ function handle_clientdata(form, clientdata, group)
end
function handle_form(self, getFunction, setFunction, clientdata, option, label, descr)
- local form = getFunction()
+ local form = getFunction(clientdata)
- if clientdata[option] then
+ if clientdata.submit then
handle_clientdata(form, clientdata)
- form = setFunction(form)
+ form = setFunction(form, clientdata.submit)
if not form.errtxt and descr then
form.descr = descr
end
diff --git a/lib/htmlviewfunctions.lua b/lib/htmlviewfunctions.lua
index ef59485..08db605 100644
--- a/lib/htmlviewfunctions.lua
+++ b/lib/htmlviewfunctions.lua
@@ -224,7 +224,16 @@ end
function displayformend(myform)
if not myform then return end
- io.write('<DT></DT><DD><input class="submit" type="submit" name="' .. html.html_escape(myform.option) .. '" value="' .. html.html_escape(myform.submit or myform.option) .. '"></DD>\n')
+ local option = myform.submit or myform.option
+ io.write('<DT></DT><DD>')
+ if type(option) == "table" then
+ for i,v in ipairs(option) do
+ io.write('<input class="submit" type="submit" name="submit" value="' .. html.html_escape(v) .. '">\n')
+ end
+ else
+ io.write('<input class="submit" type="submit" name="submit" value="' .. html.html_escape(myform.submit or myform.option) .. '">\n')
+ end
+ io.write('</DD>\n')
io.write('</FORM>')
io.write('</DL>\n')
end