[pmwiki-devel] AddDeleteLine...

Petko Yotov 5ko at free.fr
Sun Nov 5 06:39:04 CST 2006


> > You may not wish to have these changes now, but I have them so take a
> > look what I did (do a diff). Briefly: change from the page name to
> > {$FullName} inside (:adl delete:).
> >
> > Why I did that: because I am moving old/outdated page contents with a
> > script and then the "delete" command stops working. With {$FullName} it
> > works. It will not work if a page is (:included:) and
> > $EnableRelativePageVars is not set to 1. But this will be the default
> > pmwiki setting in a while so I am doing this in anticipation.
>
> I see. Maybe I can include this as a configuration option. Is PmWiki 2.2
> still beta?

Yes it is.

>
> > Another, less important change is that one can add page variables in the
> > template and they will not be processed as an ADL input. That is, if in
> > the template we have {$Group},  ADL will  output {$Group} and not an
> > empty string.
>
> That seems reasonable too. I would even say, this was a bug, because
> {$Group} is not a form field. What's the meaning of {[...} ?   Your
> regex here is: /\{([^\[\$\*]*?)\}/ which forbids {[ and {$ and {* at any
> place in the field name. Doesn't that screw up array fields like
> {name[]}. I'd rather go with /\{([^\$\*].*?)\}/ or /\{([^\[\$\*].*?)\}/
> (for identifying the field names in the template text).

Well, in the AdlTemplateEngine() you first check for {field} and then, below, 
for {field[]}, so I only changed the first time, to exclude {$PageVar} or 
{Page$PageVar}. 

It was, if I recall,  /\{([^\[]*?)\}/ so I only added $ and *.

Actually, it may be usefull to have some possibility of "escaping" template 
strings, if I wish to insert in the target page {something} without being 
processed or cleared. Imagine: in your template there is already another 
(:adl form:) ready to fill the new page. I didn't have the time to write it, 
but seems worth doing it.

Petko



More information about the pmwiki-devel mailing list