Renamed FFLuCI to LuCI, ffluci to luci and Freifunk Lua Configuration Interface to...
[project/luci.git] / modules / admin-core / src / controller / admin / uci.lua
index 7443a16..ca1440b 100644 (file)
@@ -1,6 +1,6 @@
-module("ffluci.controller.admin.uci", package.seeall)
-require("ffluci.util")
-require("ffluci.sys")
+module("luci.controller.admin.uci", package.seeall)
+require("luci.util")
+require("luci.sys")
 
 function index()
        node("admin", "uci", "changes").target = template("admin_uci/changes")
@@ -10,7 +10,7 @@ end
 
 -- This function has a higher priority than the admin_uci/apply template
 function action_apply()
-       local changes = ffluci.model.uci.changes()
+       local changes = luci.model.uci.changes()
        local output  = ""
        
        if changes then
@@ -18,39 +18,39 @@ function action_apply()
                local run = {}
                
                -- Collect files to be applied and commit changes
-               for i, line in ipairs(ffluci.util.split(changes)) do
+               for i, line in ipairs(luci.util.split(changes)) do
                        local r = line:match("^-?([^.]+)")
                        if r then
                                com[r] = true
                                
-                               if ffluci.config.uci_oncommit and ffluci.config.uci_oncommit[r] then
-                                       run[ffluci.config.uci_oncommit[r]] = true
+                               if luci.config.uci_oncommit and luci.config.uci_oncommit[r] then
+                                       run[luci.config.uci_oncommit[r]] = true
                                end
                        end
                end
                
                -- Apply
                for config, i in pairs(com) do
-                       ffluci.model.uci.commit(config)
+                       luci.model.uci.commit(config)
                end 
                
                -- Search for post-commit commands
                for cmd, i in pairs(run) do
-                       output = output .. cmd .. ":" .. ffluci.sys.exec(cmd) .. "\n"
+                       output = output .. cmd .. ":" .. luci.sys.exec(cmd) .. "\n"
                end
        end
        
-       ffluci.template.render("admin_uci/apply", {changes=changes, output=output})
+       luci.template.render("admin_uci/apply", {changes=changes, output=output})
 end
 
 
 function action_revert()
-       local changes = ffluci.model.uci.changes()
+       local changes = luci.model.uci.changes()
        if changes then
                local revert = {}
                
                -- Collect files to be reverted
-               for i, line in ipairs(ffluci.util.split(changes)) do
+               for i, line in ipairs(luci.util.split(changes)) do
                        local r = line:match("^-?([^.]+)")
                        if r then
                                revert[r] = true
@@ -59,9 +59,9 @@ function action_revert()
                
                -- Revert them
                for k, v in pairs(revert) do
-                       ffluci.model.uci.revert(k)
+                       luci.model.uci.revert(k)
                end
        end
        
-       ffluci.template.render("admin_uci/revert", {changes=changes})
+       luci.template.render("admin_uci/revert", {changes=changes})
 end
\ No newline at end of file