luci-0.11: merge outstanding trunk changes
[project/luci.git] / applications / luci-upnp / luasrc / controller / upnp.lua
index fe9d3d8f5b1b3e5bba79fdc2cb08b94e960fa4ff..7acd029a5f0b54ce43db5c5823605d259108f993 100644 (file)
@@ -12,6 +12,7 @@ You may obtain a copy of the License at
 
 $Id$
 ]]--
+
 module("luci.controller.upnp", package.seeall)
 
 function index()
@@ -21,12 +22,10 @@ function index()
 
        local page
 
-       page = entry({"admin", "services", "upnp"}, cbi("upnp/upnp"), "UPNP")
-       page.i18n = "upnp"
+       page = entry({"admin", "services", "upnp"}, cbi("upnp/upnp"), _("UPNP"))
        page.dependent = true
 
-       page = entry({"mini", "network", "upnp"}, cbi("upnp/upnpmini", {autoapply=true}), "UPNP")
-       page.i18n = "upnp"
+       page = entry({"mini", "network", "upnp"}, cbi("upnp/upnpmini", {autoapply=true}), _("UPNP"))
        page.dependent = true
 
        entry({"admin", "services", "upnp", "status"}, call("act_status")).leaf = true
@@ -68,10 +67,8 @@ function act_status()
        end
 end
 
-function act_delete()
-       local path = luci.dispatcher.context.requestpath
-       local idx = tonumber(path[#path])
-
+function act_delete(idx)
+       idx = tonumber(idx)
        if idx and idx > 0 then
                luci.sys.call("iptables -t filter -D MINIUPNPD %d 2>/dev/null" % idx)
                luci.sys.call("iptables -t nat -D MINIUPNPD %d 2>/dev/null" % idx)