1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
<% local form, viewlibrary, page_info, session = ... %>
<% htmlviewfunctions = require("htmlviewfunctions") %>
<% html = require("acf.html") %>
<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>');
}
</script>
<script type="text/javascript">
if (typeof $.tablesorter == 'undefined') {
document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery.tablesorter.js"><\/script>');
}
</script>
<script type="text/javascript">
$(document).ready(function() {
$("#list").tablesorter({headers: {0:{sorter: false}}, widgets: ['zebra']});
});
</script>
<% htmlviewfunctions.displaycommandresults({"upgrade", "install"}, session) %>
<% local header_level = htmlviewfunctions.displaysectionstart(form, page_info) %>
<table id="list" class="tablesorter"><thead>
<tr>
<% if viewlibrary.check_permission("install") or viewlibrary.check_permission("upgrade") then %>
<th>Action</th>
<% end %>
<th>Package Name</th>
<th>Version</th>
</tr>
</thead><tbody>
<% local packagecfe = cfe({ type="hidden", value="" }) %>
<% for i,packagetable in pairs(form.value) do %>
<tr>
<% if viewlibrary.check_permission("install") or viewlibrary.check_permission("upgrade") or viewlibrary.check_permission("details") then %>
<% packagecfe.value = packagetable.name %>
<td>
<% if viewlibrary.check_permission("install") and not packagetable.upgrade then %>
<% htmlviewfunctions.displayitem(cfe({type="form", value={package=packagecfe}, label="", option="Install", action="install" }), page_info, -1) %>
<% end %>
<% if viewlibrary.check_permission("upgrade") and packagetable.upgrade then %>
<% htmlviewfunctions.displayitem(cfe({type="form", value={package=packagecfe}, label="", option="Upgrade", action="upgrade" }), page_info, -1) %>
<% end %>
<% if viewlibrary.check_permission("details") then %>
<% htmlviewfunctions.displayitem(cfe({type="form", value={package=packagecfe}, label="", option="View", action="details" }), page_info, -1) %>
<% end %>
</td>
<% end %>
<td><%= html.html_escape(packagetable.name) %></td>
<td><%= html.html_escape(packagetable.version) %></td>
</tr>
<% end %>
</tbody></table>
<% htmlviewfunctions.displaysectionend(header_level) %>
|