diff options
author | Jo-Philipp Wich <jo@mein.io> | 2018-11-27 14:46:55 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2018-11-27 14:46:55 +0100 |
commit | 2e36e09303c9b0054d1ead830d841ae170197db7 (patch) | |
tree | b602f9c547bd604afe85b9b5786fb19052490a94 /modules/luci-base | |
parent | 9cd5f6befdbc1011c10da309940fe7efa73f8fc3 (diff) |
luci-base: dispatcher: remove tree modifier support
This feature was never used, is hardly documented and appears to be
designed to fiddle with the internal dispatch tree state.
Given that, simply drop the related code to simplify the dispatcher
class somewhat.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base')
-rw-r--r-- | modules/luci-base/luasrc/dispatcher.lua | 21 | ||||
-rw-r--r-- | modules/luci-base/luasrc/dispatcher.luadoc | 9 |
2 files changed, 0 insertions, 30 deletions
diff --git a/modules/luci-base/luasrc/dispatcher.lua b/modules/luci-base/luasrc/dispatcher.lua index c4066a2592..9d6f586b1d 100644 --- a/modules/luci-base/luasrc/dispatcher.lua +++ b/modules/luci-base/luasrc/dispatcher.lua @@ -595,11 +595,9 @@ function createtree() local ctx = context local tree = {nodes={}, inreq=true} - local modi = {} ctx.treecache = setmetatable({}, {__mode="v"}) ctx.tree = tree - ctx.modifiers = modi local scope = setmetatable({}, {__index = luci.dispatcher}) @@ -609,28 +607,9 @@ function createtree() v() end - local function modisort(a,b) - return modi[a].order < modi[b].order - end - - for _, v in util.spairs(modi, modisort) do - scope._NAME = v.module - setfenv(v.func, scope) - v.func() - end - return tree end -function modifier(func, order) - context.modifiers[#context.modifiers+1] = { - func = func, - order = order or 0, - module - = getfenv(2)._NAME - } -end - function assign(path, clone, title, order) local obj = node(unpack(path)) obj.nodes = nil diff --git a/modules/luci-base/luasrc/dispatcher.luadoc b/modules/luci-base/luasrc/dispatcher.luadoc index f26256953a..a77f8d8b07 100644 --- a/modules/luci-base/luasrc/dispatcher.luadoc +++ b/modules/luci-base/luasrc/dispatcher.luadoc @@ -82,15 +82,6 @@ Build the index before if it does not exist yet. ]] ---[[ -Register a tree modifier. - -@class function -@name modifier -@param func Modifier function -@param order Modifier order value (optional) -]] - ----[[ Clone a node of the dispatching tree to another position. @class function |