+ return
+ end
+
+ local path = request.category.."_"..request.module.."/"..request.action
+ if pcall(tmpl.render, path) then
+ return
+ end
+
+ local stat, map = pcall(cbi.load, path)
+ if stat and map then
+ local stat, err = pcall(map.parse, map)
+ if not stat then
+ disp.error500(err)
+ return
+ end
+ tmpl.render("cbi/header")
+ map:render()
+ tmpl.render("cbi/footer")
+ return
+ elseif not stat then
+ disp.error500(map)
+ return
+ end
+
+ disp.error404()
+end
+
+-- The Simple View Dispatcher directly renders the template
+-- which is placed in ffluci/views/"request.module"/"request.action"
+function simpleview(request)
+ local i18n = require("ffluci.i18n")
+ 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, path) then