[pmwiki-users] Misc FAST Data questions

Patrick R. Michaud pmichaud at pobox.com
Tue Sep 12 14:06:46 CDT 2006


On Tue, Sep 12, 2006 at 01:56:48PM -0400, The Editor wrote:
> Hi list,
> 
> I have a couple fun questions about some features I'm wanting to build
> into FAST Data that I thought perhaps others might have some insight
> on.  Most of these are from past posts that I was never able to get
> fully solved.  Trying to tackle them now!
> 
> 1) Multiple buttons.
> Suppose I wanted to have multiple buttons on a form, one perhaps to
> preview a post, one to actually make  a post, and one to discard (or
> some other set of choices).  While I can do any of these things with a
> single submit button--how do I distinguish between which button is
> pushed?  Right now I process the form info using a line like the
> following succeeded by a bunch of specific if statements:
> 
> 	foreach ($_POST as $field => $value) {

That's effectively the easiest way to do it.  You can give each
button the same name with a different value and figure it out that
way, but this doesn't work well for i18n (which is why PmWiki actually
uses separate names for each button and checks them individually).

> 2) Passwd's and authentication.
> Could anyone
> explain what variables I need to pass into AuthUserId() and whether or
> not I need to still use AuthUserId()?  Here's my existing relevant
> code:

[code was missing in post]

> 3) Upload and action problem
> Assuming I properly set the fields for "uploadfile" and
> "upname" elsewhere in the form, is there some function I can call
> within the recipe directly by some hidden field flag, like:

If all of the necessary fields are present, you can just call
HandlePostUpload() directly from your function:

    HandlePostUpload($pagename);

Pm




More information about the pmwiki-users mailing list