Introduce noheader and nofooter CBI-Dispatcher config
authorSteven Barth <steven@midlink.org>
Fri, 27 Mar 2009 00:10:17 +0000 (00:10 +0000)
committerSteven Barth <steven@midlink.org>
Fri, 27 Mar 2009 00:10:17 +0000 (00:10 +0000)
libs/web/luasrc/dispatcher.lua

index 0d48acd14a64eab4da82deba2b1acd17bd1ac5b5..89fa0d22fc15cc4a924d6ac9615b64487cab93f5 100644 (file)
@@ -672,14 +672,18 @@ local function _cbi(self, ...)
 
        local pageaction = true
        http.header("X-CBI-State", state or 0)
-       tpl.render("cbi/header", {state = state})
+       if not config.noheader then
+               tpl.render("cbi/header", {state = state})
+       end
        for i, res in ipairs(maps) do
                res:render()
                if res.pageaction == false then
                        pageaction = false
                end
        end
-       tpl.render("cbi/footer", {pageaction=pageaction, state = state, autoapply = config.autoapply})
+       if not config.nofooter then
+               tpl.render("cbi/footer", {pageaction=pageaction, state = state, autoapply = config.autoapply})
+       end
 end
 
 --- Create a CBI model dispatching target.