summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2015-12-30 14:16:27 +0000
committerTed Trask <ttrask01@yahoo.com>2015-12-30 18:18:59 +0000
commitffa7d88fbc30ef500e108325f48826159d4309f8 (patch)
tree015445a37685b391cfb39e19e677e88e8f794bd2
parent789ccadd90f2d72ee78003dd0564862adb383d89 (diff)
downloadacf-weblog-ffa7d88fbc30ef500e108325f48826159d4309f8.tar.bz2
acf-weblog-ffa7d88fbc30ef500e108325f48826159d4309f8.tar.xz
Change listfiles filesize to size, size and mtime not user-friendly, use posix.stat over fs.stat, use new format functions
-rw-r--r--weblog-listfiles-html.lsp4
-rw-r--r--weblog-model.lua6
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")
<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>
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