[pmwiki-devel] PmWiki request

Patrick R. Michaud pmichaud at pobox.com
Tue Dec 12 08:50:17 CST 2006


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



More information about the pmwiki-devel mailing list