[pmwiki-devel] Group.Name pattern

Hans design5 at softflow.co.uk
Fri Dec 8 15:20:31 CST 2006

Friday, December 8, 2006, 8:59:28 PM, Patrick wrote:

>   $CommentNameFmt = array(
>       '{$Group}.*',          // all pages in current group    
>       '*.{$Name}-Comment',   // pages with -Comment prefix in any group
>       '{$FullName}-Talk',    // page with -Talk prefix in current group
>       '{$FullName}-Discuss', // page with -Discuss prefix in current group
>       'Comments.{$Group}-{$Name}', //pages in Comments with name 'Group-Name'
>       '-$SiteGroup.*'        // no pages in SiteGroup
>   );

>   $CommentPermission = 
>     (boolean)MatchPageNames($targetname,
>                             FmtPageName(implode(' ', CommentNameFmt),
>                                         $pagename));

Wonderful! This is an enormous reduction in code for me.
I cut out one entire function and some arrays!

I suppose to be super friendly to admins I should give keys
to all of the default patterns, so they can easier be cancelled from
a local config file (like $CommentNameFmt['current'] = '';)
 SDVA($CommentNameFmt, array(
   'current' => '{$Group}.*',

Thanks Patrick for all your help, I learned a great deal!


More information about the pmwiki-devel mailing list