diff options
| author | Ted Trask <ttrask01@yahoo.com> | 2014-04-10 06:21:29 +0000 | 
|---|---|---|
| committer | Ted Trask <ttrask01@yahoo.com> | 2014-04-10 06:21:29 +0000 | 
| commit | 77a0025e476071c0016383328cce59259c7fbacb (patch) | |
| tree | 6ef05e8a6ab75596b042aa492abd364a21a7fe65 | |
| parent | 593eb28947e4aa7060d1570d43271d83e589fab3 (diff) | |
| download | acf-fetchmail-77a0025e476071c0016383328cce59259c7fbacb.tar.bz2 acf-fetchmail-77a0025e476071c0016383328cce59259c7fbacb.tar.xz  | |
Changes to use new htmlviewfunctions functions
| -rw-r--r-- | fetchmail-config-html.lsp | 14 | ||||
| -rw-r--r-- | fetchmail-listentries-html.lsp | 23 | 
2 files changed, 19 insertions, 18 deletions
diff --git a/fetchmail-config-html.lsp b/fetchmail-config-html.lsp index d23df93..87cab3c 100644 --- a/fetchmail-config-html.lsp +++ b/fetchmail-config-html.lsp @@ -8,14 +8,12 @@  	viewlibrary.dispatch_component("status")  end %> -<h1>Global Settings</h1> -<div class='item'><p class='left'>Edit global settings</p> -<div class='right'> -<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/editconfig") %>" method="post"> -<input class="hidden" type="hidden"  name="redir"  value="<%= html.html_escape(page_info.orig_action) %>" > -<input type=submit value="Edit" class="submit"> -</form> -</div></div><!-- end .item --> +<% +local redir = cfe({ type="hidden", value=page_info.orig_action }) +local header_level = htmlviewfunctions.displaysectionstart(cfe({ label="Global Settings" }), page_info) +htmlviewfunctions.displayitem(cfe({type="link", value={redir=redir}, label="Edit global settings", option="Edit", action="editconfig"}), page_info, 0) +htmlviewfunctions.displaysectionend(header_level) +%>  <% if viewlibrary and viewlibrary.dispatch_component then  	viewlibrary.dispatch_component("listentries") diff --git a/fetchmail-listentries-html.lsp b/fetchmail-listentries-html.lsp index 0e7e9c1..0904d7b 100644 --- a/fetchmail-listentries-html.lsp +++ b/fetchmail-listentries-html.lsp @@ -23,7 +23,7 @@ html = require("acf.html")  <% htmlviewfunctions.displaycommandresults({"editentry", "deleteentry", "createentry"}, session) %> -<h1>Edit/View Fetchmail Entries</h1> +<% local header_level = htmlviewfunctions.displaysectionstart(data, page_info) %>  <table id="list" class="tablesorter"><thead>  	<tr>  		<th>Action</th> @@ -33,11 +33,18 @@ html = require("acf.html")  		<th>Remote Mailbox / Domain</th>  	</tr>  </thead><tbody> +<% local redir = cfe({ type="hidden", value=page_info.orig_action }) %>  <% for i,entry in ipairs(data.value) do %>  	<tr>  		<td> -			<% io.write(html.link{value = "editentry?remotehost=" .. entry.remotehost.."&method="..entry.method.."&remotemailbox="..entry.remotemailbox.."&localdomain="..entry.localdomain.."&redir="..page_info.orig_action, label="Edit " }) %> -			<% io.write(html.link{value = "deleteentry?submit=true&remotehost=" .. entry.remotehost.."&method="..entry.method.."&remotemailbox="..entry.remotemailbox.."&localdomain="..entry.localdomain, label="Delete " }) %> +			<% +			local remotehost = cfe({ type="hidden", value=entry.remotehost }) +			local entrymethod = cfe({ type="hidden", value=entry.method }) +			local remotemailbox = cfe({ type="hidden", value=entry.remotemailbox }) +			local localdomain = cfe({ type="hidden", value=entry.localdomain }) +			htmlviewfunctions.displayitem(cfe({type="link", value={remotehost=remotehost, method=entrymethod, remotemailbox=remotemailbox, localdomain=localdomain, redir=redir}, label="", option="Edit", action="editentry"}), page_info, -1) +			htmlviewfunctions.displayitem(cfe({type="form", value={remotehost=remotehost, method=entrymethod, remotemailbox=remotemailbox, localdomain=localdomain}, label="", option="Delete", action="deleteentry"}), page_info, -1) +			%>  		</td>  		<td><%= html.html_escape(entry.remotehost) %></td>  		<td><%= html.html_escape(tostring(entry.enabled)) %></td> @@ -47,10 +54,6 @@ html = require("acf.html")  <% end %>  </tbody></table> -<div class='item'><p class='left'>Add new entry</p> -<div class='right'> -<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/createentry") %>" method="post"> -<input class="hidden" type="hidden"  name="redir"  value="<%= html.html_escape(page_info.orig_action) %>" > -<input type=submit value="New" class="submit"> -</form> -</div></div><!-- end .item --> +<% htmlviewfunctions.displayitem(cfe({type="link", value={redir=redir}, label="Add new entry", option="New", action="createentry"}), page_info, 0) %> + +<% htmlviewfunctions.displaysectionend(header_level) %>  | 
