From bc8c34d81a8e90a9d9de22cb313a8738c86bb15c Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Wed, 2 Jul 2008 19:37:37 +0000 Subject: Changed interfaces to use controllerfunctions. git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@1268 ab2d0c66-481e-0410-8bed-d214d4d58bed --- lib/viewfunctions.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lib/viewfunctions.lua') diff --git a/lib/viewfunctions.lua b/lib/viewfunctions.lua index 27320a6..45701d6 100644 --- a/lib/viewfunctions.lua +++ b/lib/viewfunctions.lua @@ -171,3 +171,20 @@ function displayform(myform, order) io.write('\n') io.write('') end + +function displaycommandresults(commands, session) + local cmdresult = {} + for i,cmd in ipairs(commands) do + if session[cmd.."result"] then + cmdresult[#cmdresult + 1] = session[cmd.."result"] + session[cmd.."result"] = nil + end + end + if #cmdresult > 0 then + io.write("

Command Result

\n
\n") + for i,result in ipairs(cmdresult) do + io.write(result.value:gsub("\n", "
") .. "\n") + end + io.write("
\n") + end +end -- cgit v1.2.3