summaryrefslogtreecommitdiffhomepage
path: root/core/src/cbi.lua
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/cbi.lua')
-rw-r--r--core/src/cbi.lua20
1 files changed, 9 insertions, 11 deletions
diff --git a/core/src/cbi.lua b/core/src/cbi.lua
index 3384e5c38..8a623b62c 100644
--- a/core/src/cbi.lua
+++ b/core/src/cbi.lua
@@ -87,8 +87,11 @@ function Node.parse(self, ...)
end
-- Render this node
-function Node.render(self)
- ffluci.template.render(self.template, {self=self})
+function Node.render(self, scope)
+ scope = scope or {}
+ scope.self = self
+
+ ffluci.template.render(self.template, scope)
end
-- Render the children
@@ -453,13 +456,6 @@ function TypedSection.parse(self)
end
end
--- Render the children
-function TypedSection.render_children(self, section)
- for k, node in ipairs(self.children) do
- node:render(section)
- end
-end
-
-- Verifies scope of sections
function TypedSection.checkscope(self, section)
-- Check if we are not excluded
@@ -554,9 +550,11 @@ function AbstractValue.parse(self, section)
end
-- Render if this value exists or if it is mandatory
-function AbstractValue.render(self, s)
+function AbstractValue.render(self, s, scope)
if not self.optional or self:cfgvalue(s) or self:formcreated(s) then
- ffluci.template.render(self.template, {self=self, section=s})
+ scope = scope or {}
+ scope.section = s
+ Node.render(self, scope)
end
end