diff options
author | Ted Trask <ttrask01@yahoo.com> | 2014-04-17 00:40:59 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2014-04-17 00:40:59 +0000 |
commit | 81adf8a6763769157690b1e82211cbe7b960da8e (patch) | |
tree | c69f20fc220ff096b10f85f26083459e381c1372 /tcpproxy-listsmtpfiles-html.lsp | |
parent | 02f08e3420245cb727783f5abe460d336f135459 (diff) | |
download | acf-tcpproxy-81adf8a6763769157690b1e82211cbe7b960da8e.tar.bz2 acf-tcpproxy-81adf8a6763769157690b1e82211cbe7b960da8e.tar.xz |
Changes to use new htmlviewfunctions functions
Diffstat (limited to 'tcpproxy-listsmtpfiles-html.lsp')
-rw-r--r-- | tcpproxy-listsmtpfiles-html.lsp | 26 |
1 files changed, 14 insertions, 12 deletions
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) %> -<h1>Files</h1> +<% local header_level = htmlviewfunctions.displaysectionstart(view, page_info) %> <table id="listfiles" class="tablesorter"><thead> <tr> <th>Action</th> <th>File</th> </tr> </thead><tbody> +<% local filename = cfe({ type="hidden", value="" }) %> +<% local redir = cfe({ type="hidden", value=page_info.orig_action }) %> <% for i,file in ipairs(view.value) do %> <tr> <td> - <% 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 + %> </td> <td><%= html.html_escape(file) %></td> </tr> <% end %> </tbody></table> +<% htmlviewfunctions.displaysectionend(header_level) %> <% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createsmtpfile") then - local createform = viewlibrary.dispatch_component("createsmtpfile", nil, true) %> -<h2><%= html.html_escape(createform.label) %></h2> -<% - createform.action = page_info.script .. page_info.prefix .. page_info.controller .. "/createsmtpfile" - htmlviewfunctions.displayform(createform) + viewlibrary.dispatch_component("createsmtpfile") end %> |