diff options
Diffstat (limited to 'freeswitch-controller.lua')
-rw-r--r-- | freeswitch-controller.lua | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/freeswitch-controller.lua b/freeswitch-controller.lua index 04d6ea7..6b459cd 100644 --- a/freeswitch-controller.lua +++ b/freeswitch-controller.lua @@ -16,6 +16,14 @@ listfiles = function( self ) return self.model.list_files() end -edit = function( self ) +editfile = 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") end + +function createfile(self) + return controllerfunctions.handle_form(self, self.model.getnewfile, self.model.createfile, self.clientdata, "Create", "Create New Freeswitch File", "Freeswitch File Created") +end + +function deletefile(self) + return self:redirect_to_referrer(self.model.deletefile(self.clientdata.filename)) +end |