summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2014-04-10 06:13:46 +0000
committerTed Trask <ttrask01@yahoo.com>2014-04-10 06:13:46 +0000
commit67efc1efa4a98a1f5d5e14fcbb716b9d4e2d8129 (patch)
treeea9b70acff6163be6a5a9c930c9080bc6f9045db
parentc35e16d5a0942e5becda2594492156fe91ee6e04 (diff)
downloadacf-dnscache-67efc1efa4a98a1f5d5e14fcbb716b9d4e2d8129.tar.bz2
acf-dnscache-67efc1efa4a98a1f5d5e14fcbb716b9d4e2d8129.tar.xz
Changes to use new htmlviewfunctions functions
-rw-r--r--dnscache-config-html.lsp6
-rw-r--r--dnscache-listdomains-html.lsp27
2 files changed, 20 insertions, 13 deletions
diff --git a/dnscache-config-html.lsp b/dnscache-config-html.lsp
index c53da25..2fdd23b 100644
--- a/dnscache-config-html.lsp
+++ b/dnscache-config-html.lsp
@@ -6,8 +6,4 @@ htmlviewfunctions = require("htmlviewfunctions")
viewlibrary.dispatch_component("status")
end %>
-<h1>Config</h1>
-<%
- form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action
- htmlviewfunctions.displayform(form)
-%>
+<% htmlviewfunctions.displayitem(form, page_info) %>
diff --git a/dnscache-listdomains-html.lsp b/dnscache-listdomains-html.lsp
index 9f41a9c..8318904 100644
--- a/dnscache-listdomains-html.lsp
+++ b/dnscache-listdomains-html.lsp
@@ -24,26 +24,37 @@ html = require("acf.html")
<% htmlviewfunctions.displaycommandresults({"editdomain", "deletedomain"}, session) %>
<% htmlviewfunctions.displaycommandresults({"createdomain"}, session, true) %>
-<h1>Configuration</h1>
-<h2>Edit/View DNS server entries</h2>
+<%
+local header_level = htmlviewfunctions.displaysectionstart(cfe({label="Configuration"}), page_info)
+local header_level2 = htmlviewfunctions.displaysectionstart(cfe({label="Edit/View DNS server entries"}), page_info, htmlviewfunctions.incrementheader(header_level))
+%>
<table id="list" class="tablesorter"><thead>
<tr>
<th>Action</th>
<th>Domain</th>
</tr>
</thead><tbody>
-<% for i,domain in ipairs(data.value) do %>
+<% local domain = cfe({ type="hidden", value="" }) %>
+<% local redir = cfe({ type="hidden", value=page_info.orig_action }) %>
+<% for i,d in ipairs(data.value) do %>
<tr>
<td>
- <% io.write(html.link{value = "editdomain?domain=" .. domain.."&redir="..page_info.orig_action, label="Edit " }) %>
- <% if domain ~= "@" then
- io.write(html.link{value = "deletedomain?submit=true&domain=" .. domain, label="Delete " })
- end %>
+ <%
+ domain.value = d
+ htmlviewfunctions.displayitem(cfe({type="link", value={domain=domain, redir=redir}, label="", option="Edit", action="editdomain"}), page_info, -1)
+ if d ~= "@" then
+ htmlviewfunctions.displayitem(cfe({type="form", value={domain=domain}, label="", option="Delete", action="deletedomain"}), page_info, -1)
+ end
+ %>
</td>
- <td><%= html.html_escape(domain) %></td>
+ <td><%= html.html_escape(d) %></td>
</tr>
<% end %>
</tbody></table>
+<%
+htmlviewfunctions.displaysectionend(header_level2)
+htmlviewfunctions.displaysectionend(header_level)
+%>
<% if viewlibrary and viewlibrary.dispatch_component then
viewlibrary.dispatch_component("createdomain")