[pmwiki-devel] UpdatePage and HandleEdit

Hans design5 at softflow.co.uk
Mon Dec 11 12:57:50 CST 2006


I am trying to understand the interaction of a few PmWiki bits:

The new UpdatePage function, so it says, calls all the EditFunctions
in turn, which will do their respective bits. I can call it pretty
well from a recipe script and have a new page created, updated and
saved, without need for action=edit, or use of HandleEdit.

HandleEdit is called through action=edit, and will open a page, if
allowed, in a textarea inside the edit form, templated by the EditForm
page.

Now I can build some cool form markup, for instance a templated page
to post new blog entries, with bells and whistles, and use UpdatePage
in the script to save all the post, textarea with blog content and
other fields to create a new blog page. Bypassing HandleEdit.

The Editfunctions array is defined thus:
$EditFunctions = array('EditTemplate', 'RestorePage', 'ReplaceOnSave',
  'SaveAttributes', 'PostPage', 'PostRecentChanges', 'AutoCreateTargets',
  'PreviewPage');

So using UpdatePage from within a recipe script how can I trigger
a page preview? And how can I direct the new page (before it is saved)
to the EditForm textarea instead of saving it? How do HandleEdit and
UpdatePage link?


 Hans




More information about the pmwiki-devel mailing list