[pmwiki-devel] AddDeleteLine...
Nils Knappmeier
nk at knappi.org
Sun Nov 5 06:15:07 CST 2006
Hi Petko,
> Hey, Nils,
>
> I keep working with your script and made some more changes. Sending you my
> current version, as it is now.
>
> The most important change is for the function AdlTemplateMarkup(): changed
> from htmlentities() to htmlspecialchars(). You should absolutely change this
> one because otherwise the page breaks if the site is not in latin-1 encoding
> (for example UTF-8). This changes nothing to the current functionnality.
Sounds reasonable.
> Other changes that I made are big changes so that the current ADL "alpha"
> works with the latest pmwiki beta, AND with
> $EnableRelativePageVars = 1;
> (see http://pmwiki.org/wiki/PmWiki/ReleaseNotes )
>
> 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?
> 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).
I have not uploaded the changes yet.
Nils
PS: I hope you don't mind that I sent the answer to the pmwiki-devel
list. But there may be more interested persons.
More information about the pmwiki-devel
mailing list