From 4f4f76cfc6b94576ea6726fdf8fa3ba55d3562f8 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Wed, 18 Apr 2012 01:59:46 +0000 Subject: Started work on updating for acf-core-0.15 Removed controllerfunctions library (still needs more work and corresponding work in model) Updated startstop functionality and deleted view Updated for viewfunctions to htmlviewfunctions and modified require statements for acf libraries --- tinydns-controller.lua | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'tinydns-controller.lua') diff --git a/tinydns-controller.lua b/tinydns-controller.lua index 64a224c..25a0c12 100644 --- a/tinydns-controller.lua +++ b/tinydns-controller.lua @@ -1,6 +1,5 @@ module(..., package.seeall) -require("controllerfunctions") -require("validator") +validator = require("acf.validator") mvc = {} mvc.on_load = function(self, parent) @@ -18,15 +17,15 @@ function view(self) end function startstop(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 function config(self) - return controllerfunctions.handle_form(self, self.model.getconfig, function(value) return self.model.setconfig(self, value) end, self.clientdata, "Save", "Edit Configuration", "Configuration Saved") + return self.handle_form(self, self.model.getconfig, function(value) return self.model.setconfig(self, value) end, self.clientdata, "Save", "Edit Configuration", "Configuration Saved") end function newfile(self) - return controllerfunctions.handle_form(self, self.model.getnewconfigfile, function(value) + return self.handle_form(self, self.model.getnewconfigfile, function(value) return self.model.createconfigfile(self, value, sessiondata.userinfo.userid) end, self.clientdata, "Create", "Create New Config File", "Config File Created") end @@ -47,7 +46,7 @@ function edit(self) end function editfile(self) - config = controllerfunctions.handle_form(self, function() + config = self.handle_form(self, function() return self.model.get_filedetails(self, self.clientdata.filename, sessiondata.userinfo.userid) end, function(value) return self.model.set_filedetails(self, value, sessiondata.userinfo.userid) @@ -68,7 +67,7 @@ function listpermissions(self) end function edituserpermissions(self) - return controllerfunctions.handle_form(self, function() + return self.handle_form(self, function() return self.model:getuserpermissions(self.clientdata.userid) end, function(value) return self.model:setuserpermissions(value) @@ -76,7 +75,7 @@ function edituserpermissions(self) end function editrolepermissions(self) - return controllerfunctions.handle_form(self, function() + return self.handle_form(self, function() return self.model:getrolepermissions(self.clientdata.role) end, function(value) return self.model:setrolepermissions(value) -- cgit v1.2.3