(no commit message)
[project/luci.git] / core / src / ffluci / view / cbi / mvalue.htm
1 <%
2 local v = self:valuelist(section)       
3 %>
4 <%+cbi/valueheader%>
5 <% if self.widget == "select" then %>
6                                                                 <select multiple="multiple" name="cbid.<%=self.config.."."..section.."."..self.option%>[]"<% if self.size then %> size="<%=self.size%>"<% end %>>
7 <%for i, key in pairs(self.keylist) do %>
8                                                                         <option<% if ffluci.util.contains(v, key) then %> selected="selected"<% end %> value="<%=key%>"><%=self.vallist[i]%></option>
9 <% end %>
10                                                                 </select>
11 <% elseif self.widget == "checkbox" then
12         local c = 0;
13         for i, key in pairs(self.keylist) do
14         c = c + 1%>
15                                                                 <%=self.vallist[i]%><input type="checkbox" name="cbid.<%=self.config.."."..section.."."..self.option%>[]"<% if ffluci.util.contains(v, key) then %> checked="checked"<% end %> value="<%=key%>" />
16 <% if c == self.size then c = 0 %><br />
17 <% end end %>
18 <% end %>
19 <%+cbi/valuefooter%>