From d26ceda459234aa239f43a3744181ddbe5a6adfe Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 7 Nov 2010 20:01:12 +0000 Subject: [PATCH] libs/web: support local destination in zonelist widget --- .../web/luasrc/view/cbi/firewall_zonelist.htm | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/libs/web/luasrc/view/cbi/firewall_zonelist.htm b/libs/web/luasrc/view/cbi/firewall_zonelist.htm index 891c70e77..037b75081 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 -%>