libs/web: add the ability for maps to push error messages to the global page header

This commit is contained in:
Jo-Philipp Wich 2010-11-27 18:17:15 +00:00
parent aec41da4e0
commit 6e97be1e92

View file

@ -725,6 +725,7 @@ local function _cbi(self, ...)
end end
local redirect local redirect
local messages
local applymap = false local applymap = false
local pageaction = true local pageaction = true
local parsechain = { } local parsechain = { }
@ -745,6 +746,11 @@ local function _cbi(self, ...)
if res.pageaction == false then if res.pageaction == false then
pageaction = false pageaction = false
end end
if res.message then
messages = messages or { }
messages[#messages+1] = res.message
end
end end
for i, res in ipairs(maps) do for i, res in ipairs(maps) do
@ -752,6 +758,7 @@ local function _cbi(self, ...)
firstmap = (i == 1), firstmap = (i == 1),
applymap = applymap, applymap = applymap,
redirect = redirect, redirect = redirect,
messages = messages,
pageaction = pageaction, pageaction = pageaction,
parsechain = parsechain parsechain = parsechain
}) })