Commit ffa7d88f authored by Ted Trask's avatar Ted Trask

Change listfiles filesize to size, size and mtime not user-friendly, use...

Change listfiles filesize to size, size and mtime not user-friendly, use posix.stat over fs.stat, use new format functions
parent 789ccadd
......@@ -40,8 +40,8 @@ html = require("acf.html")
<tr>
<td><% htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename, redir=redir}, label="", option="Edit", action="editfile"}), page_info, -1) %></td>
<td><%= html.html_escape(file.filename) %></td>
<td><span class="hide"><%= html.html_escape(file.orig_size) %>b</span><%= html.html_escape(file.size) %></td>
<td><%= html.html_escape(file.mtime) %></td>
<td><span class="hide"><%= html.html_escape(file.size or 0) %>b</span><%= format.formatfilesize(file.size) %></td>
<td><%= format.formattime(file.mtime) %></td>
</tr>
<% end %>
</tbody></table>
......
......@@ -742,7 +742,7 @@ end
-- PUBLIC FUNCTIONS
function mymodule.getsourcelist()
local retval = cfe({ type="list", value={}, label="Weblog Source List" })
local retval = cfe({ type="structure", value={}, label="Weblog Source List" })
local res, err = pcall(function()
databaseconnect(DatabaseUser)
retval.value = listsourceentries()
......@@ -1482,9 +1482,9 @@ function mymodule.create_database(self, database)
end
function mymodule.listfiles()
local retval = cfe({ type="list", value={}, label="Weblog Files" })
local retval = cfe({ type="structure", value={}, label="Weblog Files" })
for i,file in ipairs(files) do
local details = fs.stat(file) or {}
local details = posix.stat(file) or {}
details.filename = file
retval.value[#retval.value + 1] = details
end
......
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