From 7e4ee0dd94ad37c10cd722916935822d79eea4fc Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Wed, 18 Apr 2012 01:29:21 +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 --- openntpd-config-html.lsp | 4 ++-- openntpd-controller.lua | 12 +++--------- openntpd-details-html.lsp | 6 +++--- openntpd-logfile-html.lsp | 1 - openntpd-model.lua | 12 ++++++++---- openntpd-startstop-html.lsp | 1 - 6 files changed, 16 insertions(+), 20 deletions(-) delete mode 120000 openntpd-startstop-html.lsp diff --git a/openntpd-config-html.lsp b/openntpd-config-html.lsp index 8033857..2cd2cb3 100644 --- a/openntpd-config-html.lsp +++ b/openntpd-config-html.lsp @@ -1,5 +1,5 @@ <% local form, viewlibrary, page_info, session = ... -require("viewfunctions") +require("htmlviewfunctions") %> <% if viewlibrary and viewlibrary.dispatch_component then @@ -10,5 +10,5 @@ end %> <% form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action local order = { "setstimeonstartup", "listen", "server", "servers" } - displayform(form, order) + htmlviewfunctions.displayform(form, order) %> diff --git a/openntpd-controller.lua b/openntpd-controller.lua index f735e84..dc90eb4 100644 --- a/openntpd-controller.lua +++ b/openntpd-controller.lua @@ -1,15 +1,9 @@ module (..., package.seeall) --- Load libraries -require("controllerfunctions") - --- ################################################################################ --- PUBLIC FUNCTIONS - default_action = "status" function config(self) - return controllerfunctions.handle_form(self, self.model.read_config, self.model.update_config, self.clientdata, "Save", "Edit OpenNTPD Config", "OpenNTPD Configuration Saved") + return self.handle_form(self, self.model.read_config, self.model.update_config, self.clientdata, "Save", "Edit OpenNTPD Config", "OpenNTPD Configuration Saved") end function status (self) @@ -21,9 +15,9 @@ function details (self) end function expert (self) - return controllerfunctions.handle_form(self, self.model.get_filedetails, self.model.update_filedetails, self.clientdata, "Save", "Edit Config", "Configuration Set") + return self.handle_form(self, self.model.get_filedetails, self.model.update_filedetails, self.clientdata, "Save", "Edit Config", "Configuration Set") 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 diff --git a/openntpd-details-html.lsp b/openntpd-details-html.lsp index bb68ed2..db71acd 100644 --- a/openntpd-details-html.lsp +++ b/openntpd-details-html.lsp @@ -1,5 +1,5 @@ <% local data, viewlibrary = ... -require("viewfunctions") +require("htmlviewfunctions") %> <% if viewlibrary and viewlibrary.dispatch_component then @@ -9,8 +9,8 @@ end %>

<%= html.html_escape(data.label) %>

<% -displayitem(data.value.date) -displayitem(data.value.timechanged) +htmlviewfunctions.displayitem(data.value.date) +htmlviewfunctions.displayitem(data.value.timechanged) %>
diff --git a/openntpd-logfile-html.lsp b/openntpd-logfile-html.lsp index 23f732e..993c95a 100644 --- a/openntpd-logfile-html.lsp +++ b/openntpd-logfile-html.lsp @@ -1,5 +1,4 @@ <% local data, viewlibrary = ... -require("viewfunctions") %> <% if viewlibrary and viewlibrary.dispatch_component then diff --git a/openntpd-model.lua b/openntpd-model.lua index a3dbbae..9924701 100644 --- a/openntpd-model.lua +++ b/openntpd-model.lua @@ -2,8 +2,8 @@ module (..., package.seeall) -- Load libraries require("modelfunctions") -require("fs") -require("format") +fs = require("acf.fs") +format = require("acf.format") -- Set variables local configfile = "/etc/ntpd.conf" @@ -52,8 +52,12 @@ end -- ################################################################################ -- PUBLIC FUNCTIONS -function startstop_service(action) - return modelfunctions.startstop_service(processname, action) +function get_startstop(clientdata) + return modelfunctions.get_startstop(processname) +end + +function startstop_service(startstop, action) + return modelfunctions.startstop_service(startstop, action) end function getstatus() diff --git a/openntpd-startstop-html.lsp b/openntpd-startstop-html.lsp deleted file mode 120000 index 0ea2627..0000000 --- a/openntpd-startstop-html.lsp +++ /dev/null @@ -1 +0,0 @@ -../startstop-html.lsp \ No newline at end of file -- cgit v1.2.3