+--- Get an associated section object.
+-- @param s Section to select
+-- @return Section instance
+function scheme.section(self, s)
+ local so = luci.uvl.section( self.s, self.c, self.cref[1], s )
+ so.p = self
+
+ return so
+end
+
+
+--- Object representation of a config.
+-- @class config
+-- @cstyle instance
+-- @name luci.uvl.config
+
+--- Config instance constructor.
+-- @class function
+-- @name config
+-- @param scheme Scheme instance
+-- @param co Configuration data
+-- @param c Configuration name
+-- @return Config instance
+config = luci.util.class(uvlitem)
+
+function config.__init__(self, scheme, co, c)
+ if not c then
+ c, co = co, nil
+ end
+
+ if not co then
+ local uci = luci.model.uci.cursor()
+ co = uci:get_all(c)
+ end
+
+ self.cref = { c }
+ self.sref = { c }
+ self.c = co
+ self.s = scheme
+ self.t = luci.uvl.TYPE_CONFIG
+end
+
+--- Get all section objects associated with this config.
+-- @return Table containing all associated luci.uvl.section instances
+function config.sections(self)
+ local v = { }
+ if self.s.packages[self.sref[1]].sections then
+ for o, _ in pairs( self.s.packages[self.sref[1]].sections ) do
+ table.insert( v, luci.uvl.option(
+ self.s, self.c, self.cref[1], self.cref[2], o
+ ) )
+ end
+ end
+ return v
+end
+
+--- Get an associated section object.
+-- @param s Section to select
+-- @return Section instance
+function config.section(self, s)
+ local so = luci.uvl.section( self.s, self.c, self.cref[1], s )
+ so.p = self
+
+ return so
+end
+
+
+--- Object representation of a scheme/config section.
+-- @class module
+-- @cstyle instance
+-- @name luci.uvl.section
+
+--- Section instance constructor.
+-- @class function
+-- @name section
+-- @param scheme Scheme instance
+-- @param co Configuration data
+-- @param c Configuration name
+-- @param s Section name
+-- @return Section instance
+section = luci.util.class(uvlitem)
+
+function section.__init__(self, scheme, co, c, s)
+ self.cref = { c, s }
+ self.sref = { c, co[s] and co[s]['.type'] or s }
+ self.c = co
+ self.s = scheme
+ self.t = luci.uvl.TYPE_SECTION