summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--libs/web/luasrc/dispatcher.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/libs/web/luasrc/dispatcher.lua b/libs/web/luasrc/dispatcher.lua
index 735e2a7150..756f3cc7d5 100644
--- 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
+-- 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