[pmwiki-devel] Group.Name pattern
Hans
design5 at softflow.co.uk
Fri Dec 8 14:17:53 CST 2006
Friday, December 8, 2006, 7:11:33 PM, Patrick wrote:
> ...FmtPageName is your friend!
> MatchPageNames($targetpage, FmtPageName('{$Group}.*', $pagename))
Thanks so much! I nearly got it all working now.
But I don't know how to include exclusion patterns.
I got this code, as part of a permission function:
$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'
// 'Comments.*', // all pages in Comments group
// '*.*', // all pages!!!
);
foreach ((array)$CommentNameFmt as $n) {
if(MatchPageNames($targetname, FmtPageName($n, $pagename)))
return $CommentPermission=1;} //allow
}
so adding '-$SiteGroup.*' to the array does not work since it is
looking for one allowed match, and if it finds one, its done.
Do I need to run a match on an exclusion pattern array first?
Hans
More information about the pmwiki-devel
mailing list