From 25754119d45d3cf8695ae0ee8c8332d69f9985c3 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 21 Nov 2010 00:14:03 +0000 Subject: [PATCH] libs/web: expose cbi map redirect property to page templates --- libs/web/luasrc/dispatcher.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libs/web/luasrc/dispatcher.lua b/libs/web/luasrc/dispatcher.lua index 0f49b90ce..d10b5c0b5 100644 --- a/libs/web/luasrc/dispatcher.lua +++ b/libs/web/luasrc/dispatcher.lua @@ -718,6 +718,7 @@ local function _cbi(self, ...) end end + local redirect local pageaction = true http.header("X-CBI-State", state or 0) if not config.noheader then @@ -728,9 +729,18 @@ local function _cbi(self, ...) if res.pageaction == false then pageaction = false end + if res.redirect then + redirect = redirect or res.redirect + end end if not config.nofooter then - tpl.render("cbi/footer", {flow = config, pageaction=pageaction, state = state, autoapply = config.autoapply}) + tpl.render("cbi/footer", { + flow = config, + pageaction = pageaction, + redirect = redirect, + state = state, + autoapply = config.autoapply + }) end end -- 2.11.0