libs/web: expose cbi map redirect property to page templates

This commit is contained in:
Jo-Philipp Wich 2010-11-21 00:14:03 +00:00
parent bcdc4c16b2
commit 25754119d4

View file

@ -718,6 +718,7 @@ local function _cbi(self, ...)
end end
end end
local redirect
local pageaction = true local pageaction = true
http.header("X-CBI-State", state or 0) http.header("X-CBI-State", state or 0)
if not config.noheader then if not config.noheader then
@ -728,9 +729,18 @@ local function _cbi(self, ...)
if res.pageaction == false then if res.pageaction == false then
pageaction = false pageaction = false
end end
if res.redirect then
redirect = redirect or res.redirect
end
end end
if not config.nofooter then 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
end end