[pmwiki-users] [powertools] questions, ...
Stéphane Heckel
hsteph at club-internet.fr
Mon Mar 31 13:49:34 CDT 2008
"Stéphane Heckel" wrote :
> - I didn't find a way to produce a list of groups only ?
Hi Hans, I have implemented a quick & dirty {(glist)} "get list of all
groups", ...
Feel free to tune/implement the way you want in powertools if it makes
sense.
SH
/----------------------------------------------------------------------------/
$MarkupExpr['glist'] = 'MxMakeGList($pagename, @$args, @$argp)';
function MxMakeGList($pagename, $args, $opt='') {
if ($args[0]=='' && $opt=='') return $pagename;
$pagelist = ListPages();
$grouplist = array();
foreach($pagelist as $pagename) {
$groupname = FmtPageName('$Group',$pagename);
$grouplist[$groupname] = $groupname;
}
sort($grouplist);
$sep = (@$opt['sep']) ? $opt['sep'] : ",";
$sep = str_replace('\n',"\n",$sep);
$sep = str_replace('\r',"\r",$sep);
if ($sep=='LF') $sep = "\n";
if ($sep=='CRLF') $sep = "\r\n";
return implode($sep, $grouplist);
}
More information about the pmwiki-users
mailing list