From 958cd75c56c84f3b7de7084586fa30c7ce5c8adf Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Thu, 17 Apr 2014 00:39:48 +0000 Subject: Changes to use new htmlviewfunctions functions and remove dead code --- squid-listfiles-html.lsp | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'squid-listfiles-html.lsp') diff --git a/squid-listfiles-html.lsp b/squid-listfiles-html.lsp index 0aea8bf..91a30d7 100644 --- a/squid-listfiles-html.lsp +++ b/squid-listfiles-html.lsp @@ -28,32 +28,35 @@ html = require("acf.html") viewlibrary.dispatch_component("status") end %> -

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("editfile") then %> - <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/editfile?filename="..file.."&redir="..page_info.orig_action, label="Edit "} %> - <% end %> - <% if viewlibrary.check_permission("deletefile") then %> - <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/deletefile?submit=true&filename="..file, label="Delete "} %> - <% end %> + <% + filename.value = file + if viewlibrary.check_permission("editfile") then + htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename, redir=redir}, label="", option="Edit", action="editfile"}), page_info, -1) + end + if viewlibrary.check_permission("deletefile") then + htmlviewfunctions.displayitem(cfe({type="form", value={filename=filename}, label="", option="Delete", action="deletefile" }), page_info, -1) + end + %> <%= html.html_escape(file) %>
+<% htmlviewfunctions.displaysectionend(header_level) %> <% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createfile") then - local createform = viewlibrary.dispatch_component("createfile", nil, true) %> -

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

-<% - createform.action = page_info.script .. page_info.prefix .. page_info.controller .. "/createfile" - htmlviewfunctions.displayform(createform) + local createform = viewlibrary.dispatch_component("createfile", nil, true) + htmlviewfunctions.displayitem(createform, page_info) end %> -- cgit v1.2.3