Forum OpenACS Development: forums: message/post

Collapse
Posted by Malte Sussdorff on
I have the forums message/post code changed to use ad_form to adhere to new standards. Now I need some heavy user to take a look at it as I don't want to commit right before a .LRN release.

Furthermore I found the ultimate double click protection thanks to Dave. I disable the button after submitting. Sadly this breaks template::form::get_button, which, funny as it is , is only used by forums message/post.

So noone seems to make use of the functionality to have multiple edit buttons (OK/Cancel work just fine) and depend the action on the name of the formbutton.

Not sure what I should do about it now. My code just assumes that post is the standard behaviour for forum postings and be done with it. Double Click protection is considerably more important with the number of callbacks and workflow actions that happen on the production system.

But how can I make this useful for OpenACS? The easiest way would be to have a preview (yes/no) switch. Alternatively write my own submit button without the form builder. Or change my switch to explicitly exclude the double click protection when posting in forums (if name = post / preview).

Collapse
2: Re: forums: message/post (response to 1)
Posted by Dave Bauer on
Malte,

I use the ability to have multiple buttons in a bunch of places with ad_form.

In this case ad_form creates a varaible named after the button so you can just say "if {$button ne ""} { do something }
instead of calling template::form::get_button

Collapse
Posted by Malte Sussdorff on
Dave,

sadly for this to work, ad_form still needs to be able to access the button. But it is not, due to the fact that the javascript has disabled it (just confirmed, does not work). Maybe I should rewrite formbuilder to do this:

- create a hidden form variable "button" for every form
- Change any submit button to set the hidden variable to the value of the button pressed using Javascript.
- Then disable the button.
- Then submit the form.
- Have ad_form set the variable to the passed in button.

Collapse
3: Re: forums: message/post (response to 1)
Posted by Carl Robert Blesius on
A preview button used to be the only option (to promote people actually reviewing what they wrote). The absence of this option is something that a lot of people have complained about in the context of our ticket tracker, so if you remove one of the buttons Malte, please remove the "Post" option on the first page and fix the Post button on the next (preview) page.
Collapse
Posted by Malte Sussdorff on
I committed the code now with the default action (if no action was passed in) set to preview. It works on our site with or without the double click protection. Tracy, thanks for your offer, could you take a look at it? Especially with regards to anonymous postings.
Collapse
4: Re: forums: message/post (response to 1)
Posted by Tracy Adams on
Malte,

I'd be glad to look at it/work withyou on this.