* Core translation
[project/luci.git] / modules / admin-core / luasrc / model / cbi / admin_wifi / networks.lua
index afcca4c..19aa0e1 100644 (file)
@@ -1,32 +1,41 @@
--- ToDo: Translate, Add descriptions and help texts
+--[[
+LuCI - Lua Configuration Interface
+
+Copyright 2008 Steven Barth <steven@midlink.org>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+]]--
 m = Map("wireless", translate("networks", "Netze"), translate("a_w_networks1", [[Pro WLAN-Gerät können mehrere Netze bereitgestellt werden.
 Es sollte beachtet werden, dass es hardware- / treiberspezifische Einschränkungen gibt.
 So kann pro WLAN-Gerät in der Regel entweder 1 Ad-Hoc-Zugang ODER bis zu 3 Access-Point und 1 Client-Zugang
 gleichzeitig erstellt werden.]]))
 
-s = m:section(TypedSection, "wifi-iface")
+s = m:section(TypedSection, "wifi-iface", "")
 s.addremove = true
 s.anonymous = true
 
 s:option(Value, "ssid", translate("a_w_netid", "Netzkennung (ESSID)")).maxlength = 32
 
 device = s:option(ListValue, "device", translate("device", "Gerät"))
-local d = luci.model.uci.sections("wireless")
-if d then
-       for k, v in pairs(d) do
-               if v[".type"] == "wifi-device" then
-                       device:value(k)
-               end
-       end
-end
+luci.model.uci.foreach("wireless", "wifi-device",
+       function (section)
+               device:value(section[".name"])
+       end)
 
 network = s:option(ListValue, "network", translate("network", "Netzwerk"), translate("a_w_network1", "WLAN-Netz zu Netzwerk hinzufügen"))
 network:value("")
-for k, v in pairs(luci.model.uci.sections("network")) do
-       if v[".type"] == "interface" and k ~= "loopback" then
-               network:value(k)
-       end
-end
+luci.model.uci.foreach("network", "interface",
+       function (section)
+               if section[".name"] ~= "loopback" then
+                       network:value(section[".name"])
+               end
+       end)
 
 mode = s:option(ListValue, "mode", translate("mode", "Modus"))
 mode:value("ap", "Access Point")