diff options
author | Ted Trask <ttrask01@yahoo.com> | 2012-04-18 01:33:04 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2012-04-18 01:33:04 +0000 |
commit | 027ffe3f0bc2b95adb2241415a0d68687dbbec5b (patch) | |
tree | f8b6c15fa1a7851ea710948ff1af03407cddb54b | |
parent | 8346bee32010a3237ff52f2a5330d61643dc06c1 (diff) | |
download | acf-postfix-027ffe3f0bc2b95adb2241415a0d68687dbbec5b.tar.bz2 acf-postfix-027ffe3f0bc2b95adb2241415a0d68687dbbec5b.tar.xz |
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
-rw-r--r-- | postfix-controller.lua | 9 | ||||
-rw-r--r-- | postfix-details-html.lsp | 4 | ||||
-rw-r--r-- | postfix-listfiles-html.lsp | 8 | ||||
-rw-r--r-- | postfix-listqueue-html.lsp | 4 | ||||
-rw-r--r-- | postfix-logfile-html.lsp | 1 | ||||
-rw-r--r-- | postfix-model.lua | 14 | ||||
l--------- | postfix-startstop-html.lsp | 1 |
7 files changed, 20 insertions, 21 deletions
diff --git a/postfix-controller.lua b/postfix-controller.lua index cce6733..501087b 100644 --- a/postfix-controller.lua +++ b/postfix-controller.lua @@ -1,8 +1,5 @@ module(..., package.seeall) --- Load libraries -require("controllerfunctions") - default_action = "status" function status(self) @@ -10,7 +7,7 @@ function status(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 details(self) @@ -22,7 +19,7 @@ function listfiles(self) end function createfile(self) - return controllerfunctions.handle_form(self, self.model.getnewfile, self.model.createfile, self.clientdata, "Create", "Create new file", "New file created") + return self.handle_form(self, self.model.getnewfile, self.model.createfile, self.clientdata, "Create", "Create new file", "New file created") end function deletefile(self) @@ -30,7 +27,7 @@ function deletefile(self) end function expert(self) - return controllerfunctions.handle_form(self, function() return self.model.getfiledetails(self.clientdata.filename) end, self.model.updatefiledetails, self.clientdata, "Save", "Edit Postfix File", "File Saved") + return self.handle_form(self, function() return self.model.getfiledetails(self.clientdata.filename) end, self.model.updatefiledetails, self.clientdata, "Save", "Edit Postfix File", "File Saved") end function rebuilddatabases(self) diff --git a/postfix-details-html.lsp b/postfix-details-html.lsp index 8f1363e..ae142cd 100644 --- a/postfix-details-html.lsp +++ b/postfix-details-html.lsp @@ -1,5 +1,5 @@ <% local data, viewlibrary = ... -require("viewfunctions") +require("htmlviewfunctions") %> <% viewlibrary.dispatch_component("status") %> @@ -7,6 +7,6 @@ require("viewfunctions") <H2><%= html.html_escape(data.label) %></H2> <DL> <% -displayitem(data) +htmlviewfunctions.displayitem(data) %> </DL> diff --git a/postfix-listfiles-html.lsp b/postfix-listfiles-html.lsp index db1764a..1e6e09a 100644 --- a/postfix-listfiles-html.lsp +++ b/postfix-listfiles-html.lsp @@ -1,9 +1,9 @@ <% local data, viewlibrary, page_info, session = ... -require("viewfunctions") +require("htmlviewfunctions") %> -<% displaycommandresults({"deletefile", "expert", "rebuilddatabases"}, session) %> -<% displaycommandresults({"createfile"}, session, true) %> +<% htmlviewfunctions.displaycommandresults({"deletefile", "expert", "rebuilddatabases"}, session) %> +<% htmlviewfunctions.displaycommandresults({"createfile"}, session, true) %> <% if viewlibrary and viewlibrary.dispatch_component then viewlibrary.dispatch_component("status") @@ -43,5 +43,5 @@ end %> <h2>Create new file</h2> <% newfileform.action = page_info.script .. page_info.prefix .. page_info.controller .. "/createfile" - displayform(newfileform) + htmlviewfunctions.displayform(newfileform) end %> diff --git a/postfix-listqueue-html.lsp b/postfix-listqueue-html.lsp index d700ec7..ee6ba50 100644 --- a/postfix-listqueue-html.lsp +++ b/postfix-listqueue-html.lsp @@ -1,8 +1,8 @@ <% local data, viewlibrary, page_info, session = ... -require("viewfunctions") +require("htmlviewfunctions") %> -<% displaycommandresults({"flushqueue"}, session) %> +<% htmlviewfunctions.displaycommandresults({"flushqueue"}, session) %> <H1><%= html.html_escape(data.label) %></H2> <DL> diff --git a/postfix-logfile-html.lsp b/postfix-logfile-html.lsp index 20db6c2..aa12a16 100644 --- a/postfix-logfile-html.lsp +++ b/postfix-logfile-html.lsp @@ -1,5 +1,4 @@ <% local data, viewlibrary = ... -require("viewfunctions") %> <% if viewlibrary and viewlibrary.dispatch_component then diff --git a/postfix-model.lua b/postfix-model.lua index 344e378..64b1af4 100644 --- a/postfix-model.lua +++ b/postfix-model.lua @@ -3,9 +3,9 @@ module(..., package.seeall) -- Load libraries require("modelfunctions") require("posix") -require("fs") -require("format") -require("validator") +fs = require("acf.fs") +format = require("acf.format") +validator = require("acf.validator") -- Set variables local processname = "postfix" @@ -36,8 +36,12 @@ end -- ################################################################################ -- PUBLIC FUNCTIONS -function startstop_service(action) - return modelfunctions.startstop_service(processname, action, {"Start", "Stop", "Restart", "Reload"}) +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/postfix-startstop-html.lsp b/postfix-startstop-html.lsp deleted file mode 120000 index 0ea2627..0000000 --- a/postfix-startstop-html.lsp +++ /dev/null @@ -1 +0,0 @@ -../startstop-html.lsp
\ No newline at end of file |