diff options
author | Ted Trask <ttrask01@yahoo.com> | 2008-10-22 18:50:22 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2008-10-22 18:50:22 +0000 |
commit | 8997f1f6dc27262042a30c35266a95672e4406d4 (patch) | |
tree | 548e8a666a7aa8f6e39e76e47b0c150d44dd92f1 /app/acf_www-controller.lua | |
parent | 7106e09511f1b873eaae17d2a6ae8bf008d06446 (diff) | |
download | acf-core-8997f1f6dc27262042a30c35266a95672e4406d4.tar.bz2 acf-core-8997f1f6dc27262042a30c35266a95672e4406d4.tar.xz |
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/core/trunk@1560 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'app/acf_www-controller.lua')
-rw-r--r-- | app/acf_www-controller.lua | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/acf_www-controller.lua b/app/acf_www-controller.lua index 5f5abcd..3587578 100644 --- a/app/acf_www-controller.lua +++ b/app/acf_www-controller.lua @@ -134,6 +134,7 @@ local dispatch_component = function(str, clientdata, suppress_view) end self.conf.component = true self.conf.suppress_view = suppress_view + self.conf.orig_action = self.conf.orig_action or self.conf.prefix .. self.conf.controller .. "/" .. self.conf.action local tempclientdata = self.clientdata self.clientdata = clientdata or {} self.clientdata.sessionid = tempclientdata.sessionid @@ -200,7 +201,8 @@ local view_resolver = function(self) script = self.conf.script, appname = self.conf.appname, skindir = self.conf.skindir or "", - skin = self.conf.skin or "" + skin = self.conf.skin or "", + orig_action = self.conf.orig_action or self.conf.prefix .. self.conf.controller .. "/" .. self.conf.action } return func, viewlibrary, pageinfo, self.sessiondata @@ -453,7 +455,10 @@ end -- Cause a redirect to specified (or default) action -- We use the self.conf table because it already has prefix,controller,etc -- The actual redirection is defined in exception_handler above -redirect = function (self, str) +redirect = function (self, str, result) + if result then + self.sessiondata[self.conf.action.."result"] = result + end local prefix, controller, action = self.parse_path_info("/" .. (str or "")) if prefix ~= "/" then self.conf.prefix = prefix end if controller ~= "" then self.conf.controller = controller end |