diff options
author | Steven Barth <steven@midlink.org> | 2008-06-02 20:16:05 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-06-02 20:16:05 +0000 |
commit | 561b0cfaa3fb8163d9ec74a3f96fd5b22ad54f33 (patch) | |
tree | 8b4b1765c70bae824bbad3006021cf7a4a775a34 /libs | |
parent | 953510ccac9b9c6b3c1d8634897c0dddc92913e4 (diff) |
* Moved Freifunk status pages to admin-core and linked them in Freifunk
* luci/web: Added assign() to dispatcher to reference foreign nodes in the dispatching tree
Diffstat (limited to 'libs')
-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 cd481622b..e3d8ac0d4 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 |