2 if type(self.hidden) == "table" then
3 for k, v in pairs(self.hidden) do
5 <input type="hidden" id="<%=k%>" name="<%=k%>" value="<%=pcdata(v)%>" />
11 <% if self.tabs then %>
14 <% self:render_children(section, scope or {}) %>
17 <% if self.error and self.error[section] then -%>
18 <div class="cbi-section-error" data-index="<%=#self.children + 1%>">
19 <ul><% for _, e in ipairs(self.error[section]) do -%>
21 <%- if e == "invalid" then -%>
22 <%:One or more fields contain invalid values!%>
23 <%- elseif e == "missing" then -%>
24 <%:One or more required fields have no value!%>
33 <% if self.optionals[section] and #self.optionals[section] > 0 or self.dynamic then %>
34 <div class="cbi-optionals" data-index="<%=#self.children + 1%>">
35 <% if self.dynamic then %>
36 <input type="text" id="cbi.opt.<%=self.config%>.<%=section%>" name="cbi.opt.<%=self.config%>.<%=section%>" />
37 <% if self.optionals[section] and #self.optionals[section] > 0 then %>
38 <script type="text/javascript">
39 cbi_combobox_init('cbi.opt.<%=self.config%>.<%=section%>', {
41 for i, val in pairs(self.optionals[section]) do
43 <%-=string.format("%q", val.option) .. ":" .. string.format("%q", striptags(val.title))-%>
44 <%-if next(self.optionals[section], i) then-%>,<%-end-%>
48 }, '', '<%-: -- custom -- -%>');
52 <select id="cbi.opt.<%=self.config%>.<%=section%>" name="cbi.opt.<%=self.config%>.<%=section%>" data-optionals="true">
53 <option><%: -- Additional Field -- %></option>
54 <% for key, val in pairs(self.optionals[section]) do -%>
55 <option id="cbi-<%=self.config.."-"..section.."-"..val.option%>" value="<%=val.option%>" data-index="<%=val.index%>" data-depends="<%=pcdata(val:deplist2json(section))%>"><%=striptags(val.title)%></option>
59 <input type="submit" class="cbi-button cbi-button-fieldadd" value="<%:Add%>" />