From f047cc93b9c8ef2b81bc692af3a2868969992bdf Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Sat, 19 Oct 2013 23:52:24 +0000 Subject: Remove all calls to 'module' in preparation for move to Lua 5.2 Use mymodule parameter for module definition. This was also helpful in revealing places where the code relied on the global environment. --- freeswitch-controller.lua | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'freeswitch-controller.lua') diff --git a/freeswitch-controller.lua b/freeswitch-controller.lua index 7f9d628..baf1b35 100644 --- a/freeswitch-controller.lua +++ b/freeswitch-controller.lua @@ -1,31 +1,33 @@ -module (..., package.seeall) +local mymodule = {} -default_action = "status" +mymodule.default_action = "status" -status = function( self ) +mymodule.status = function( self ) return self.model.get_status() end -startstop = function( self ) +mymodule.startstop = function( self ) return self.handle_form(self, self.model.get_startstop, self.model.startstop_service, self.clientdata) end -listfiles = function( self ) +mymodule.listfiles = function( self ) return self.model.list_files() end -editfile = function( self ) +mymodule.editfile = function( self ) return self.handle_form(self, self.model.get_file, self.model.update_file, self.clientdata, "Save", "Edit File", "File Saved") end -function createfile(self) +function mymodule.createfile(self) return self.handle_form(self, self.model.getnewfile, self.model.createfile, self.clientdata, "Create", "Create New Freeswitch File", "Freeswitch File Created") end -function deletefile(self) +function mymodule.deletefile(self) return self.handle_form(self, self.model.getdeletefile, self.model.deletefile, self.clientdata, "Delete", "Delete Freeswitch File", "Freeswitch File Deleted") end -function reloadxml(self) +function mymodule.reloadxml(self) return self.handle_form(self, self.model.getreloadxml, self.model.reload_xml, self.clientdata, "Reload", "Reload Freeswitch XML") end + +return mymodule -- cgit v1.2.3