summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2014-04-17 00:29:27 +0000
committerTed Trask <ttrask01@yahoo.com>2014-04-17 00:29:27 +0000
commitea930ec9b8600c9ba8639683a503654a442efdde (patch)
treebf02e2a07f96eb864b4d1f66f124c0fe18ca9f79
parent7631eabf0767756fe21732695f022dd0d296691d (diff)
downloadacf-samba-ea930ec9b8600c9ba8639683a503654a442efdde.tar.bz2
acf-samba-ea930ec9b8600c9ba8639683a503654a442efdde.tar.xz
Changes to use new htmlviewfunctions functions
-rw-r--r--samba-listfiles-html.lsp14
-rw-r--r--samba-listshares-html.lsp15
2 files changed, 19 insertions, 10 deletions
diff --git a/samba-listfiles-html.lsp b/samba-listfiles-html.lsp
index 94f0fce..2292409 100644
--- a/samba-listfiles-html.lsp
+++ b/samba-listfiles-html.lsp
@@ -31,7 +31,7 @@ end
<script type="text/javascript">
$(document).ready(function() {
- $("#list").tablesorter({widgets: ['zebra']});
+ $("#list").tablesorter({headers: {0:{sorter: false}}, widgets: ['zebra']});
});
</script>
@@ -41,21 +41,25 @@ end
viewlibrary.dispatch_component("status")
end %>
-<h1><%= html.html_escape(data.label) %></h1>
+<% local header_level = htmlviewfunctions.displaysectionstart(data, page_info) %>
<table id="list" class="tablesorter"><thead>
<tr>
+ <th>Action</th>
<th>File</th>
<th>Size</th>
<th>Last Modified</th>
</tr>
</thead><tbody>
+<% local filename = cfe({ type="hidden", value="" }) %>
+<% local redir = cfe({ type="hidden", value=page_info.orig_action }) %>
<% for i,file in ipairs(data.value) do %>
+ <% filename.value = file.filename %>
<tr>
- <td>
- <%= html.link{value = "expert?filename=" .. file.filename.."&redir="..page_info.orig_action, label=file.filename} %>
- </td>
+ <td><% htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename, redir=redir}, label="", option="Edit", action="expert"}), page_info, -1) %></td>
+ <td><%= html.html_escape(file.filename) %></td>
<td><span style="display:none"><%= convertsize(file.filesize) %>b</span><%= html.html_escape(file.filesize) %></td>
<td><%= html.html_escape(file.mtime) %></td>
</tr>
<% end %>
</tbody></table>
+<% htmlviewfunctions.displaysectionend(header_level) %>
diff --git a/samba-listshares-html.lsp b/samba-listshares-html.lsp
index dca452a..41833e8 100644
--- a/samba-listshares-html.lsp
+++ b/samba-listshares-html.lsp
@@ -24,7 +24,7 @@ html = require("acf.html")
<% htmlviewfunctions.displaycommandresults({"editshare", "deleteshare"}, session) %>
<% htmlviewfunctions.displaycommandresults({"createshare"}, session, true) %>
-<h1>Shares</h1>
+<% local header_level = htmlviewfunctions.displaysectionstart(view, page_info) %>
<table id="list" class="tablesorter"><thead>
<tr>
<th>Action</th>
@@ -33,14 +33,17 @@ html = require("acf.html")
<th>Comment</th>
</tr>
</thead><tbody>
+<% local name = cfe({ type="hidden", value="" }) %>
+<% local redir = cfe({ type="hidden", value=page_info.orig_action }) %>
<% for i,share in ipairs(view.value) do %>
+ <% name.value = share.name %>
<tr>
<td>
- <% if viewlibrary.check_permission("editshare") then %>
- <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/editshare?name="..share.name.."&redir="..page_info.orig_action, label="Edit "} %>
+ <% if viewlibrary.check_permission("editshare") then %>
+ <% htmlviewfunctions.displayitem(cfe({type="link", value={name=name, redir=redir}, label="", option="Edit", action="editshare"}), page_info, -1) %>
<% end %>
<% if viewlibrary.check_permission("deleteshare") then %>
- <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/deleteshare?submit=true&name="..share.name, label="Delete "} %>
+ <% htmlviewfunctions.displayitem(cfe({type="form", value={name=name}, label="", option="Delete", action="deleteshare"}), page_info, -1) %>
<% end %>
</td>
<td><%= html.html_escape(share.name) %></td>
@@ -54,7 +57,7 @@ html = require("acf.html")
<% end %>
<% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createshare") then %>
-<h2>Create new share</h2>
+<% local header_level2 = htmlviewfunctions.displaysectionstart(cfe({label="Create new share"}), page_info, htmlviewfunctions.incrementheader(header_level)) %>
<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller) %>/createshare" method="post">
<input class="hidden" type="hidden" name="redir" value="<%= html.html_escape(page_info.orig_action) %>" >
<div class='item'><p class='left'></p>
@@ -62,4 +65,6 @@ html = require("acf.html")
<input class="submit" type="submit" value="Create Share">
</div></div><!-- end .item -->
</form>
+<% htmlviewfunctions.displaysectionend(header_level2) %>
<% end %>
+<% htmlviewfunctions.displaysectionend(header_level) %>