<% local form, viewlibrary, page_info, session = ... %> <% htmlviewfunctions = require("htmlviewfunctions") %> <% html = require("acf.html") %> <% htmlviewfunctions.displaycommandresults({"deletetableentry", "updatetableentry"}, session) %> <% htmlviewfunctions.displaycommandresults({"createtableentry"}, session, true) %> <% form.label = form.label.." - "..form.value.table.value %> <% local header_level = htmlviewfunctions.displaysectionstart(form, page_info) %> <% if viewlibrary.check_permission("deletetableentry") or viewlibrary.check_permission("updatetableentry") then %> <% end %> <% for i,f in ipairs(form.value.fields.value) do %> <% end %> <% local redir = cfe({ type="hidden", value=page_info.orig_action.."?table="..form.value.table.value }) %> <% local table = cfe({ type="hidden", value=form.value.table.value }) %> <% local id = cfe({ type="hidden" }) %> <% for i,tableentry in ipairs(form.value.entries.value) do %> <% if viewlibrary.check_permission("deletetableentry") or viewlibrary.check_permission("updatetableentry") then %> <% id.value = tableentry.id %> <% end %> <% for i,f in ipairs(form.value.fields.value) do %> <% end %> <% end %>
Action<%= html.html_escape(f) %>
<% if viewlibrary.check_permission("updatetableentry") then %> <% htmlviewfunctions.displayitem(cfe({type="link", value={table=table, id=id, redir=redir}, label="", option="Update", action="updatetableentry"}), page_info, -1) %> <% end %> <% if viewlibrary.check_permission("deletetableentry") then %> <% htmlviewfunctions.displayitem(cfe({type="form", value={table=table, id=id}, label="", option="Delete", action="deletetableentry", class="deletetableentry"}), page_info, -1) %> <% end %> <%= html.html_escape(tableentry[f]) %>
<% htmlviewfunctions.displayinfo(form) %> <% if #form.value.entries.value == 0 then %>

No entries found

<% end %> <% htmlviewfunctions.displaysectionend(header_level) %> <% if page_info.action == "viewtable" and viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createtableentry") then viewlibrary.dispatch_component("createtableentry", {table=form.value.table.value}) end %>