2016-02-10 18:33:01 +00:00
|
|
|
<%
|
|
|
|
local i, key
|
|
|
|
local v = self:valuelist(section) or {}
|
|
|
|
-%>
|
|
|
|
|
2008-04-11 18:29:19 +00:00
|
|
|
<%+cbi/valueheader%>
|
|
|
|
<% if self.widget == "select" then %>
|
2016-02-10 18:33:01 +00:00
|
|
|
<select class="cbi-input-select" multiple="multiple" data-update="click change"<%=
|
|
|
|
attr("id", cbid) ..
|
|
|
|
attr("name", cbid) ..
|
|
|
|
ifattr(self.size, "size")
|
|
|
|
%>>
|
|
|
|
<% for i, key in pairs(self.keylist) do -%>
|
|
|
|
<option<%=
|
|
|
|
attr("id", cbid.."-"..key) ..
|
|
|
|
attr("value", key) ..
|
|
|
|
attr("data-index", i) ..
|
|
|
|
attr("data-depends", self:deplist2json(section, self.deplist[i])) ..
|
|
|
|
ifattr(luci.util.contains(v, key), "selected", "selected")
|
|
|
|
%>><%=pcdata(self.vallist[i])%></option>
|
|
|
|
<%- end %>
|
2008-07-15 17:27:58 +00:00
|
|
|
</select>
|
2016-02-10 18:33:01 +00:00
|
|
|
<% elseif self.widget == "checkbox" then %>
|
2016-02-23 08:27:12 +00:00
|
|
|
<div>
|
2016-02-10 18:33:01 +00:00
|
|
|
<% for i, key in pairs(self.keylist) do %>
|
|
|
|
<label<%=
|
|
|
|
attr("data-index", i) ..
|
|
|
|
attr("data-depends", self:deplist2json(section, self.deplist[i]))
|
|
|
|
%>>
|
|
|
|
<input class="cbi-input-checkbox" type="checkbox" data-update="click change"<%=
|
2016-03-03 21:06:39 +00:00
|
|
|
attr("id", cbid.."-"..key) ..
|
2016-02-10 18:33:01 +00:00
|
|
|
attr("name", cbid) ..
|
|
|
|
attr("value", key) ..
|
|
|
|
ifattr(luci.util.contains(v, key), "checked", "checked")
|
|
|
|
%> />
|
2016-03-03 21:06:39 +00:00
|
|
|
<label<%= attr("for", cbid.."-"..key)%>></label>
|
2016-02-10 18:33:01 +00:00
|
|
|
<%=pcdata(self.vallist[i])%>
|
|
|
|
</label>
|
2017-01-25 23:07:26 +00:00
|
|
|
<% if self.size and (i % self.size) == 0 then write('<br />') end %>
|
2016-02-10 18:33:01 +00:00
|
|
|
<% end %>
|
|
|
|
</div>
|
2008-04-11 18:29:19 +00:00
|
|
|
<% end %>
|
2008-07-15 15:59:46 +00:00
|
|
|
<%+cbi/valuefooter%>
|