projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ced11a4
)
libs/web: Added luci.web.dispatcher.registered
author
Steven Barth
<steven@midlink.org>
Wed, 16 Jul 2008 07:26:36 +0000
(07:26 +0000)
committer
Steven Barth
<steven@midlink.org>
Wed, 16 Jul 2008 07:26:36 +0000
(07:26 +0000)
libs/web/luasrc/dispatcher.lua
patch
|
blob
|
history
diff --git
a/libs/web/luasrc/dispatcher.lua
b/libs/web/luasrc/dispatcher.lua
index
735e2a7
..
756f3cc
100644
(file)
--- a/
libs/web/luasrc/dispatcher.lua
+++ b/
libs/web/luasrc/dispatcher.lua
@@
-324,6
+324,20
@@
function entry(path, target, title, order)
return c
end
return c
end
+-- Checks whether a node exists
+function registered(...)
+ local c = context.tree
+
+ for k,v in ipairs(arg) do
+ if not c.nodes[v] then
+ return false
+ end
+
+ c = c.nodes[v]
+ end
+ return true
+end
+
-- Fetch a dispatching node
function node(...)
local c = context.tree
-- Fetch a dispatching node
function node(...)
local c = context.tree