summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZach LeBar <zach@zachlebar.com>2012-03-29 13:39:34 +0000
committerZach LeBar <zach@zachlebar.com>2012-03-29 13:39:34 +0000
commit664f7e41674c2ab50fff296f6d3daf3eba829046 (patch)
tree3e86c372fe5f9f5785a399c772e0f719ff7990a1
parentb468d5ebc05acc8d09b27e85fdbb994922a06e96 (diff)
downloadacf-asterisk-664f7e41674c2ab50fff296f6d3daf3eba829046.tar.bz2
acf-asterisk-664f7e41674c2ab50fff296f6d3daf3eba829046.tar.xz
Fixing acf-asterisk to work with changes made to acf-core.
Removing the use of controllerfunctions.lua and using the new 'handle_form()' found in acf_www-controller.lua. Also using 'handle_form()' in place of 'redirect_to_referrer()'.
-rw-r--r--asterisk-controller.lua6
-rw-r--r--asterisk-model.lua12
2 files changed, 10 insertions, 8 deletions
diff --git a/asterisk-controller.lua b/asterisk-controller.lua
index 25994a3..404a141 100644
--- a/asterisk-controller.lua
+++ b/asterisk-controller.lua
@@ -2,8 +2,6 @@
module (..., package.seeall)
-require("controllerfunctions")
-
default_action = "status"
status = function( self )
@@ -11,7 +9,7 @@ status = function( self )
end
startstop = function( self )
- return controllerfunctions.handle_startstop(self, self.model.startstop_service, self.clientdata)
+ return self.handle_form(self, self.model.get_startstop, self.model.startstop_service, self.clientdata)
end
listfiles = function( self )
@@ -19,5 +17,5 @@ listfiles = function( self )
end
edit = function( self )
- return controllerfunctions.handle_form(self, function() return self.model.get_file(self.clientdata.filename) end, self.model.update_file, self.clientdata, "Save", "Edit File", "File Saved")
+ return self.handle_form(self, self.model.get_file, self.model.update_file, self.clientdata, "Save", "Edit File", "File Saved")
end
diff --git a/asterisk-model.lua b/asterisk-model.lua
index 38c6a89..afc6a7b 100644
--- a/asterisk-model.lua
+++ b/asterisk-model.lua
@@ -28,12 +28,16 @@ get_status = function()
return modelfunctions.getstatus(processname, packagename, "Asterisk Status")
end
-function startstop_service(action)
- return modelfunctions.startstop_service(processname, action, {"Start", "Stop", "Restart", "Reload"})
+function get_startstop(clientdata)
+ return modelfunctions.get_startstop(processname)
end
-get_file = function(filename)
- return modelfunctions.getfiledetails(filename, is_valid_filename)
+function startstop_service(startstop, action)
+ return modelfunctions.startstop_service(startstop, action)
+end
+
+get_file = function(clientdata)
+ return modelfunctions.getfiledetails(clientdata.filename, is_valid_filename)
end
update_file = function(filedetails)