* modules/admin-core: Add translation for UCI changes, revert and apply page title
authorSteven Barth <steven@midlink.org>
Sat, 5 Jul 2008 10:31:58 +0000 (10:31 +0000)
committerSteven Barth <steven@midlink.org>
Sat, 5 Jul 2008 10:31:58 +0000 (10:31 +0000)
modules/admin-core/luasrc/controller/admin/uci.lua
themes/fledermaus/luasrc/view/themes/fledermaus/header.htm
themes/openwrt.org/luasrc/view/themes/openwrt.org/header.htm

index b69fef4..215a13a 100644 (file)
@@ -14,9 +14,12 @@ $Id$
 module("luci.controller.admin.uci", package.seeall)
 
 function index()
 module("luci.controller.admin.uci", package.seeall)
 
 function index()
-       node("admin", "uci", "changes").target = call("action_changes")
-       node("admin", "uci", "revert").target  = call("action_revert")
-       node("admin", "uci", "apply").target   = call("action_apply")
+       local i18n = luci.i18n.translate
+       
+       entry({"admin", "uci"}, nil, i18n("config"))
+       entry({"admin", "uci", "changes"}, call("action_changes"), i18n("changes"))
+       entry({"admin", "uci", "revert"}, call("action_revert"), i18n("revert"))
+       entry({"admin", "uci", "apply"}, call("action_apply"), i18n("apply"))
 end
 
 function convert_changes(changes)
 end
 
 function convert_changes(changes)
index f1343a0..6fd9691 100644 (file)
@@ -66,7 +66,9 @@ local function submenu(prefix, node)
        end
        local index = {}        
        for k, n in pairs(node.nodes) do
        end
        local index = {}        
        for k, n in pairs(node.nodes) do
-               table.insert(index, {name=k, order=n.order or 100})
+               if n.title and n.target then
+                       table.insert(index, {name=k, order=n.order or 100})
+               end
        end
                
        table.sort(index, function(a, b) return a.order < b.order end)
        end
                
        table.sort(index, function(a, b) return a.order < b.order end)
@@ -96,7 +98,7 @@ if cattree and cattree.nodes then
 
        for i, k in ipairs(index) do
                node = cattree.nodes[k.name]
 
        for i, k in ipairs(index) do
                node = cattree.nodes[k.name]
-               if node.title then
+               if node.title and node.target 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="yellowtext"<%end%>><a href="<%=controller%>/<%=category%>/<%=k.name%>"><%=node.title%></a>                 
                        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="yellowtext"<%end%>><a href="<%=controller%>/<%=category%>/<%=k.name%>"><%=node.title%></a>                 
index 2501051..49d282c 100644 (file)
@@ -66,7 +66,9 @@ local function submenu(prefix, node)
        end
        local index = {}        
        for k, n in pairs(node.nodes) do
        end
        local index = {}        
        for k, n in pairs(node.nodes) do
-               table.insert(index, {name=k, order=n.order or 100})
+               if n.title and n.target then
+                       table.insert(index, {name=k, order=n.order or 100})
+               end
        end
                
        table.sort(index, function(a, b) return a.order < b.order end)
        end
                
        table.sort(index, function(a, b) return a.order < b.order end)
@@ -96,7 +98,7 @@ if cattree and cattree.nodes then
 
        for i, k in ipairs(index) do
                node = cattree.nodes[k.name]
 
        for i, k in ipairs(index) do
                node = cattree.nodes[k.name]
-               if node.title then
+               if node.title and node.target 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>                  
                        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>