From ffa7d88fbc30ef500e108325f48826159d4309f8 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Wed, 30 Dec 2015 14:16:27 +0000 Subject: Change listfiles filesize to size, size and mtime not user-friendly, use posix.stat over fs.stat, use new format functions --- weblog-listfiles-html.lsp | 4 ++-- weblog-model.lua | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/weblog-listfiles-html.lsp b/weblog-listfiles-html.lsp index b55d972..ca7245f 100644 --- a/weblog-listfiles-html.lsp +++ b/weblog-listfiles-html.lsp @@ -40,8 +40,8 @@ html = require("acf.html") <% htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename, redir=redir}, label="", option="Edit", action="editfile"}), page_info, -1) %> <%= html.html_escape(file.filename) %> - <%= html.html_escape(file.orig_size) %>b<%= html.html_escape(file.size) %> - <%= html.html_escape(file.mtime) %> + <%= html.html_escape(file.size or 0) %>b<%= format.formatfilesize(file.size) %> + <%= format.formattime(file.mtime) %> <% end %> diff --git a/weblog-model.lua b/weblog-model.lua index 3f1247e..682b093 100644 --- a/weblog-model.lua +++ b/weblog-model.lua @@ -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 -- cgit v1.2.3