[pmwiki-devel] UpdatePage and HandleEdit

Hans design5 at softflow.co.uk
Mon Dec 11 13:51:22 CST 2006


Monday, December 11, 2006, 7:37:27 PM, Patrick wrote:

> In short, if you want to be doing page preview to the browser, you 
> have to either use HandleEdit or write your own handler that does it.

>> And how can I direct the new page (before it is saved)
>> to the EditForm textarea instead of saving it? 

> FWIW, PITS (which has a form that then becomes an edit page) simply
> manipulates fields into $_POST['text'] and then calls HandleEdit().

>> How do HandleEdit and UpdatePage link?

> The basic flow of HandleEdit:
>   1. Retrieve existing page and check permissions
>   2. Update new version of page with fields from $_POST
>   3. Call UpdatePage() to update page
>   4. If page was successfully posted, redirect browser to view page (and exit)
>   5. If page wasn't posted, then display the edit form (including any
>      preview) and exit

Thank you so much for explaining! It's a lot clearer now for me.
I was a bit lost in the code....


Hans




More information about the pmwiki-devel mailing list