summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2014-10-24 19:03:17 +0000
committerTed Trask <ttrask01@yahoo.com>2014-10-24 19:05:52 +0000
commitd4714d31c967f784287529c25765b1cd2ee9634a (patch)
tree6588202b1ee1f05405471a54d4a3019d024b43c0
parentc3855ba459a945c3e697008fa3813a03e408068d (diff)
downloadacf-weblog-d4714d31c967f784287529c25765b1cd2ee9634a.tar.bz2
acf-weblog-d4714d31c967f784287529c25765b1cd2ee9634a.tar.xz
In listfiles HTML view, replace convertsize function with orig_size because throws an exception when file is missing
(cherry picked from commit 662cc57d8249ad1d2749a2b420a452822d07eba0) Conflicts: weblog-listfiles-html.lsp
-rw-r--r--weblog-listfiles-html.lsp16
1 files changed, 1 insertions, 15 deletions
diff --git a/weblog-listfiles-html.lsp b/weblog-listfiles-html.lsp
index fcca5b3..cb64723 100644
--- a/weblog-listfiles-html.lsp
+++ b/weblog-listfiles-html.lsp
@@ -3,20 +3,6 @@ htmlviewfunctions = require("htmlviewfunctions")
html = require("acf.html")
%>
-<%
-function convertsize(size)
- if string.find(size, "k$") then
- return tonumber(string.match(size, "%d*")) * 1024
- elseif string.find(string.match(size, "%d*"), "M$") then
- return tonumber(size) * 1024 * 1024
- elseif string.find(size, "G$") then
- return tonumber(string.match(size, "%d*")) + 1024 * 1024 * 1024
- else
- return tonumber(size)
- end
-end
-%>
-
<script type="text/javascript">
if (typeof jQuery == 'undefined') {
document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery-latest.js"><\/script>');
@@ -47,7 +33,7 @@ end
</TR>
</THEAD><TBODY>
<% for k,v in ipairs( view.value ) do
- io.write( "<tr><td><a href=\"" .. html.html_escape(page_info.script .. page_info.prefix .. page_info.controller) .. "/editfile?filename=" .. html.html_escape(v.filename) .. "&redir=" .. html.html_escape(page_info.orig_action) .. "\">" .. html.html_escape(v.filename) .. '</a></td><td><span style="display:none">'..convertsize(v.size).."b</span>" .. html.html_escape(v.size) .."</td><td>" .. html.html_escape(v.mtime) .."</td></tr>\n" )
+ io.write( "<tr><td><a href=\"" .. html.html_escape(page_info.script .. page_info.prefix .. page_info.controller) .. "/editfile?filename=" .. html.html_escape(v.filename) .. "&redir=" .. html.html_escape(page_info.orig_action) .. "\">" .. html.html_escape(v.filename) .. '</a></td><td><span style="display:none">'..html.html_escape(v.orig_size).."b</span>" .. html.html_escape(v.size) .."</td><td>" .. html.html_escape(v.mtime) .."</td></tr>\n" )
end %>
</TBODY></TABLE>
</DL>