diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2010-11-27 18:17:15 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2010-11-27 18:17:15 +0000 |
commit | 6e97be1e9233fe7d99818bba394c2649a4433cc7 (patch) | |
tree | cc57c0afbde948603bc219b18f811fe8e1284510 /libs/web | |
parent | aec41da4e09672a48cf7ce25fb0bbfc8d742957d (diff) |
libs/web: add the ability for maps to push error messages to the global page header
Diffstat (limited to 'libs/web')
-rw-r--r-- | libs/web/luasrc/dispatcher.lua | 7 |
1 files changed, 7 insertions, 0 deletions
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 }) |