[pmwiki-users] Preventing variable replacement

DaveG pmwiki at solidgone.com
Tue Feb 10 21:54:54 CST 2009


Hans wrote:
> 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.
Thanks, that helped. It took me a while, but it looks like the call to 
MarkupToHTML() is the thing replacing variables, which makes sense.

What I'm looking for is a way to prevent variable substitution -- so I 
could overwrite the markups that perform that function. It seems like 
that's a little heavy handed though, as HandleEdit() calls 
MarkupToHTML() to get $form['text'] and somehow variables are not 
substituted when shown in the normal edit box.

> 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.
At this point I'm trying to keep the code focused around the PmWiki core 
for the functionality I'm looking for. I'm also trying to minimize 
rewriting parts of PmWiki. PmForms is working pretty well -- I just need 
a way to prevent variable substitution for a field, so that when it's 
displayed by PmForms, the user sees the variable name, not the value of 
the variable.

  ~ ~ Dave



More information about the pmwiki-users mailing list