summaryrefslogtreecommitdiffstats
path: root/syslog-controller.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2008-05-15 20:15:32 +0000
committerTed Trask <ttrask01@yahoo.com>2008-05-15 20:15:32 +0000
commitd8afa977ce3587ee2819c44d545753aa0cc38760 (patch)
tree82ea6d0e957959ba1a2777f090cffac9f941734c /syslog-controller.lua
parent7d9b0d93dd7c3dee3acd4da629b4f519eafe0f7b (diff)
downloadacf-alpine-baselayout-d8afa977ce3587ee2819c44d545753aa0cc38760.tar.bz2
acf-alpine-baselayout-d8afa977ce3587ee2819c44d545753aa0cc38760.tar.xz
For cfe.type='form', use cfe.option as the command to save the form data i.e. can be used as button name. Modified pages that use 'form' to also use 'option'.
git-svn-id: svn://svn.alpinelinux.org/acf/alpine-baselayout/trunk@1122 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'syslog-controller.lua')
-rw-r--r--syslog-controller.lua21
1 files changed, 14 insertions, 7 deletions
diff --git a/syslog-controller.lua b/syslog-controller.lua
index 5c47415..48e7b56 100644
--- a/syslog-controller.lua
+++ b/syslog-controller.lua
@@ -8,28 +8,35 @@ end
function config(self)
local config
- if self.clientdata.save then
+ if self.clientdata.Save then
config = self.model.updateconfig(self.clientdata)
else
config = self.model.getconfig()
end
+
config.type = "form"
+ config.label = "Edit config"
+ config.option = "Save"
return config
end
function expert(self)
-- Save changes
+ local config
local modifications = self.clientdata.filecontent or ""
- if self.clientdata.save then
- self.model:update_filecontent(modifications)
+ if self.clientdata.Save then
+ config = self.model:update_filecontent(modifications)
+ if not config.errtxt then
+ config.descr = "Saved File"
+ end
+ else
+ config = self.model:get_filedetails()
end
- local config = self.model:get_filedetails()
config.type = "form"
- if self.clientdata.save then
- config.descr = "Saved File"
- end
+ config.label = "Edit config"
+ config.option = "Save"
return config
end