* Moved Freifunk status pages to admin-core and linked them in Freifunk
[project/luci.git] / libs / web / luasrc / dispatcher.lua
index cd48162..e3d8ac0 100644 (file)
@@ -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