Commit f528595c authored by Ted Trask's avatar Ted Trask

Changes to use new htmlviewfunctions functions

parent 9a4319f2
......@@ -24,25 +24,33 @@ html = require("acf.html")
<% htmlviewfunctions.displaycommandresults({"deletepeer", "editpeer"}, session) %>
<% htmlviewfunctions.displaycommandresults({"createpeer"}, session, true) %>
<h1>Peer Files</h1>
<% local header_level = htmlviewfunctions.displaysectionstart(form, page_info) %>
<table id="list" class="tablesorter"><thead>
<tr>
<th>Action</th>
<th>Peer File</th>
</tr>
</thead><tbody>
<% local name = cfe({ type="hidden", value="" }) %>
<% local redir = cfe({ type="hidden", value=page_info.orig_action }) %>
<% for i,file in ipairs(form.value) do %>
<tr>
<td>
<%
if viewlibrary.check_permission("deletepeer") then io.write(html.link{value = "deletepeer?submit=true&name=" .. file, label="Delete " }) end
if viewlibrary.check_permission("editpeer") then io.write(html.link{value = "editpeer?name=" .. file.."&redir="..page_info.orig_action, label="Edit " }) end
name.value = file
if viewlibrary.check_permission("deletepeer") then
htmlviewfunctions.displayitem(cfe({type="form", value={name=name}, label="", option="Delete", action="deletepeer"}), page_info, -1)
end
if viewlibrary.check_permission("editpeer") then
htmlviewfunctions.displayitem(cfe({type="link", value={name=name, redir=redir}, label="", option="Edit", action="editpeer"}), page_info, -1)
end
%>
</td>
<td><%= html.html_escape(string.gsub(file, "^.*/", "")) %></td>
</tr>
<% end %>
</tbody></table>
<% htmlviewfunctions.displaysectionend(header_level) %>
<% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createpeer") then
viewlibrary.dispatch_component("createpeer")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment