From: Michael P. <mp...@pl...> - 2007-03-19 15:34:09
|
Krang has lots of places where there is a Return button to go back to a previous screen, but the mechanism to employ this is re-implemented in each place it's used and doesn't function properly in some (try searching for a site, viewing that site and then clicking "Return". Your search is lost). We also have a pretty large extension to which we'd like to put more "Return" buttons in various places so I've been thinking about a way to make it more general and implemented in the same throughout. It might go something like this: + If a page is shown that has actions from which we would like to return, the controller adds the krang_return_params which are a series of hidden inputs that contain the name/value pairs to remember. (Since this is probably going to be used all of the place it would be a shared method in Krang::CGI) + If an action is taken on a form of class "returnable" it's first sent to our return handler (Krang::CGI::Return?) which will store the krang_return_params in the user's return "stack" as a save point before redirecting to their chosen destination. (The magic of using class names and funnelling the request to Krang::CGI::Return is similar to the class="ajax" magic in the ajax_and_new_skin branch) + Returning to a previous page is as simple as going to the right run mode of Krang::CGI::Return which any "Return" button will then submit to. Thoughts? -- Michael Peters Developer Plus Three, LP |