[pmwiki-devel] PmWiki request

The Editor editor at fast.st
Tue Dec 12 09:11:42 CST 2006


On 12/12/06, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> On Tue, Dec 12, 2006 at 09:24:26AM -0500, The Editor wrote:
> > On 12/12/06, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> > >Seems to me that
> > >
> > > (:if exists parameter:)(:input hidden action:)(:if:)
> > >
> > >is only few characters longer but more consistent.  Plus you
> > >get complex expressions for free.
> >
> > Actually this is not equivalent to what I'm wanting to do at all.
> > (This was also Hans misunderstanding I believe).  What I want to do
> > rather is perform certain ZAP functions AFTER the form submits based
> > on the values entered.  It has nothing to do with markup.
>
> Is "(:input ifexists ... :)" something you'd expect an author
> to enter somewhere?  If yes, then it's "markup", regardless of
> when it is processed.
>
> Does "(:input ifexists ...:)" generate a form control of some sort
> in the output HTML?  If no, then to avoid author confusion it
> probably should begin with something other than "(:input ...".
>
>
> Personally, I'm thinking this should be called "(:zapcheck ...:)",
> because it's asking ZAP to do some sort of form verification
> of the form values before proceeding with a POST.  It's definitely
> not generating an input control, which is what we want authors
> to think when they see "(:input:)".  So perhaps...
>
>    (:input exists newpage:)
>    (:zapcheck exists newpage warn="Page already exists":)
>
> Multiple conditions also read more nicely, and make it explicit
> as to what we're doing:
>
>    (:input exists newpage:)
>    (:zapcheck exists newpage   warn="Page already exists"    :)
>    (:zapcheck date 20061225..  warn="Can't post after Dec 25":)
>    (:zapcheck ! authid         warn="Must be logged in"      :)
>
> But the fundamental idea remains the same -- since what you're
> talking about is not generating an input control, it should be
> called something other than "(:input:)".
>
> (I think this is what Hans is referring to when he says that
> you've "hijacked" PmWiki's (:input:) markup -- he doesn't
> mean that you're changing the way the existing (:input:) markup
> works, he means that you're giving it new functions that are
> substantially different from the previous ones.)
>
> Pm



Oh, I see where the confusion is.  It's my mistake.  I inadvertantly
left out the input type.  The example I gave should have looked
something like this:

(:input hidden ifexists "parameter|action":)

"ifexists" is just the field name.  "parameter|action" is just the
field value.  There's no new markup used at all in this.  It's
strictly a regular form field that triggers a special post-submission
check in zap and possible action, if it happens to be in a zap form.

Hope this clarifies it.  Will let you know if the testing works out
like I hope...

Cheers,
Dan



More information about the pmwiki-devel mailing list