diff options
author | Ted Trask <ttrask01@yahoo.com> | 2017-02-27 16:14:04 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2017-02-27 17:01:19 +0000 |
commit | e141e5031c167cb4b3516c995fa0a9ff0afc66ef (patch) | |
tree | 99efffc03e50ec3e66504ac678dfbfb7c2c3a69a | |
parent | 4f0d10d7c9455dca4eed37dc8f6447d7360bbf8b (diff) | |
download | acf-core-0.20.2.tar.bz2 acf-core-0.20.2.tar.xz |
Bump version to 0.20.2v0.20.2
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | lib/htmlviewfunctions.lua | 22 |
2 files changed, 18 insertions, 6 deletions
@@ -1,6 +1,6 @@ APP_NAME=core PACKAGE=acf-$(APP_NAME) -VERSION=0.20.1 +VERSION=0.20.2 P=$(PACKAGE)-$(VERSION) DISTDIR:=$(shell pwd)/$(P) diff --git a/lib/htmlviewfunctions.lua b/lib/htmlviewfunctions.lua index cd5774c..3eef7d9 100644 --- a/lib/htmlviewfunctions.lua +++ b/lib/htmlviewfunctions.lua @@ -124,15 +124,23 @@ function mymodule.displayitem(myitem, page_info, header_level, name, group) elseif myitem.key and not myitem.readonly then mymodule.displayformitem(myitem, name, header_level, group) elseif myitem.type ~= "hidden" then - if myitem.errtxt then - myitem.class = "error" + if myitem.errtxt then + if myitem.class then + myitem.class = myitem.class.." error" + else + myitem.class = "error" + end end header_level = mymodule.displayitemstart(myitem, page_info, header_level) if 0 <= header_level then io.write(html.html_escape(myitem.label)) end mymodule.displayitemmiddle(myitem, page_info, header_level) - io.write("<p>"..string.gsub(html.html_escape(tostring(myitem.value)), "\n", "<br/>") .. "</p>\n") + class = "" + if myitem.class then + class = ' class="'..html.html_escape(myitem.class)..'"' + end + io.write("<p"..class..">"..string.gsub(html.html_escape(tostring(myitem.value)), "\n", "<br/>") .. "</p>\n") mymodule.displayitemend(myitem, page_info, header_level) end end @@ -141,8 +149,12 @@ function mymodule.displayformitem(myitem, name, header_level, group) if not myitem then return end myitem.name = name or myitem.name or "" if group and group ~= "" then myitem.name = group.."."..myitem.name end - if myitem.errtxt then - myitem.class = "error" + if myitem.errtxt then + if myitem.class then + myitem.class = myitem.class.." error" + else + myitem.class = "error" + end end if myitem.type ~= "hidden" and myitem.type ~= "group" then -- Set the id so the label 'for' can point to it |