[pmwiki-users] Group name variables
Patrick R. Michaud
pmichaud at pobox.com
Tue Jan 24 10:30:53 CST 2006
On Tue, Jan 24, 2006 at 05:12:08PM +0100, Tim Ahrentlov wrote:
> Hi,
>
> I need to check for group names (like site, main, etc) in config.php Are
> there some variable in which this group name resides? Just like the action
> is stored in $action? I've tried various variables I spotted as likely
> candidates in pmwiki.php but no dice.
There's not a variable that contains it, but you can obtain the
group name of any page by using:
$group = PageVar($pagename, '{$Group}');
Note that this doesn't work if $pagename is empty or not a true
pagename in the form "Group.Name".
Starting with beta21, the ideal sequence will be something like:
$pagename = InitPageName($pagename);
$group = PageVar($pagename, '{$Group}');
which will first resolve $pagename to its "correct" value
(based on $DefaultPage, $DefaultGroup, UTF-8 settings, etc.)
and then obtain the group.
Pm
More information about the pmwiki-users
mailing list