summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2012-04-18 01:26:11 +0000
committerTed Trask <ttrask01@yahoo.com>2012-04-18 01:26:11 +0000
commit49feb0b0d13aa92399f54fb48aef428d05527d15 (patch)
tree57c71c593528281c1ef9b798aa2bf03e59d8a860
parente19ee215667692e70cb4788dca4151e23aa73b96 (diff)
downloadacf-kamailio-49feb0b0d13aa92399f54fb48aef428d05527d15.tar.bz2
acf-kamailio-49feb0b0d13aa92399f54fb48aef428d05527d15.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--kamailio-controller.lua15
-rw-r--r--kamailio-createtableentry-html.lsp4
-rw-r--r--kamailio-createuser-html.lsp4
-rw-r--r--kamailio-listfiles-html.lsp4
-rw-r--r--kamailio-listtables-html.lsp4
-rw-r--r--kamailio-listusers-html.lsp6
-rw-r--r--kamailio-model.lua14
-rw-r--r--kamailio-searchdatabase-html.lsp4
l---------kamailio-startstop-html.lsp1
-rw-r--r--kamailio-status-html.lsp14
-rw-r--r--kamailio-viewtable-html.lsp6
11 files changed, 38 insertions, 38 deletions
diff --git a/kamailio-controller.lua b/kamailio-controller.lua
index 8cd66ac..5a8b613 100644
--- a/kamailio-controller.lua
+++ b/kamailio-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 listfiles(self)
@@ -18,7 +15,7 @@ function listfiles(self)
end
function edit(self)
- return controllerfunctions.handle_form(self, function() return self.model.get_filedetails(self.clientdata.filename) end, self.model.update_filedetails, self.clientdata, "Save", "Edit File", "File Saved")
+ return self.handle_form(self, function() return self.model.get_filedetails(self.clientdata.filename) end, self.model.update_filedetails, self.clientdata, "Save", "Edit File", "File Saved")
end
function listusers(self)
@@ -26,7 +23,7 @@ function listusers(self)
end
function createuser(self)
- return controllerfunctions.handle_form(self, self.model.get_new_user, self.model.create_new_user, self.clientdata, "Create", "Create New User")
+ return self.handle_form(self, self.model.get_new_user, self.model.create_new_user, self.clientdata, "Create", "Create New User")
end
function deleteuser(self)
@@ -34,7 +31,7 @@ function deleteuser(self)
end
function updateuser(self)
- return controllerfunctions.handle_form(self, function() return self.model.get_user(self.clientdata.username) end, self.model.update_user, self.clientdata, "Update", "Update User")
+ return self.handle_form(self, function() return self.model.get_user(self.clientdata.username) end, self.model.update_user, self.clientdata, "Update", "Update User")
end
function listtables(self)
@@ -50,11 +47,11 @@ function deletetableentry(self)
end
function updatetableentry(self)
- return controllerfunctions.handle_form(self, function() return self.model.get_table_entry(self.clientdata.table, self.clientdata.id) end, self.model.update_table_entry, self.clientdata, "Update", "Update Table Entry", "Entry updated")
+ return self.handle_form(self, function() return self.model.get_table_entry(self.clientdata.table, self.clientdata.id) end, self.model.update_table_entry, self.clientdata, "Update", "Update Table Entry", "Entry updated")
end
function createtableentry(self)
- return controllerfunctions.handle_form(self, function() return self.model.get_table_entry(self.clientdata.table) end, self.model.create_table_entry, self.clientdata, "Create", "Create New Table Entry", "Entry created")
+ return self.handle_form(self, function() return self.model.get_table_entry(self.clientdata.table) end, self.model.create_table_entry, self.clientdata, "Create", "Create New Table Entry", "Entry created")
end
function createdatabase(self)
diff --git a/kamailio-createtableentry-html.lsp b/kamailio-createtableentry-html.lsp
index 14ffd0a..fc5113f 100644
--- a/kamailio-createtableentry-html.lsp
+++ b/kamailio-createtableentry-html.lsp
@@ -1,5 +1,5 @@
<% local form, viewlibrary, page_info = ...
-require("viewfunctions")
+require("htmlviewfunctions")
%>
<H1><%= html.html_escape(form.label) %></H1>
@@ -10,5 +10,5 @@ require("viewfunctions")
elseif form.value.id then
form.value.id.type = "hidden"
end
- displayform(form, nil, nil, page_info, 2)
+ htmlviewfunctions.displayform(form, nil, nil, page_info, 2)
%>
diff --git a/kamailio-createuser-html.lsp b/kamailio-createuser-html.lsp
index fb05750..a3a8857 100644
--- a/kamailio-createuser-html.lsp
+++ b/kamailio-createuser-html.lsp
@@ -1,5 +1,5 @@
<% local form, viewlibrary, page_info = ...
-require("viewfunctions")
+require("htmlviewfunctions")
%>
<H1><%= html.html_escape(form.label) %></H1>
@@ -11,5 +11,5 @@ require("viewfunctions")
form.value.username.readonly = true
end
local order = {"username", "password", "password_confirm", "email_address"}
- displayform(form, order)
+ htmlviewfunctions.displayform(form, order)
%>
diff --git a/kamailio-listfiles-html.lsp b/kamailio-listfiles-html.lsp
index 93a00fc..bcc9020 100644
--- a/kamailio-listfiles-html.lsp
+++ b/kamailio-listfiles-html.lsp
@@ -1,8 +1,8 @@
<% local view, viewlibrary, page_info, session = ...
-require("viewfunctions")
+require("htmlviewfunctions")
%>
-<% displaycommandresults({"edit"}, session) %>
+<% htmlviewfunctions.displaycommandresults({"edit"}, session) %>
<% if viewlibrary and viewlibrary.dispatch_component then
viewlibrary.dispatch_component("status")
diff --git a/kamailio-listtables-html.lsp b/kamailio-listtables-html.lsp
index 49aebc2..f4bd207 100644
--- a/kamailio-listtables-html.lsp
+++ b/kamailio-listtables-html.lsp
@@ -1,7 +1,7 @@
<% local form, viewlibrary, page_info, session = ... %>
-<% require("viewfunctions") %>
+<% require("htmlviewfunctions") %>
-<% displaycommandresults({"createdatabase"}, session) %>
+<% htmlviewfunctions.displaycommandresults({"createdatabase"}, session) %>
<H1><%= html.html_escape(form.label) %></H1>
<DL>
diff --git a/kamailio-listusers-html.lsp b/kamailio-listusers-html.lsp
index 5994b79..a4bd57a 100644
--- a/kamailio-listusers-html.lsp
+++ b/kamailio-listusers-html.lsp
@@ -1,8 +1,8 @@
<% local form, viewlibrary, page_info, session = ... %>
-<% require("viewfunctions") %>
+<% require("htmlviewfunctions") %>
-<% displaycommandresults({"deleteuser", "updateuser"}, session) %>
-<% displaycommandresults({"createuser"}, session, true) %>
+<% htmlviewfunctions.displaycommandresults({"deleteuser", "updateuser"}, session) %>
+<% htmlviewfunctions.displaycommandresults({"createuser"}, session, true) %>
<H1><%= html.html_escape(form.label) %></H1>
<DL>
diff --git a/kamailio-model.lua b/kamailio-model.lua
index c121dd1..f1ef074 100644
--- a/kamailio-model.lua
+++ b/kamailio-model.lua
@@ -3,9 +3,9 @@ module(..., package.seeall)
-- Load libraries
require("posix")
require("modelfunctions")
-require("fs")
-require("format")
-require("validator")
+fs = require("acf.fs")
+format = require("acf.format")
+validator = require("acf.validator")
-- Set variables
local processname = "kamailio"
@@ -153,8 +153,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/kamailio-searchdatabase-html.lsp b/kamailio-searchdatabase-html.lsp
index 87f0a9d..6d747b7 100644
--- a/kamailio-searchdatabase-html.lsp
+++ b/kamailio-searchdatabase-html.lsp
@@ -1,5 +1,5 @@
<% local form, viewlibrary, page_info = ...
-require("viewfunctions")
+require("htmlviewfunctions")
%>
<% if form.value.result then
@@ -24,5 +24,5 @@ end %>
<%
form.value.result = nil
form.option = "Search"
- displayform(form, nil, nil, page_info, 2)
+ htmlviewfunctions.displayform(form, nil, nil, page_info, 2)
%>
diff --git a/kamailio-startstop-html.lsp b/kamailio-startstop-html.lsp
deleted file mode 120000
index 0ea2627..0000000
--- a/kamailio-startstop-html.lsp
+++ /dev/null
@@ -1 +0,0 @@
-../startstop-html.lsp \ No newline at end of file
diff --git a/kamailio-status-html.lsp b/kamailio-status-html.lsp
index 9a8bce3..538448e 100644
--- a/kamailio-status-html.lsp
+++ b/kamailio-status-html.lsp
@@ -1,17 +1,17 @@
<% local data, viewlibrary, page_info, session = ...
-require("viewfunctions")
+require("htmlviewfunctions")
%>
-<% displaycommandresults({"install","edit"}, session) %>
-<% displaycommandresults({"startstop"}, session) %>
-<% displaycommandresults({"reloadplan"}, session) %>
+<% htmlviewfunctions.displaycommandresults({"install","edit"}, session) %>
+<% htmlviewfunctions.displaycommandresults({"startstop"}, session) %>
+<% htmlviewfunctions.displaycommandresults({"reloadplan"}, session) %>
<H1>System Info</H1>
<DL>
<%
-displayitem(data.value.status)
+htmlviewfunctions.displayitem(data.value.status)
-displayitem(data.value.version)
+htmlviewfunctions.displayitem(data.value.version)
if data.value.version and data.value.version.errtxt and viewlibrary.check_permission("apk-tools/apk/install") then
%>
<DT>Install package</DT>
@@ -21,7 +21,7 @@ if data.value.version and data.value.version.errtxt and viewlibrary.check_permis
<%
end
-displayitem(data.value.autostart)
+htmlviewfunctions.displayitem(data.value.autostart)
if not (data.value.version and data.value.version.errtxt) and data.value.autostart and data.value.autostart.errtxt and viewlibrary.check_permission("alpine-baselayout/rc/edit") then
%>
<DT>Enable autostart</DT>
diff --git a/kamailio-viewtable-html.lsp b/kamailio-viewtable-html.lsp
index 28d4e13..3a4c076 100644
--- a/kamailio-viewtable-html.lsp
+++ b/kamailio-viewtable-html.lsp
@@ -1,8 +1,8 @@
<% local form, viewlibrary, page_info, session = ... %>
-<% require("viewfunctions") %>
+<% require("htmlviewfunctions") %>
-<% displaycommandresults({"deletetableentry", "updatetableentry"}, session) %>
-<% displaycommandresults({"createtableentry"}, session, true) %>
+<% htmlviewfunctions.displaycommandresults({"deletetableentry", "updatetableentry"}, session) %>
+<% htmlviewfunctions.displaycommandresults({"createtableentry"}, session, true) %>
<H1><%= html.html_escape(form.label) %> - <%= html.html_escape(form.value.table.value) %></H1>
<DL>