From d8afa977ce3587ee2819c44d545753aa0cc38760 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Thu, 15 May 2008 20:15:32 +0000 Subject: 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 --- syslog-controller.lua | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'syslog-controller.lua') 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 -- cgit v1.2.3