We are looking at IMCE to help manage file uploads in an OpenPublish based Drupal site. This site is also going to make heavy use of Organic Groups to help separate content, and manage authoring permissions.
In the IMCE configuration, I see how to add directory paths that a user can access, and I also see how to add PHP to help determine these directory paths. However, I would like to include a directory path for the group(s) this node is posted in, and I'm not able to figure out how to do that. For example, if the node in posted in a Group called Basketball (with a group id of 302), I'd like to include a path like 'groups/Basketball' or 'groups/302'.
I'm not figuring out how to use PHP to get this group ID name or id. What PHP would I include to do this?