Hi,

Am 25.04.2015 um 18:50 schrieb Wolfgang Faust:> PPRA() checks if the 
replacement is a callable, and uses
> preg_replace_callback if necessary. Instead of using /e in the pattern,
> make the replacement an anonymous function, like so:
> $MakePageNamePatterns = array(
>      "/([\\w])+/" => function($match) {
>         return strtolower($match[1]); # all lowercase
>     },
>     "/\\s+/" => ''                          # remove spaces
> );


Great, that was it:

$MakePageNamePatterns = array(
     "/(^\w)(\w+)/" => function($match)
     {
           return strtoupper($match[1]).strtolower($match[2]); # all lowercase, 
except first character
     },
    "/\\s+/" => ''                          # remove spaces
);


To fix already existing pages in directory wiki.d ==>
for i in $(ls -1); do mv $i  $(echo $i | sed -e 
's/Main\.\(\w\)\(.*\)/Main.\U\1\L\2/g'); done;


To fix special pages (hard coded anywhere ???) ==>
ln -s Main.Sidebar Main.SideBar


Now there is still a small issue with the PmWiki.* and Site.* pages,
but i think you could fix it with a small script that creates a link for every 
of this pages.


thx and greets 

  Bernd





Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users

Reply via email to