summaryrefslogtreecommitdiffhomepage
path: root/libs/web
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-08-07 19:03:25 +0000
committerSteven Barth <steven@midlink.org>2008-08-07 19:03:25 +0000
commite72a526984982f6fa2b6f2ed5ce01523094bfe43 (patch)
tree2f34fbbe1e21e58d9292fd13305c834cb0613b17 /libs/web
parentd79794c1194c65861253e20681fabe103cc85740 (diff)
libs/cbi: Added magic ;-)
Diffstat (limited to 'libs/web')
-rw-r--r--libs/web/luasrc/dispatcher.lua15
1 files changed, 12 insertions, 3 deletions
diff --git a/libs/web/luasrc/dispatcher.lua b/libs/web/luasrc/dispatcher.lua
index 840dbf3c2..9ba74c49c 100644
--- a/libs/web/luasrc/dispatcher.lua
+++ b/libs/web/luasrc/dispatcher.lua
@@ -126,9 +126,12 @@ function dispatch(request)
local c = context.tree
local track = {}
+ local args = {}
+ local n
for i, s in ipairs(request) do
c = c.nodes[s]
+ n = i
if not c or c.leaf then
break
end
@@ -138,6 +141,12 @@ function dispatch(request)
end
end
+ if c and c.leaf then
+ for j=n+1, #request do
+ table.insert(args, request[j])
+ end
+ end
+
if track.i18n then
require("luci.i18n").loadc(track.i18n)
end
@@ -190,7 +199,7 @@ function dispatch(request)
luci.util.updfenv(c.target, mod)
end
- stat, err = luci.util.copcall(c.target)
+ stat, err = luci.util.copcall(c.target, unpack(args))
if not stat then
error500(err)
end
@@ -430,8 +439,8 @@ function cbi(model)
require("luci.cbi")
require("luci.template")
- return function()
- local stat, maps = luci.util.copcall(luci.cbi.load, model)
+ return function(...)
+ local stat, maps = luci.util.copcall(luci.cbi.load, model, ...)
if not stat then
error500(maps)
return true