From: Steven Barth Date: Sun, 7 Sep 2008 23:03:05 +0000 (+0000) Subject: libs/cbi: Fixed DynamicLists X-Git-Tag: 0.9.0~1381 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2590722de0a23456aa029c8db551964c7595eccd;p=oweals%2Fluci.git libs/cbi: Fixed DynamicLists --- diff --git a/libs/cbi/luasrc/cbi.lua b/libs/cbi/luasrc/cbi.lua index 3e7209781..30727cef2 100644 --- a/libs/cbi/luasrc/cbi.lua +++ b/libs/cbi/luasrc/cbi.lua @@ -1227,7 +1227,7 @@ function StaticList.validate(self, value) local valid = {} for i, v in ipairs(value) do - if luci.util.contains(self.valuelist, v) then + if luci.util.contains(self.vallist, v) then table.insert(valid, v) end end diff --git a/libs/cbi/luasrc/view/cbi/dynlist.htm b/libs/cbi/luasrc/view/cbi/dynlist.htm index 1368872d9..1d28f95d9 100644 --- a/libs/cbi/luasrc/view/cbi/dynlist.htm +++ b/libs/cbi/luasrc/view/cbi/dynlist.htm @@ -13,13 +13,14 @@ $Id$ -%> <%+cbi/valueheader%> +<% local vals = self:cfgvalue(section) for i=1, #vals + 1 do local val = vals[i] %> - /> + /> <% if i <= #vals then %> - " alt="<%:cbi_del%>" title="<%:cbi_del%>" src="<%=resource%>/cbi/remove.gif" /> + " alt="<%:cbi_del%>" title="<%:cbi_del%>" src="<%=resource%>/cbi/remove.gif" /> <% else %> " alt="<%:cbi_add%>" title="<%:cbi_add%>" src="<%=resource%>/cbi/add.gif" /> <% end %>