+
- <%:navigation Navigation%>
+-
<%-
local function submenu(prefix, node)
if not node.nodes or node.hidden then
@@ -110,21 +88,23 @@ local function submenu(prefix, node)
if count > 0 then
%>
-
- - class="active"<%end%>><%=nnode.title%> - <%- submenu(prefix .. v.name .. "/", nnode) %> - - <%- end %> - <%- end %> -
- class="active"<%end%> href="<%=luci.util.pcdata(href)%>"><%=nnode.title%><%- +submenu(prefix .. v.name .. "/", nnode) +%> <%- + end + end +%> +
- class="preactive"<%end%> href="<%=href%>"><%=node.title%><% +submenu("/" .. category .. "/" .. k.name .. "/", node) +%> <% end + end +end +%> +
-
- <%- for j, v in pairs(index) do
- if #v.name > 0 then
- local nnode = node.nodes[v.name]
- local href = controller .. prefix .. v.name
- href = (nnode.query) and href .. luci.http.build_querystring(nnode.query) or href
- %>
-
- ">
+<%-
+ for j, v in pairs(index) do
+ if #v.name > 0 then
+ local nnode = node.nodes[v.name]
+ local href = controller .. prefix .. v.name .. "/"
+ href = (nnode.query) and href .. luci.http.build_querystring(nnode.query) or href
+%>
+
class="preactive"<%end%>><%=node.title%>
- <%submenu("/" .. category .. "/" .. k.name .. "/", node)%>
-
-<% end
+ local href = controller.."/"..category.."/"..k.name.."/"
+ href = (k.query) and href .. luci.http.build_querystring(k.query) or href
+%>
+- <%
+for k,node in pairs(tree.nodes) do
+ if node.title and not node.hidden then %>
+
- class="active"<%end%> href="<%=controller%>/<%=k%>/"><%=node.title%> <% end end %> -
-
-
- <%
- if tree.nodes[category] and tree.nodes[category].ucidata then
- local ucic = 0
- require("luci.model.uci")
- luci.model.uci.set_savedir(luci.model.uci.savedir_default)
- for i, j in pairs(luci.model.uci.changes()) do
- for k, l in pairs(j) do
- for m, n in pairs(l) do
- ucic = ucic + 1;
- end
- end
+
+
+<%
+if tree.nodes[category] and tree.nodes[category].ucidata then
+ local ucic = 0
+ for i, j in pairs(require("luci.model.uci").cursor():changes()) do
+ for k, l in pairs(j) do
+ for m, n in pairs(l) do
+ ucic = ucic + 1;
end
- %>
- - <%
- for k,node in pairs(tree.nodes) do
- if node.title and not node.hidden then %>
-
- class="active"<%end%>><%=node.title%> -<% end - end%> -
-
- <% end %>
-
-
- <% if ucic > 0 then %>
- <%:unsavedchanges%>: <%=ucic%>
- <% submenu("/" .. category .. "/uci/", tree.nodes[category].nodes["uci"]) -%>
- <% else %>
- <%:changes%>: 0
- <% end %>
-
- + end + end +-%> +
-
+
- <% if ucic > 0 then %><%:unsavedchanges%>: <%=ucic%><% +submenu("/" .. category .. "/uci/", tree.nodes[category].nodes["uci"]) +else -%> +<%:changes%>: 0<% end -%> + +