summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2012-04-28 11:59:58 +0000
committerTed Trask <ttrask01@yahoo.com>2012-04-28 11:59:58 +0000
commit92da5f880fdfc1386bae4f8fb0e8bc9d948b422a (patch)
treeee16d2900010ef8982002c3a6dbdef4a88438aa0
parent14a52b1711e4ffa117ea3415c68d9e60fa26ec69 (diff)
downloadacf-alpine-conf-92da5f880fdfc1386bae4f8fb0e8bc9d948b422a.tar.bz2
acf-alpine-conf-92da5f880fdfc1386bae4f8fb0e8bc9d948b422a.tar.xz
Updated for handle_form now passing self to get and set functions
-rw-r--r--lbu-model.lua20
1 files changed, 10 insertions, 10 deletions
diff --git a/lbu-model.lua b/lbu-model.lua
index 88e4a83..24e1aa4 100644
--- a/lbu-model.lua
+++ b/lbu-model.lua
@@ -178,7 +178,7 @@ local function validatefilecontent (filedetails)
local success = true
local clientdata = clientdata or self.clientdata or {}
clientdata.configcontents = filedetails.value.filecontent.value
- local config = getconfig(clientdata)
+ local config = getconfig(nil, clientdata)
local errors = {}
for name,value in pairs(config.value) do
if value.errtxt then
@@ -253,7 +253,7 @@ function list()
return cfe({ type="structure", value=ret, label="List of changes" })
end
-function getconfig (clientdata)
+function getconfig (self, clientdata)
local clientdata = clientdata or {}
local config = {}
local configopts = {}
@@ -298,7 +298,7 @@ function getconfig (clientdata)
return retval
end
-function setconfig (config)
+function setconfig (self, config)
validateconfig(config)
if not config.errtxt then
@@ -335,7 +335,7 @@ function getincluded ()
return cfe({ type="group", value={included = included} })
end
-function setincluded (included)
+function setincluded (self, included)
validatefilelist(included.value.included)
if not included.value.included.errtxt then
fs.write_file(includefile, included.value.included.value)
@@ -358,7 +358,7 @@ function getexcluded ()
return cfe({ type="group", value={excluded = excluded} })
end
-function setexcluded (excluded)
+function setexcluded (self, excluded)
validatefilelist(excluded.value.excluded)
if not excluded.value.excluded.errtxt then
fs.write_file(excludefile, excluded.value.excluded.value)
@@ -372,8 +372,8 @@ function get_filedetails()
return modelfunctions.getfiledetails(configfile)
end
-function set_filedetails(filedetails)
- return modelfunctions.setfiledetails(filedetails, {configfile}, validatefilecontent)
+function set_filedetails(self, filedetails)
+ return modelfunctions.setfiledetails(self, filedetails, {configfile}, validatefilecontent)
end
function getcommit()
@@ -382,7 +382,7 @@ function getcommit()
return cfe({ type="group", value={simulate=simulate, delete=delete}, label="Commit changes" })
end
-function commit(input)
+function commit(self, input)
if input.value.simulate.value and input.value.delete.value then
input.errtxt = "Cannot delete overlays when simulating"
else
@@ -443,13 +443,13 @@ function getbackupfiles()
return cfe({ type="list", value=files, label="Backup archive list"})
end
-function get_selectbackup(clientdata)
+function get_selectbackup(self, clientdata)
local result = {}
result.backup = cfe({ value=clientdata.backup or "", label="Backup" })
return cfe({ type="group", value=result, label="Revert to Backup" })
end
-function selectbackupfile(backuprequest)
+function selectbackupfile(self, backuprequest)
local files = getbackupfiles()
for i,file in ipairs(files.value) do
if file == backuprequest.value.backup.value then