From 52ad6edf74ca2e903972849b6a47a14786520449 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Wed, 22 Oct 2008 18:50:22 +0000 Subject: Modified viewfunctions to split displayform, creating displayformstart and displayformend, to provide flexibility while still using the library. Also added support for hidden fields - including a common redir field. Removed redirectOnSuccess from controllerfunctions handle_form, and replaced it with the redir field. Removed redirectOnSuccess from controllers that used it and added handlecommandresults and redir entries to links and forms throughout many views. This will cause a redirect to the originating view when a form is successfully completed. acf_www-controller now includes orig_action in page_info to report the original action launched by the user. git-svn-id: svn://svn.alpinelinux.org/acf/dansguardian/trunk@1560 ab2d0c66-481e-0410-8bed-d214d4d58bed --- dansguardian-general-html.lsp | 13 ++++--------- dansguardian-html.lsp | 6 ++++-- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/dansguardian-general-html.lsp b/dansguardian-general-html.lsp index e7bd1af..0873344 100644 --- a/dansguardian-general-html.lsp +++ b/dansguardian-general-html.lsp @@ -1,6 +1,6 @@ <% require("viewfunctions") - local form, viewlibrary = ... + local form, viewlibrary, page_info = ... %> <% @@ -15,11 +15,10 @@ io.write("") viewlibrary.dispatch_component("status") end %> -

Configuration

<% - if form.descr then io.write('

' .. string.gsub(form.descr, "\n", "
") .. "

\n") end - if form.errtxt then io.write('

' .. string.gsub(form.errtxt, "\n", "
") .. "

\n") end + form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action + displayformstart(form) for field,val in pairs(form.value) do val.name = field end @@ -63,11 +62,7 @@ The author recommends 50 for "young children", 100 for "older children" and 160

Save Changes

-
-
-
- -
+<% displayformend(form) %> <% if viewlibrary and viewlibrary.dispatch_component then viewlibrary.dispatch_component("startstop") diff --git a/dansguardian-html.lsp b/dansguardian-html.lsp index 83b17eb..824ba19 100644 --- a/dansguardian-html.lsp +++ b/dansguardian-html.lsp @@ -1,4 +1,4 @@ -<% local view, viewlibrary, page_info = ... +<% local view, viewlibrary, page_info, session = ... require("viewfunctions") %> @@ -10,6 +10,8 @@ io.write("") --]] %> +<% displaycommandresults({"edit"}, session) %> + <% if viewlibrary and viewlibrary.dispatch_component then viewlibrary.dispatch_component("status") end %> @@ -24,7 +26,7 @@ end %> <% for k,v in ipairs( view.value ) do - io.write( "" .. v.filename .. "" .. v.size .."" .. v.mtime .."\n" ) + io.write( "" .. v.filename .. "" .. v.size .."" .. v.mtime .."\n" ) end %> -- cgit v1.2.3