cbi.lua: Implement "readonly" property for "Value"
cbi.lua: Implement "readonly" property for "Value" Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
This commit is contained in:
parent
c7d3619b0c
commit
162548a879
1 changed files with 5 additions and 0 deletions
|
@ -1471,6 +1471,7 @@ function Value.__init__(self, ...)
|
||||||
self.template = "cbi/value"
|
self.template = "cbi/value"
|
||||||
self.keylist = {}
|
self.keylist = {}
|
||||||
self.vallist = {}
|
self.vallist = {}
|
||||||
|
self.readonly = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
function Value.reset_values(self)
|
function Value.reset_values(self)
|
||||||
|
@ -1484,6 +1485,10 @@ function Value.value(self, key, val)
|
||||||
table.insert(self.vallist, tostring(val))
|
table.insert(self.vallist, tostring(val))
|
||||||
end
|
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 - This does nothing except being there
|
||||||
DummyValue = class(AbstractValue)
|
DummyValue = class(AbstractValue)
|
||||||
|
|
Loading…
Reference in a new issue