From 6e97be1e9233fe7d99818bba394c2649a4433cc7 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sat, 27 Nov 2010 18:17:15 +0000 Subject: [PATCH] libs/web: add the ability for maps to push error messages to the global page header --- libs/web/luasrc/dispatcher.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libs/web/luasrc/dispatcher.lua b/libs/web/luasrc/dispatcher.lua index 589cb731f..3d0db5a21 100644 --- a/libs/web/luasrc/dispatcher.lua +++ b/libs/web/luasrc/dispatcher.lua @@ -725,6 +725,7 @@ local function _cbi(self, ...) end local redirect + local messages local applymap = false local pageaction = true local parsechain = { } @@ -745,6 +746,11 @@ local function _cbi(self, ...) if res.pageaction == false then pageaction = false end + + if res.message then + messages = messages or { } + messages[#messages+1] = res.message + end end for i, res in ipairs(maps) do @@ -752,6 +758,7 @@ local function _cbi(self, ...) firstmap = (i == 1), applymap = applymap, redirect = redirect, + messages = messages, pageaction = pageaction, parsechain = parsechain }) -- 2.11.0