From: Jo-Philipp Wich Date: Sat, 27 Nov 2010 18:17:15 +0000 (+0000) Subject: libs/web: add the ability for maps to push error messages to the global page header X-Git-Tag: 0.10.0~350 X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=6e97be1e9233fe7d99818bba394c2649a4433cc7;ds=sidebyside libs/web: add the ability for maps to push error messages to the global page header --- 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 })