From 81adf8a6763769157690b1e82211cbe7b960da8e Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Thu, 17 Apr 2014 00:40:59 +0000 Subject: Changes to use new htmlviewfunctions functions --- tcpproxy-listsmtpfiles-html.lsp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'tcpproxy-listsmtpfiles-html.lsp') diff --git a/tcpproxy-listsmtpfiles-html.lsp b/tcpproxy-listsmtpfiles-html.lsp index b5e479a..a303f47 100644 --- a/tcpproxy-listsmtpfiles-html.lsp +++ b/tcpproxy-listsmtpfiles-html.lsp @@ -24,32 +24,34 @@ html = require("acf.html") <% htmlviewfunctions.displaycommandresults({"editsmtpfile", "delsmtpfile"}, session) %> <% htmlviewfunctions.displaycommandresults({"createsmtpfile"}, session, true) %> -

Files

+<% local header_level = htmlviewfunctions.displaysectionstart(view, page_info) %> +<% local filename = cfe({ type="hidden", value="" }) %> +<% local redir = cfe({ type="hidden", value=page_info.orig_action }) %> <% for i,file in ipairs(view.value) do %> <% end %>
Action File
- <% if viewlibrary.check_permission("editsmtpfile") then %> - <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/editsmtpfile?filename="..file.."&redir="..page_info.orig_action, label="Edit "} %> - <% end %> - <% if viewlibrary.check_permission("delsmtpfile") then %> - <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/delsmtpfile?submit=true&filename="..file, label="Delete "} %> - <% end %> + <% + filename.value = file + if viewlibrary.check_permission("editsmtpfile") then + htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename, redir=redir}, label="", option="Edit", action="editsmtpfile"}), page_info, -1) + end + if viewlibrary.check_permission("delsmtpfile") then + htmlviewfunctions.displayitem(cfe({type="form", value={filename=filename}, label="", option="Delete", action="delsmtpfile"}), page_info, -1) + end + %> <%= html.html_escape(file) %>
+<% htmlviewfunctions.displaysectionend(header_level) %> <% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createsmtpfile") then - local createform = viewlibrary.dispatch_component("createsmtpfile", nil, true) %> -

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

-<% - createform.action = page_info.script .. page_info.prefix .. page_info.controller .. "/createsmtpfile" - htmlviewfunctions.displayform(createform) + viewlibrary.dispatch_component("createsmtpfile") end %> -- cgit v1.2.3