diff options
author | Steven Barth <steven@midlink.org> | 2008-03-22 19:46:14 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-03-22 19:46:14 +0000 |
commit | 93c55f3c5d7d253423c9d5695b8d71388bd21988 (patch) | |
tree | d2d8b9cc73f040cda24836afd2711edb5c8eefb6 /src/ffluci/dispatcher.lua | |
parent | c8426cfa3cce952dde8cdf2eb058d0c2fae4986d (diff) |
* CBI updates
* Made dispatching paths unambiguous
Diffstat (limited to 'src/ffluci/dispatcher.lua')
-rw-r--r-- | src/ffluci/dispatcher.lua | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/ffluci/dispatcher.lua b/src/ffluci/dispatcher.lua index 0f05c3d173..f3a62bb193 100644 --- a/src/ffluci/dispatcher.lua +++ b/src/ffluci/dispatcher.lua @@ -167,13 +167,15 @@ function cbi(request) local tmpl = require("ffluci.template") local cbi = require("ffluci.cbi") + local path = request.category.."_"..request.module.."/"..request.action + i18n.loadc(request.module) - stat, map = pcall(cbi.load, request.module.."/"..request.action) + stat, map = pcall(cbi.load, path) if stat then - tmpl.render("header") + tmpl.render("cbi/header") map:render() - tmpl.render("footer") + tmpl.render("cbi/footer") else disp.error404() end @@ -195,15 +197,16 @@ function dynamic(request) return end - if pcall(tmpl.render, request.module .. "/" .. request.action) then + local path = request.category.."_"..request.module.."/"..request.action + if pcall(tmpl.render, path) then return end - stat, map = pcall(cbi.load, request.module.."/"..request.action) + stat, map = pcall(cbi.load, path) if stat then - tmpl.render("header") + tmpl.render("cbi/header") map:render() - tmpl.render("footer") + tmpl.render("cbi/footer") return end @@ -217,8 +220,10 @@ function simpleview(request) local tmpl = require("ffluci.template") local disp = require("ffluci.dispatcher") + local path = request.category.."_"..request.module.."/"..request.action + i18n.loadc(request.module) - if not pcall(tmpl.render, request.module .. "/" .. request.action) then + if not pcall(tmpl.render, path) then disp.error404() end end
\ No newline at end of file |