<% local form, viewlibrary, page_info, session = ... %> <% htmlviewfunctions = require("htmlviewfunctions") %> <% html = require("acf.html") %> <% htmlviewfunctions.displaycommandresults({"editfile"}, session) %> <% local header_level = htmlviewfunctions.displaysectionstart(cfe({label="Edit MAC Authentication File"}), page_info) htmlviewfunctions.displayitem(form.value.filename) htmlviewfunctions.displayitem(form.value.size) htmlviewfunctions.displayitem(form.value.mtime) if not form.value.filename.errtxt then local header_level2 = htmlviewfunctions.displaysectionstart(cfe({label="Entries"}), page_info, htmlviewfunctions.incrementheader(header_level)) htmlviewfunctions.displayformstart(form, page_info) form.value.filename.type = "hidden" htmlviewfunctions.displayformitem(form.value.filename, "filename") form.value.filecontent.type = "hidden" htmlviewfunctions.displayformitem(form.value.filecontent, "filecontent") %> <% for line in string.gmatch(html.html_escape(form.value.filecontent.value), "([^\n]*)\n?") do %> <% end %>
<%= line %>
<% htmlviewfunctions.displayinfo(form.value.filecontent) htmlviewfunctions.displayformend(form) htmlviewfunctions.displaysectionend(header_level2) end htmlviewfunctions.displaysectionend(header_level) %> <% if not form.value.filename.errtxt and viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("editfile") then local filename = cfe({ type="hidden", value=form.value.filename.value }) local redir = cfe({ type="hidden", value=page_info.orig_action.."?filename="..html.url_encode(form.value.filename.value) }) if form.value.redir then redir.value = redir.value.."&redir="..html.url_encode(form.value.redir.value) end htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename, redir=redir}, label="Expert", option="Edit", action="editfile"}), page_info, htmlviewfunctions.incrementheader(header_level)) end %>