summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2008-06-01 18:34:13 +0000
committerJo-Philipp Wich <jow@openwrt.org>2008-06-01 18:34:13 +0000
commite95d152b3d7dc0fcc48ffe039bf61570d5eac161 (patch)
tree318a01364fe22c469d573627583c4f80013c1807
parent633692fc6891309609f1e9be810ff4d0409870b8 (diff)
* luci/core: cbi.lua: NamedSection and TypedSection take different numbers of arguments, move i18n init to corresponding constructors
-rw-r--r--libs/cbi/luasrc/cbi.lua20
1 files changed, 10 insertions, 10 deletions
diff --git a/libs/cbi/luasrc/cbi.lua b/libs/cbi/luasrc/cbi.lua
index 31fa8bffb4..c8c810c04b 100644
--- a/libs/cbi/luasrc/cbi.lua
+++ b/libs/cbi/luasrc/cbi.lua
@@ -156,12 +156,9 @@ function Map.parse(self, ...)
end
-- Creates a child section
-function Map.section(self, class, section, ...)
+function Map.section(self, class, ...)
if instanceof(class, AbstractSection) then
- local obj = class(self, section, ...)
-
- Node._i18n(obj, self.config, section, nil, ...)
-
+ local obj = class(self, ...)
self:append(obj)
return obj
else
@@ -338,10 +335,11 @@ NamedSection - A fixed configuration section defined by its name
]]--
NamedSection = class(AbstractSection)
-function NamedSection.__init__(self, map, section, ...)
- AbstractSection.__init__(self, map, ...)
+function NamedSection.__init__(self, map, section, type, ...)
+ AbstractSection.__init__(self, map, type, ...)
+ Node._i18n(self, map.config, section, nil, ...)
+
self.template = "cbi/nsection"
-
self.section = section
self.addremove = false
end
@@ -384,8 +382,10 @@ TypedSection - A (set of) configuration section(s) defined by the type
]]--
TypedSection = class(AbstractSection)
-function TypedSection.__init__(self, ...)
- AbstractSection.__init__(self, ...)
+function TypedSection.__init__(self, map, type, ...)
+ AbstractSection.__init__(self, map, type, ...)
+ Node._i18n(self, map.config, type, nil, ...)
+
self.template = "cbi/tsection"
self.deps = {}
self.excludes = {}