From 93c55f3c5d7d253423c9d5695b8d71388bd21988 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Sat, 22 Mar 2008 19:46:14 +0000 Subject: * CBI updates * Made dispatching paths unambiguous --- src/ffluci/cbi.lua | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/ffluci/cbi.lua') 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 -- cgit v1.2.3