make use of the new features in the binding for uci v0.4.0 - fixes remaining dependen...
[project/luci.git] / themes / openwrt.org / luasrc / view / themes / openwrt.org / header.htm
index 2ab67ec..71328e4 100644 (file)
@@ -73,9 +73,12 @@ local function submenu(prefix, node)
 %>
        <ul>
        <% for j, v in pairs(index) do 
-               local nnode = node.nodes[v.name]%>
+               local nnode = node.nodes[v.name]
+               local href = controller .. prefix .. v.name
+               href = (v.query) and href .. luci.http.build_querystring(v.query) or href
+               %>
                <li>
-                       <span<% if nnode._menu_selected then %> class="blacktext"<%end%>><a href="<%=controller .. prefix .. v.name%>"><%=nnode.title%></a></span>
+                       <span<% if nnode._menu_selected then %> class="blacktext"<%end%>><a href="<%=href%>"><%=nnode.title%></a></span>
                        <% submenu(prefix .. v.name .. "/", nnode) %>
                </li>
        <% end %>
@@ -93,8 +96,10 @@ if cattree and cattree.nodes then
 
        for i, k in ipairs(index) do
                node = cattree.nodes[k.name]
-               if node.title then %>
-                       <div<% if node._menu_selected then %> class="blacktext"<%end%>><a href="<%=controller%>/<%=category%>/<%=k.name%>"><%=node.title%></a>                  
+               if node.title then
+                       local href = controller.."/"..category.."/"..k.name
+                       href = (k.query) and href .. luci.http.build_querystring(k.query) or href %>
+                       <div<% if node._menu_selected then %> class="blacktext"<%end%>><a href="<%=href%>"><%=node.title%></a>                  
                                <%submenu("/" .. category .. "/" .. k.name .. "/", node)%>
                        </div>
 <%             end
@@ -115,9 +120,11 @@ end
                <%
                        if "admin" == request[1] then
                                require("luci.model.uci") 
-                               local ucic = luci.model.uci.changes()
-                               if ucic then
-                                       ucic = #luci.util.split(ucic)
+                               local ucic = 0
+                               for n, s in pairs(luci.model.uci.changes()) do
+                                       for no, o in pairs(s) do
+                                               ucic = ucic + 1;
+                                       end
                                end
                %>
                <div><%:config Konfiguration%>
@@ -133,4 +140,4 @@ end
                </div>
                <% end %>
        </div>
-       <div id="content">
\ No newline at end of file
+       <div id="content">