Organic Groups API?
Where within the realm of Organic Groups (D6) can I find a few functions that do the following:
- Retrieve a list of all Groups
- Retrieve a list of Features for each Group (when iterating Groups)
- Grab links for Groups & Features, checked against menu acc开发者_如何学Pythoness for current user
I am looking through the code, but not really seeing what I am looking for- or maybe I saw it and didn't realize it.
I am trying to build a custom navigation based on Groups and want to construct my own menu structure instead of have all groups, and all said groups features, be in a Drupal managed menu (upwards of possibly 20 groups, a lot to manage).
og_all_groups_options() will get you a list of all the groups. I think the features info is held in the og_features
table in the settings
column so you could get the data using the group node's nid
in each of your loop's iterations
You can use the l function to build up your link with an access check using like this:
if (og_is_group_member($group->gid)) {
$link = l($group->title, "node/nid");
}
Hope that helps
精彩评论