diff --git a/dnscache-config-html.lsp b/dnscache-config-html.lsp index c53da2591b32bd9cfbc3e6c1a2649e13f098a584..2fdd23b32c97fa98ef9a4eb0d696ee92d2d17919 100644 --- a/dnscache-config-html.lsp +++ b/dnscache-config-html.lsp @@ -6,8 +6,4 @@ htmlviewfunctions = require("htmlviewfunctions") viewlibrary.dispatch_component("status") end %> -

Config

-<% - 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 9f41a9c015b923e36bfffbe90a669ba3c334b9b1..8318904721bebf7d217e170793a8e81046d3aa02 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) %> -

Configuration

-

Edit/View DNS server entries

+<% +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)) +%> -<% 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 %> - + <% end %>
Action Domain
- <% 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 + %> <%= html.html_escape(domain) %><%= html.html_escape(d) %>
+<% +htmlviewfunctions.displaysectionend(header_level2) +htmlviewfunctions.displaysectionend(header_level) +%> <% if viewlibrary and viewlibrary.dispatch_component then viewlibrary.dispatch_component("createdomain")