diff options
Diffstat (limited to 'libs/web')
-rw-r--r-- | libs/web/luasrc/dispatcher.lua | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/libs/web/luasrc/dispatcher.lua b/libs/web/luasrc/dispatcher.lua index cd481622b8..e3d8ac0d48 100644 --- a/libs/web/luasrc/dispatcher.lua +++ b/libs/web/luasrc/dispatcher.lua @@ -293,20 +293,29 @@ function createtree() built_tree = true end --- Shortcut for creating a dispatching node -function entry(path, target, title, order, add) - add = add or {} +-- Reassigns a node to another position +function assign(path, clone, title, order) + local obj = node(path) + obj.nodes = nil + obj.module = nil + + obj.title = title + obj.order = order + + setmetatable(obj, {__index = clone}) + + return obj +end +-- Shortcut for creating a dispatching node +function entry(path, target, title, order) local c = node(path) + c.target = target c.title = title c.order = order c.module = getfenv(2)._NAME - for k,v in pairs(add) do - c[k] = v - end - return c end |