diff options
author | Ted Trask <ttrask01@yahoo.com> | 2010-10-15 14:30:13 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2010-10-15 14:30:13 +0000 |
commit | b6e47a6c610c259172e39f28e89f5438535578c1 (patch) | |
tree | 7c3c7b91657b8a655013d53d38e838301c7cc476 /lib/controllerfunctions.lua | |
parent | 6298d6adc2626dd9e30f6af6f173c355a1036395 (diff) | |
download | acf-core-b6e47a6c610c259172e39f28e89f5438535578c1.tar.bz2 acf-core-b6e47a6c610c259172e39f28e89f5438535578c1.tar.xz |
Modifed displayform and handle_clientdata to allow cfe groups in forms, displayed under header tag.
Diffstat (limited to 'lib/controllerfunctions.lua')
-rw-r--r-- | lib/controllerfunctions.lua | 10 |
1 files changed, 7 insertions, 3 deletions
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 |