diff options
author | Steven Barth <steven@midlink.org> | 2008-07-15 13:17:28 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-07-15 13:17:28 +0000 |
commit | d0a622dce8163cb1f9d0a178127b7abda6c4e818 (patch) | |
tree | 44b1b5d8d01f98c24bdc0c378af5cf6004220d96 /libs/cbi/luasrc | |
parent | 97ff4a156ff1aa6a4d2ab65ab13d12b4eb2651e2 (diff) |
lib/cbi: Added support for multiple CBI maps per model
Diffstat (limited to 'libs/cbi/luasrc')
-rw-r--r-- | libs/cbi/luasrc/cbi.lua | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libs/cbi/luasrc/cbi.lua b/libs/cbi/luasrc/cbi.lua index 6e0845565..7370a04c4 100644 --- a/libs/cbi/luasrc/cbi.lua +++ b/libs/cbi/luasrc/cbi.lua @@ -57,14 +57,16 @@ function load(cbimap) luci.util.extfenv(func, "translate", luci.i18n.translate) luci.util.extfenv(func, "translatef", luci.i18n.translatef) - local map = func() + local maps = {func()} - if not instanceof(map, Map) then - error("CBI map returns no valid map object!") - return nil + for i, map in ipairs(maps) do + if not instanceof(map, Map) then + error("CBI map returns no valid map object!") + return nil + end end - return map + return maps end -- Node pseudo abstract class |