diff options
author | Steven Barth <steven@midlink.org> | 2008-03-22 19:46:14 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-03-22 19:46:14 +0000 |
commit | 93c55f3c5d7d253423c9d5695b8d71388bd21988 (patch) | |
tree | d2d8b9cc73f040cda24836afd2711edb5c8eefb6 /src/ffluci/cbi.lua | |
parent | c8426cfa3cce952dde8cdf2eb058d0c2fae4986d (diff) |
* CBI updates
* Made dispatching paths unambiguous
Diffstat (limited to 'src/ffluci/cbi.lua')
-rw-r--r-- | src/ffluci/cbi.lua | 23 |
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 |