<% local view, viewlibrary, page_info, session = ... htmlviewfunctions = require("htmlviewfunctions") html = require("acf.html") %> <% function convertsize(size) if string.find(size, "k$") then return tonumber(string.match(size, "[%d.]*")) * 1024.0 elseif string.find(size, "M$") then return tonumber(string.match(size, "[%d.]*")) * 1024.0 * 1024.0 elseif string.find(size, "G$") then return tonumber(string.match(size, "[%d.]*")) + 1024.0 * 1024.0 * 1024.0 else return tonumber(string.match(size, "[%d.]*")) end end %> <% htmlviewfunctions.displaycommandresults({"editfile"}, session) %> <% 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 %> <% filename.value = file.filename %> <% end %>
Action File Size Last Modified
<% htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename, redir=redir}, label="", option="Edit", action="editfile"}), page_info, -1) %> <%= html.html_escape(file.filename) %> <%= convertsize(file.size) %>b<%= html.html_escape(file.size) %> <%= html.html_escape(file.mtime) %>
<% htmlviewfunctions.displaysectionend(header_level) %>