summaryrefslogtreecommitdiffhomepage
path: root/src/ffluci/cbi.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/ffluci/cbi.lua')
-rw-r--r--src/ffluci/cbi.lua23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/ffluci/cbi.lua b/src/ffluci/cbi.lua
index 5a20aadc53..85b9f49e9d 100644
--- a/src/ffluci/cbi.lua
+++ b/src/ffluci/cbi.lua
@@ -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