From: Christian Schoenebeck Date: Sat, 31 Oct 2015 22:09:40 +0000 (+0100) Subject: cbi.lua: Implement "readonly" property for "Value" X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=refs%2Fpull%2F529%2Fhead;p=project%2Fluci.git cbi.lua: Implement "readonly" property for "Value" cbi.lua: Implement "readonly" property for "Value" Signed-off-by: Christian Schoenebeck --- diff --git a/modules/luci-base/luasrc/cbi.lua b/modules/luci-base/luasrc/cbi.lua index 1aa00eed9e..b5b2c8d8f2 100644 --- a/modules/luci-base/luasrc/cbi.lua +++ b/modules/luci-base/luasrc/cbi.lua @@ -1471,6 +1471,7 @@ function Value.__init__(self, ...) self.template = "cbi/value" self.keylist = {} self.vallist = {} + self.readonly = nil end function Value.reset_values(self) @@ -1484,6 +1485,10 @@ function Value.value(self, key, val) table.insert(self.vallist, tostring(val)) end +function Value.parse(self, section, novld) + if self.readonly then return end + AbstractValue.parse(self, section, novld) +end -- DummyValue - This does nothing except being there DummyValue = class(AbstractValue)