summaryrefslogtreecommitdiffstats
path: root/squid-listfiles-html.lsp
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2014-04-17 00:39:48 +0000
committerTed Trask <ttrask01@yahoo.com>2014-04-17 00:39:48 +0000
commit958cd75c56c84f3b7de7084586fa30c7ce5c8adf (patch)
treec5a3b09e30f5496fb2f8df64a3f2743889893926 /squid-listfiles-html.lsp
parentb8fd03d42b01372c2f2468b1ae2bc4e4204991a3 (diff)
downloadacf-squid-958cd75c56c84f3b7de7084586fa30c7ce5c8adf.tar.bz2
acf-squid-958cd75c56c84f3b7de7084586fa30c7ce5c8adf.tar.xz
Changes to use new htmlviewfunctions functions and remove dead code
Diffstat (limited to 'squid-listfiles-html.lsp')
-rw-r--r--squid-listfiles-html.lsp27
1 files changed, 15 insertions, 12 deletions
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 %>
-<h1>Files</h1>
+<% local header_level = htmlviewfunctions.displaysectionstart(view, page_info) %>
<table id="list" 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("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
+ %>
</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("createfile") then
- local createform = viewlibrary.dispatch_component("createfile", nil, true) %>
-<h2><%= html.html_escape(createform.label) %></h2>
-<%
- 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 %>