From c7d3619b0ca0a05251ddbfff0c49f45247346de2 Mon Sep 17 00:00:00 2001 From: Christian Schoenebeck Date: Sat, 31 Oct 2015 22:54:25 +0100 Subject: template cbi/value.htm: add "readonly" property template cbi/value.htm: add "readonly" property Signed-off-by: Christian Schoenebeck --- modules/luci-base/luasrc/view/cbi/value.htm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/luci-base') diff --git a/modules/luci-base/luasrc/view/cbi/value.htm b/modules/luci-base/luasrc/view/cbi/value.htm index d1a7bea5c6..6e05206aa1 100644 --- a/modules/luci-base/luasrc/view/cbi/value.htm +++ b/modules/luci-base/luasrc/view/cbi/value.htm @@ -1,7 +1,7 @@ <%+cbi/valueheader%> /> <% if self.password then %><% end %> <% if #self.keylist > 0 or self.datatype then -%> -- cgit v1.2.3 From 162548a8795252d6383407744cb1311727684522 Mon Sep 17 00:00:00 2001 From: Christian Schoenebeck Date: Sat, 31 Oct 2015 23:09:40 +0100 Subject: cbi.lua: Implement "readonly" property for "Value" cbi.lua: Implement "readonly" property for "Value" Signed-off-by: Christian Schoenebeck --- modules/luci-base/luasrc/cbi.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules/luci-base') 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) -- cgit v1.2.3