[pmwiki-users] Preventing variable replacement

Hans design5 at softflow.co.uk
Sun Feb 8 08:21:47 CST 2009

Saturday, February 7, 2009, 7:33:59 PM, DaveG wrote:

> In order to handle editing, I use a new action (action=bloggeredit), and
> include a call to PmForms in the header. That way all the PTVs get 
> placed into PmForm form elements. Works fine. Except that variables in
> the PTVs end up being evaluated (since as far as PmWiki is concerned 
> we're viewing the page).

Have a look at the HandleEdit function in pmwiki.php (?action=edit
calls this).
Don't be confused by the UpdatePage call right in the middle, and the
edit form loading at the end. When it runs first, $IsPagePosted is
false, nothing gets posted and the edit form gets loaded, with the
textarea value supplied by $EditText. The edit form gets marked up to
HTMl, and PrintFmt does the display job.

I copied some of these ideas when I created FoxEdit.
You probably could use FoxEdit as a mechanism to load an edit form.
It is designed to load an edit form, and it could be a PTV edit form,
with data taken from the page. It does not need Fox as form
processor, PmForms should work as well. FoxEdit does not care who
will process the data posted with the edit form. The script adds
markup to specify {[foxedit  ..]} links, in which one can specify
which edit form gets called, and possibly on what section or single
PTV it should work, or what ID to use.

Maybe you can use it, or maybe it gives you some ideas for your own.


More information about the pmwiki-users mailing list