From 94c7cf2b506732a07accb155aa874492832609f5 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Sat, 12 Apr 2014 04:28:30 +0000 Subject: Changes to use new htmlviewfunctions functions --- postfix-details-html.lsp | 7 +++---- postfix-listfiles-html.lsp | 22 +++++++++++----------- postfix-listqueue-html.lsp | 10 +++------- 3 files changed, 17 insertions(+), 22 deletions(-) diff --git a/postfix-details-html.lsp b/postfix-details-html.lsp index 78db808..d261b13 100644 --- a/postfix-details-html.lsp +++ b/postfix-details-html.lsp @@ -5,7 +5,6 @@ html = require("acf.html") <% viewlibrary.dispatch_component("status") %> -

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

-<% -htmlviewfunctions.displayitem(data) -%> +<% local header_level = htmlviewfunctions.displaysectionstart(data, page_info) %> +<% htmlviewfunctions.displayitem(data) %> +<% htmlviewfunctions.displaysectionend(header_level) %> diff --git a/postfix-listfiles-html.lsp b/postfix-listfiles-html.lsp index 3f5cfb7..a312e09 100644 --- a/postfix-listfiles-html.lsp +++ b/postfix-listfiles-html.lsp @@ -42,7 +42,7 @@ end viewlibrary.dispatch_component("status") end %> -

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

+<% local header_level = htmlviewfunctions.displaysectionstart(data, page_info) %> @@ -51,11 +51,16 @@ end %> +<% local filename = cfe({ type="hidden", value="" }) %> +<% local redir = cfe({ type="hidden", value=page_info.orig_action }) %> <% for i,file in ipairs(data.value) do %> @@ -64,17 +69,12 @@ end %> <% end %>
ActionLast Modified
- <%= html.link{value = "expert?filename=" .. file.filename.."&redir="..page_info.orig_action, label="Edit "} %> - <% if file.filename ~= "/etc/mail/aliases" then %><%= html.link{value = "deletefile?submit=true&filename=" .. file.filename, label="Delete "} %><% end %> + <% filename.value = file.filename %> + <% htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename, redir=redir}, label="", option="Edit", action="expert"}), page_info, -1) %> + <% if file.filename ~= "/etc/mail/aliases" then %> + <% htmlviewfunctions.displayitem(cfe({type="form", value={filename=filename}, label="", option="Delete", action="deletefile"}), page_info, -1) %> + <% end %> <%= html.html_escape(file.filename) %> <%= convertsize(file.filesize) %>b<%= html.html_escape(file.filesize) %>
-
"> -

Rebuild Databases

-
- -
-
+<% htmlviewfunctions.displayitem(cfe({type="form", value={}, label="Rebuild Databases", option="Rebuild", action="rebuilddatabases"}), page_info, 0) %> +<% htmlviewfunctions.displaysectionend(header_level) %> <% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createfile") then local newfileform = viewlibrary.dispatch_component("createfile", nil, true) %> -

Create new file

<% newfileform.action = page_info.script .. page_info.prefix .. page_info.controller .. "/createfile" - htmlviewfunctions.displayform(newfileform) + htmlviewfunctions.displayitem(newfileform, page_info, htmlviewfunctions.incrementheader(header_level)) end %> diff --git a/postfix-listqueue-html.lsp b/postfix-listqueue-html.lsp index c85c2c2..2400fbe 100644 --- a/postfix-listqueue-html.lsp +++ b/postfix-listqueue-html.lsp @@ -5,13 +5,9 @@ html = require("acf.html") <% htmlviewfunctions.displaycommandresults({"flushqueue"}, session) %> -

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

+<% local header_level = htmlviewfunctions.displaysectionstart(data, page_info) %>
 <%= html.html_escape(data.value) %>
 
-
-

Flush Queue

-
- -
-
+<% htmlviewfunctions.displayitem(cfe({type="form", value={}, label="Flush Queue", option="Flush", action="flushqueue" }), page_info, 0) %> +<% htmlviewfunctions.displaysectionend(header_level) %> -- cgit v1.2.3