* Fixed templates to be XHTML 1.1 compliant
[project/luci.git] / src / ffluci / view / cbi / tsection.htm
index 26f8b198e86bb65647d2231afb53a6b9e66a800c..ffeb91575b0f6abea3d1dc0301d538263fa624c3 100644 (file)
@@ -1,29 +1,32 @@
                                <div class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
                                        <h2><%=self.title%></h2>
                                        <div class="cbi-section-descr"><%=self.description%></div>
-<% for k, v in pairs(self:ucisections()) do%>
+<% for k, v in pairs(self:cfgsections()) do%>
+                                               <% if self.addremove then %><div class="cbi-section-remove right">
+                                                       <input type="submit" name="cbi.rts.<%=self.config%>.<%=k%>" value="<%:cbi_del Eintrag entfernen%>" />
+                                               </div><% end %>
+                                               <% if not self.anonymous then %><h3><%=k%></h3><% end %>
                                        <fieldset class="cbi-section-node" id="cbi-<%=self.config%>-<%=k%>">
-                                               <% if not self.anonymous then %><legend><%=k%></legend><% end %>
 <% self:render_children(k) %>
-                                               <% if #self.optionals > 0 or self.dynamic then %>
+                                               <% if #self.optionals[k] > 0 or self.dynamic then %>
                                                        <div class="cbi-optionals">
                                                        <% if self.dynamic then %>
                                                                <input type="text" name="cbi.opt.<%=self.config%>.<%=k%>" />
                                                        <% else %>
                                                                <select name="cbi.opt.<%=self.config%>.<%=k%>">
-                                                                       <option><%:cbi_selopt *** Zusätzliche Felder ***%></option>
-                                                               <% for key, val in pairs(self.optionals) do %>
-                                                                       <option value="<%=val.option%>"><%=val.title%></option>
+                                                                       <option><%:cbi_addopt -- Feld --%></option>
+                                                               <% for key, val in pairs(self.optionals[k]) do %>
+                                                                       <option id="cbi-<%=self.config.."-"..k.."-"..val.option%>" value="<%=val.option%>"><%=val.title%></option>
                                                                <% end %>
                                                                </select>
+                                                               <script type="text/javascript"><% for key, val in pairs(self.optionals[k]) do %>
+                                                                       <% if #val.deps > 0 then %><% for j, d in ipairs(val.deps) do %>cbi_d_add("cbi-<%=self.config.."-"..k.."-"..val.option%>", "cbid.<%=self.config.."."..k.."."..d.field%>", "<%=d.value%>");
+                                                               <% end %><% end %>
+                                                               <% end %></script>
                                                        <% end %>
-                                                               <input type="submit" value="<%:cbi_addopt Feld hinzufügen%>" />
+                                                               <input type="submit" value="<%:add hinzufügen%>" />
                                                        </div>
                                                <% end %>
-                                               <br />
-                                               <% if self.addremove then %>
-                                                       <input type="submit" name="cbi.rts.<%=self.config%>.<%=k%>" value="<%:cbi_del Eintrag entfernen%>" />
-                                               <% end %>
                                        </fieldset>
                                        <br />
 <% end %>