summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2014-04-12 04:28:30 +0000
committerTed Trask <ttrask01@yahoo.com>2014-04-12 04:28:30 +0000
commit94c7cf2b506732a07accb155aa874492832609f5 (patch)
tree3e8c29e28268952d5796a3fdcdb079c531a95f47
parentac9d4ef5fe49eee863019e0167743f71b8602aaa (diff)
downloadacf-postfix-94c7cf2b506732a07accb155aa874492832609f5.tar.bz2
acf-postfix-94c7cf2b506732a07accb155aa874492832609f5.tar.xz
Changes to use new htmlviewfunctions functions
-rw-r--r--postfix-details-html.lsp7
-rw-r--r--postfix-listfiles-html.lsp22
-rw-r--r--postfix-listqueue-html.lsp10
3 files changed, 17 insertions, 22 deletions
diff --git a/postfix-details-html.lsp b/postfix-details-html.lsp
index 78db808..d261b13 100644
--- a/postfix-details-html.lsp
+++ b/postfix-details-html.lsp
@@ -5,7 +5,6 @@ html = require("acf.html")
<% viewlibrary.dispatch_component("status") %>
-<h2><%= html.html_escape(data.label) %></h2>
-<%
-htmlviewfunctions.displayitem(data)
-%>
+<% local header_level = htmlviewfunctions.displaysectionstart(data, page_info) %>
+<% htmlviewfunctions.displayitem(data) %>
+<% htmlviewfunctions.displaysectionend(header_level) %>
diff --git a/postfix-listfiles-html.lsp b/postfix-listfiles-html.lsp
index 3f5cfb7..a312e09 100644
--- a/postfix-listfiles-html.lsp
+++ b/postfix-listfiles-html.lsp
@@ -42,7 +42,7 @@ 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>
@@ -51,11 +51,16 @@ end %>
<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 %>
<tr>
<td>
- <%= html.link{value = "expert?filename=" .. file.filename.."&redir="..page_info.orig_action, label="Edit "} %>
- <% if file.filename ~= "/etc/mail/aliases" then %><%= html.link{value = "deletefile?submit=true&filename=" .. file.filename, label="Delete "} %><% end %>
+ <% filename.value = file.filename %>
+ <% htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename, redir=redir}, label="", option="Edit", action="expert"}), page_info, -1) %>
+ <% if file.filename ~= "/etc/mail/aliases" then %>
+ <% htmlviewfunctions.displayitem(cfe({type="form", value={filename=filename}, label="", option="Delete", action="deletefile"}), page_info, -1) %>
+ <% end %>
</td>
<td><%= html.html_escape(file.filename) %></td>
<td><span style="display:none"><%= convertsize(file.filesize) %>b</span><%= html.html_escape(file.filesize) %></td>
@@ -64,17 +69,12 @@ end %>
<% end %>
</tbody></table>
-<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/rebuilddatabases") %>">
-<div class='item'><p class='left'>Rebuild Databases</p>
-<div class='right'>
-<input class="submit" type="submit" name="submit" value="Rebuild">
-</div></div><!-- end .item -->
-</form>
+<% htmlviewfunctions.displayitem(cfe({type="form", value={}, label="Rebuild Databases", option="Rebuild", action="rebuilddatabases"}), page_info, 0) %>
+<% htmlviewfunctions.displaysectionend(header_level) %>
<% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createfile") then
local newfileform = viewlibrary.dispatch_component("createfile", nil, true) %>
-<h2>Create new file</h2>
<%
newfileform.action = page_info.script .. page_info.prefix .. page_info.controller .. "/createfile"
- htmlviewfunctions.displayform(newfileform)
+ htmlviewfunctions.displayitem(newfileform, page_info, htmlviewfunctions.incrementheader(header_level))
end %>
diff --git a/postfix-listqueue-html.lsp b/postfix-listqueue-html.lsp
index c85c2c2..2400fbe 100644
--- a/postfix-listqueue-html.lsp
+++ b/postfix-listqueue-html.lsp
@@ -5,13 +5,9 @@ html = require("acf.html")
<% htmlviewfunctions.displaycommandresults({"flushqueue"}, session) %>
-<h1><%= html.html_escape(data.label) %></h2>
+<% local header_level = htmlviewfunctions.displaysectionstart(data, page_info) %>
<pre>
<%= html.html_escape(data.value) %>
</pre>
-<form action="flushqueue">
-<div class='item'><p class='left'>Flush Queue</p>
-<div class='right'>
-<input class="submit" type="submit" name="submit" value="Flush">
-</div></div><!-- end .item -->
-</form>
+<% htmlviewfunctions.displayitem(cfe({type="form", value={}, label="Flush Queue", option="Flush", action="flushqueue" }), page_info, 0) %>
+<% htmlviewfunctions.displaysectionend(header_level) %>