From b6e47a6c610c259172e39f28e89f5438535578c1 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Fri, 15 Oct 2010 14:30:13 +0000 Subject: Modifed displayform and handle_clientdata to allow cfe groups in forms, displayed under header tag. --- lib/controllerfunctions.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib/controllerfunctions.lua') diff --git a/lib/controllerfunctions.lua b/lib/controllerfunctions.lua index ac2388e..22e763b 100644 --- a/lib/controllerfunctions.lua +++ b/lib/controllerfunctions.lua @@ -1,9 +1,11 @@ module(..., package.seeall) -function handle_clientdata(form, clientdata) +function handle_clientdata(form, clientdata, group) form.errtxt = nil - for name,value in pairs(form.value) do + for n,value in pairs(form.value) do value.errtxt = nil + local name = n + if group then name = group.."."..name end if name:find("%.") then -- If the name has a '.' in it, haserl will interpret it as a table local actualval = clientdata @@ -17,7 +19,9 @@ function handle_clientdata(form, clientdata) end clientdata[name] = actualval end - if value.type == "boolean" then + if value.type == "group" then + handle_clientdata(value, clientdata, name) + elseif value.type == "boolean" then value.value = (clientdata[name] ~= nil) and (clientdata[name] ~= "false") elseif value.type == "multi" then if clientdata[name] == nil then -- cgit v1.2.3