diff options
author | Ted Trask <ttrask01@yahoo.com> | 2008-05-15 20:15:32 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2008-05-15 20:15:32 +0000 |
commit | d8afa977ce3587ee2819c44d545753aa0cc38760 (patch) | |
tree | 82ea6d0e957959ba1a2777f090cffac9f941734c /syslog-controller.lua | |
parent | 7d9b0d93dd7c3dee3acd4da629b4f519eafe0f7b (diff) | |
download | acf-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.lua | 21 |
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 |