summaryrefslogtreecommitdiffhomepage
path: root/src/ffluci/view/cbi/mvalue.htm
blob: 7becb4f48b155dff858acc9bde8aa29c19b6cb29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<%
local v = self:valuelist(section)	
%>
						<div class="cbi-value" id="cbi-<%=self.config.."-"..section.."-"..self.option%>">
							<div class="cbi-value-title left"><%=self.title%></div>
							<div class="cbi-value-field">
<% if self.widget == "select" then %>
								<select multiple="multiple" name="cbid.<%=self.config.."."..section.."."..self.option%>[]"<% if self.size then %> size="<%=self.size%>"<% end %>>
<%for i, key in pairs(self.keylist) do %>
									<option<% if ffluci.util.contains(v, key) then %> selected="selected"<% end %> value="<%=key%>"><%=self.vallist[i]%></option>
<% end %>
								</select>
<% elseif self.widget == "checkbox" then
	local c = 0;
	for i, key in pairs(self.keylist) do
	c = c + 1%>
								<%=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%>" />
<% if c == self.size then c = 0 %><br />
<% end end %>
<% end %>
								<div class="cbi-value-description inline"><%=self.description%></div>
							</div>
						</div>
						<% if #self.deps > 0 then %><script type="text/javascript">
							<% for j, d in ipairs(self.deps) do %>cbi_d_add("cbi-<%=self.config.."-"..section.."-"..self.option%>", "cbid.<%=self.config.."."..section.."."..d.field%>", "<%=d.value%>");
							<% end %>
						</script><% end %>