* CBI updates
[project/luci.git] / src / ffluci / cbi.lua
index 5a20aadc53765dd01a9b5240d50e6802ac2c25ed..85b9f49e9dc56b46f8ce4614c1f883cff0094800 100644 (file)
@@ -86,6 +86,12 @@ function Node.render(self)
        ffluci.template.render(self.template, {self=self})
 end
 
+function Node.render_children(self)
+       for k, node in ipairs(self.children) do
+               node:render()
+       end
+end
+
 
 --[[
 Map - A map describing a configuration file 
@@ -175,6 +181,23 @@ function TypedSection.__init__(self, ...)
        self.valid     = nil
 end
 
+function TypedSection.render_children(self, section)
+       for k, node in ipairs(self.children) do
+               node.section = section
+               node:render()
+       end
+end
+
+function TypedSection.ucisections(self)
+       local sections = {}
+       for k, v in pairs(self.map:read()) do
+               if v[".type"] == self.sectiontype then
+                       sections[k] = v
+               end
+       end
+       return sections 
+end
+
 
 --[[
 AbstractValue - An abstract Value Type