* luci/core: cbi.lua: NamedSection and TypedSection take different numbers of arguments, move i18n init to corresponding constructors

This commit is contained in:
Jo-Philipp Wich 2008-06-01 18:34:13 +00:00
parent 633692fc68
commit e95d152b3d

View file

@ -156,12 +156,9 @@ function Map.parse(self, ...)
end end
-- Creates a child section -- Creates a child section
function Map.section(self, class, section, ...) function Map.section(self, class, ...)
if instanceof(class, AbstractSection) then if instanceof(class, AbstractSection) then
local obj = class(self, section, ...) local obj = class(self, ...)
Node._i18n(obj, self.config, section, nil, ...)
self:append(obj) self:append(obj)
return obj return obj
else else
@ -338,10 +335,11 @@ NamedSection - A fixed configuration section defined by its name
]]-- ]]--
NamedSection = class(AbstractSection) NamedSection = class(AbstractSection)
function NamedSection.__init__(self, map, section, ...) function NamedSection.__init__(self, map, section, type, ...)
AbstractSection.__init__(self, map, ...) AbstractSection.__init__(self, map, type, ...)
self.template = "cbi/nsection" Node._i18n(self, map.config, section, nil, ...)
self.template = "cbi/nsection"
self.section = section self.section = section
self.addremove = false self.addremove = false
end end
@ -384,8 +382,10 @@ TypedSection - A (set of) configuration section(s) defined by the type
]]-- ]]--
TypedSection = class(AbstractSection) TypedSection = class(AbstractSection)
function TypedSection.__init__(self, ...) function TypedSection.__init__(self, map, type, ...)
AbstractSection.__init__(self, ...) AbstractSection.__init__(self, map, type, ...)
Node._i18n(self, map.config, type, nil, ...)
self.template = "cbi/tsection" self.template = "cbi/tsection"
self.deps = {} self.deps = {}
self.excludes = {} self.excludes = {}