summaryrefslogtreecommitdiffhomepage
path: root/libs/web
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-10-10 14:37:53 +0000
committerSteven Barth <steven@midlink.org>2008-10-10 14:37:53 +0000
commit676203d1fc8243476267fdb7ac6d1ef955397e52 (patch)
tree36aeebe9b26ef4f15f378f9538791dc105cd2072 /libs/web
parent6bfef156f2cdcb4e01176ffbac7998625414a8e5 (diff)
OXYGEN #2: Reorganized theme selection, added indexing support
Diffstat (limited to 'libs/web')
-rw-r--r--libs/web/luasrc/dispatcher.lua10
1 files changed, 9 insertions, 1 deletions
diff --git a/libs/web/luasrc/dispatcher.lua b/libs/web/luasrc/dispatcher.lua
index fc568969b..d03b2ec37 100644
--- a/libs/web/luasrc/dispatcher.lua
+++ b/libs/web/luasrc/dispatcher.lua
@@ -161,7 +161,7 @@ function dispatch(request)
end
-- Init template engine
- if not track.notemplate then
+ if (c and c.index) or not track.notemplate then
local tpl = require("luci.template")
local media = luci.config.main.mediaurlbase
if not pcall(tpl.Template, "themes/%s/header" % fs.basename(media)) then
@@ -183,6 +183,7 @@ function dispatch(request)
viewns.striptags = util.striptags
viewns.controller = luci.http.getenv("SCRIPT_NAME")
viewns.media = media
+ viewns.theme = fs.basename(media)
viewns.resource = luci.config.main.resourcebase
viewns.REQUEST_URI = (luci.http.getenv("SCRIPT_NAME") or "") .. (luci.http.getenv("PATH_INFO") or "")
end
@@ -231,6 +232,13 @@ function dispatch(request)
luci.sys.process.setuser(track.setuser)
end
+ if c and c.index then
+ local tpl = require "luci.template"
+ if util.copcall(tpl.render, "indexer") then
+ return true
+ end
+ end
+
if c and type(c.target) == "function" then
context.dispatched = c