From d26ceda459234aa239f43a3744181ddbe5a6adfe Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 7 Nov 2010 20:01:12 +0000 Subject: libs/web: support local destination in zonelist widget --- libs/web/luasrc/view/cbi/firewall_zonelist.htm | 28 +++++++++++++++++--------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'libs/web/luasrc/view/cbi') diff --git a/libs/web/luasrc/view/cbi/firewall_zonelist.htm b/libs/web/luasrc/view/cbi/firewall_zonelist.htm index 891c70e77a..037b750814 100644 --- a/libs/web/luasrc/view/cbi/firewall_zonelist.htm +++ b/libs/web/luasrc/view/cbi/firewall_zonelist.htm @@ -21,23 +21,31 @@ $Id$ local zone, net, iface local zones = fwm:get_zones() local value = self:formvalue(section) - if not value or value == "-" then value = self:cfgvalue(section) or self.default end + 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 - elseif type(value) == "table" then - for _, value in ipairs(value) do - checked[value] = true - end - elseif value then + for value in utl.imatch(value) do checked[value] = true end + + if not next(checked) then + checked[""] = true + end -%>