[pmwiki-users] PreviewChanges: Show only on demand?
Oliver Betz
list_ob at gmx.net
Tue Feb 11 02:18:51 CST 2014
Petko Yotov wrote:
>You can add a checkbox to Site.EditForm like this:
>
> (:input checkbox previewchanges:) Preview changes
>
>Then in config.php, use:
>
> if(@$_REQUEST['previewchanges']>'')
> include_once("$FarmD/cookbook/previewchanges.php");
since it takes two clicks to get the diff each time (the checkbox
state isn't preserved), I decided to use the button version.
>To have a new button instead of a checkbox, in Site.EditForm:
>
> (:input submit preview "Show changes":)
>
>Then in config.php:
>
> if(@$_REQUEST['preview']=='Show changes') # same label as the button
> include_once("$FarmD/cookbook/previewchanges.php");
Looking at forms.php (and not 100% understanding), I just was not sure
whether there are side effects.
>> BTW: forms.php contains code for "e_resetbutton", does anybody know
>> what it is good for?
>
>If a "reset" button is pressed, all form fields are reset to their default
>content (before any changes).
Thanks, I should have looked at forms.php before asking.
Oliver
--
Oliver Betz, Munich http://oliverbetz.de/
More information about the pmwiki-users
mailing list