diff options
author | Christian Schoenebeck <christian.schoenebeck@gmail.com> | 2015-10-31 23:09:40 +0100 |
---|---|---|
committer | Christian Schoenebeck <christian.schoenebeck@gmail.com> | 2015-10-31 23:09:40 +0100 |
commit | 162548a8795252d6383407744cb1311727684522 (patch) | |
tree | 7a62108fef3632a77668eae880b3b0a5bf0dc1fa /modules/luci-base/luasrc/cbi.lua | |
parent | c7d3619b0ca0a05251ddbfff0c49f45247346de2 (diff) |
cbi.lua: Implement "readonly" property for "Value"
cbi.lua: Implement "readonly" property for "Value"
Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
Diffstat (limited to 'modules/luci-base/luasrc/cbi.lua')
-rw-r--r-- | modules/luci-base/luasrc/cbi.lua | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/luci-base/luasrc/cbi.lua b/modules/luci-base/luasrc/cbi.lua index 1aa00eed9..b5b2c8d8f 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) |