From 77a0025e476071c0016383328cce59259c7fbacb Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Thu, 10 Apr 2014 06:21:29 +0000 Subject: Changes to use new htmlviewfunctions functions --- fetchmail-config-html.lsp | 14 ++++++-------- 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 %> -

Global Settings

-

Edit global settings

-
-
" method="post"> - - -
-
+<% +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) %> -

Edit/View Fetchmail Entries

+<% local header_level = htmlviewfunctions.displaysectionstart(data, page_info) %> @@ -33,11 +33,18 @@ html = require("acf.html") +<% local redir = cfe({ type="hidden", value=page_info.orig_action }) %> <% for i,entry in ipairs(data.value) do %> @@ -47,10 +54,6 @@ html = require("acf.html") <% end %>
ActionRemote Mailbox / Domain
- <% 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) + %> <%= html.html_escape(entry.remotehost) %> <%= html.html_escape(tostring(entry.enabled)) %>
-

Add new entry

-
-
" method="post"> - - -
-
+<% htmlviewfunctions.displayitem(cfe({type="link", value={redir=redir}, label="Add new entry", option="New", action="createentry"}), page_info, 0) %> + +<% htmlviewfunctions.displaysectionend(header_level) %> -- cgit v1.2.3