[pmwiki-users] Next Step in Customized Form . . .
Patrick R. Michaud
pmichaud at pobox.com
Fri Jul 22 12:50:55 CDT 2005
On Fri, Jul 22, 2005 at 08:07:54AM -0500, Benjamin Wilson wrote:
> Okay, I have a custom form that allows a user to add data (specifically
> metadata for an uploaded document) which works essentially like PITS.
> What I would like is a way to bypass the intermediate edit page and go
> straight to the finished page. In a nuthshell--how?
1. If you want PmWiki to handle it exactly as if the user had pressed
the "Save" button in an edit form, then set $action='edit',
$_POST['post']=1, and $_POST['text'] to the resulting text,
and leave it to HandleEdit() to take care of it. This is what
PITS does to handle updates (except PITS is currently not setting
$_POST['post'] to 1, so the edit form is being displayed instead
of actually saving the data).
2. If you just want to save a page including page history, then
duplicate the call that HandleEdit() typically makes to PostPage().
This will not update RecentChanges, however.
3. If you don't care about page history, then you can call WritePage()
directly, with $page['text'] set to the saved text.
More information about the pmwiki-users