From: Jo-Philipp Wich Date: Tue, 27 Oct 2009 21:42:40 +0000 (+0000) Subject: libs/cbi: fixes for widget templates X-Git-Tag: 0.10.0~1060 X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=bec91e4cafbe830e96cb9a3b3199d5c75da3c011 libs/cbi: fixes for widget templates --- diff --git a/libs/cbi/luasrc/view/cbi/firewall_zonelist.htm b/libs/cbi/luasrc/view/cbi/firewall_zonelist.htm index 199d9ac9a..94186954d 100644 --- a/libs/cbi/luasrc/view/cbi/firewall_zonelist.htm +++ b/libs/cbi/luasrc/view/cbi/firewall_zonelist.htm @@ -20,38 +20,60 @@ $Id$ local zone, net, iface local zones = fwm:get_zones() - local value = self:cfgvalue(section) or self.default + local value = self:formvalue(section) + if not value or value == "-" then value = self:cfgvalue(section) or self.default end + local selected = false + local checked = { } - if value and #value == 0 then value = nil end + if value and #value == 0 then + value = nil + elseif type(value) == "table" then + for _, value in ipairs(value) do + checked[value] = true + end + elseif value then + checked[value] = true + end -%> -