[pmwiki-users] Fwd: Passing Variables in a Markup

The Editor editor at fast.st
Wed Mar 22 21:17:36 CST 2006

Thought I'd try again (revised) and see if anyone might be able to
help with this (posted it once before). I read somewhere the best work
gets done at night.  Maybe!


---------- Forwarded message ----------
From: The Editor <editor at fast.st>
Date: Mar 22, 2006 2:15 PM
Subject: Fwd: [pmwiki-users] Passing Variables in a Markup
To: pmwiki-users at pmichaud.com

After examining the PmWiki documentation on Markups I tried to change
my script to accept an optional nextpage variable, as follows.  Here
is the original script:

Markup('htpasswdform', '<split', '/\\(:membership:\\)/ei',
function HtpasswdForm($pagename) {
 global $HtpasswordAuth, $HtpasswordUsrAuth, $AuthId;

I tried:

Markup('htpasswdform', '<split', '/\\(:membership (\\d+):\\)/ei',
function HtpasswdForm($nextpage,$pagename) {
 global $HtpasswordAuth, $HtpasswordUsrAuth, $AuthId;

It didn't seem to work.

I also have some questions on the original markup the documentation
didn't seem to answer:

Why does the original script have "ei", rather than just e for the
$when parameter?

Why is "d+" suggested in the docs to stand for an input parameter?

In the recipe, it looks like $pagename is global but not declared. 
Will $nextpage by the same?  i.e. Can I drop it into any of the
functions, anywhere?

Will this parameter ($nextpage) be optional--or required. And if it is
not supplied, would not $pagename pass into $nextpage when it calls
the function? If so, how do I work around.

Thanks for any help. It's starting to make more sense, but it's coming slow.


More information about the pmwiki-users mailing list