From d0a622dce8163cb1f9d0a178127b7abda6c4e818 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Tue, 15 Jul 2008 13:17:28 +0000 Subject: lib/cbi: Added support for multiple CBI maps per model --- libs/cbi/luasrc/cbi.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'libs/cbi') diff --git a/libs/cbi/luasrc/cbi.lua b/libs/cbi/luasrc/cbi.lua index 6e08455655..7370a04c46 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 -- cgit v1.2.3