X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=libs%2Fweb%2Fluasrc%2Fview%2Fcbi%2Ffirewall_zonelist.htm;h=037b750814fd2bbef2b4ac27389b491589468782;hp=4f4106b87a5182bee0131c2d7c813faeb8d29d84;hb=d26ceda459234aa239f43a3744181ddbe5a6adfe;hpb=ede4aca4b95c9e664e4830fd43c54b627b122538;ds=sidebyside diff --git a/libs/web/luasrc/view/cbi/firewall_zonelist.htm b/libs/web/luasrc/view/cbi/firewall_zonelist.htm index 4f4106b87..037b75081 100644 --- a/libs/web/luasrc/view/cbi/firewall_zonelist.htm +++ b/libs/web/luasrc/view/cbi/firewall_zonelist.htm @@ -15,29 +15,37 @@ $Id$ <%- local utl = require "luci.util" - local fwm = require "luci.model.firewall" - local nwm = require "luci.model.network" + local fwm = require "luci.model.firewall".init() + local nwm = require "luci.model.network".init() 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 - checked[value] = true + for value in utl.imatch(value) do + checked[value] = true + end + + if not next(checked) then + checked[""] = true end -%>