I'm working on subgroups module. I want to maximize compatibilities with other modules, so I'm basing it on organic groups, though I think there are some key differences in application: The "view" page of an organic group node shows other nodes and a welcome message. I define a "group" to mean a set of people and subgroups (possibly with "role" text assigned to each), so by this definition the "view" of a group shows the tree that defines the group. Similarly, "edit" allows one to add and remove users

I'd like organic groups to be used to define access control lists to various data and actions throughout a drupal site. I'd also like web services on sites that aren't hosting a given group to have some access to group definitions. This might require OpenIDs for members, URLs that represent groups, and sharing an XML roster of a group at that URL for other sites to use - possibly restricted somehow in some cases. This should probably be a separate module from the subgroups module, but play well with groups and subgroups.

The real-life groups for which I'm inspired to code have members who I'd like listed, but who won't be users of the site immediately, or possibly ever. Therefore, a "missing users" feature set is important. This should probably be a separate module from organic groups and organic subgroups, but it should play well with them, as invite codes for missing users to assume an identity should only be generated by appropriate existing users.

I like that mailing lists are tied to forums in og2list, but I don't like that ogs are tied to forums. I'd like to use (dedicated) groups (with appropriate subgroups) to define who's allowed to web-view, RSS, web-post, subscribe, and email-post to a list/forum, but to have list/forum existence be distinct from a groups otherwise. This goes against the current structure of og2list, though, and therefore I'm not sure how compatible an idea it is. I'd either like to get involved in og2list with this in mind, or else build a somewhat redundant module.

So far, I've thrown together a module which has the "view" feature described in the first paragraph above. Subgroups still needs to be edited using the admin taxonomy tools, so I have to build the edit feature still. Shouldn't be too hard. Are there philosophical reasons why it's bad for me to be overriding load order to change what the "view" page has for a group node?

I also think CSS+Javascript should be used to control expansion within the tree view without requiring a page reload. I've coded such things elsewhere, but I haven't seen much functionality like that in Drupal, and I'm curious if there are philosophical reasons why I should not implement that GUI feature.

Comments

mwu’s picture

Don,
thanks for this post. I'm excited to hear about what you are working on.

This is what I'm looking for. A relatively simple enhancement to og that allows a workable interface for posting. I'm using a patch that allows people to post to groups they are not a member of. I could in theory have up to 100 or 1000 groups. clearly that's workable only if the display is nested. (the groups would be nested also). I was thinking of only 1 or 2 levels deep but I guess that really depends on the ultimate number. On the other hand, users will not enjoy going more than 2 levels down (for a total of 3 levels.)

I was thinking primarily about nodes, but I guess I'll probably need forums too.

I was not planning to interface with other sites so I don't need OpenID. although I suppose it's possible I could create multiple sites and use OpenID among them. I can see uses for that.

in terms of using javascript, I've been reading security books that say javascript should be completely disabled in high security environments. it's too easy for attackers to insert their own javascript. Do you know anything about that? My preference would be to not use javascript for security reasons, but perhaps this kind of javascript is okay (analogous to same way that drupal comes with filtered html).

I want a pretty secure site so if javascript is a security problem I may not use any modules that employ javascript.

What other options might there be for displaying the groups?

donengel’s picture

Mariun,

I noticed that the 'edit' pages of nodes already do what I describe, what I was worried was non-drupal like - they expand and contract without a reload. I'll look at the code for how that's done, and use a similar method for expanding/contracting group trees. That way, any security concerns about Javascript from this module are muted, because the overall code will be doing something it already does anyway (good or bad).

mwu’s picture

sounds great. I don't know what you are referring to, but that makes sense to me.

I guess I thought of admin -- settings as having this functionality as well.

please post when you figure out how it's done (before you are done coding). thank you.

donengel’s picture

It turns out the collapsing done in the "edit" tabs is done with Javascript:

http://api.drupal.org/api/4.7/function/theme_fieldset

killes@www.drop.org’s picture

I am not sure you will be able to implement everything that you want in the og framework, but I think you should at least try.

Several points (such as the og2list to forum interaction) are relatively minor. Members who are only listed could have a blocked user account.

there has been previously some interest in hierarchical groups:
http://drupal.org/node/28227

I even have had a patch but don't seem to be able to find it now...

--
Drupal services
My Drupal services

donengel’s picture

If the patch turns up, it would be great to see it. In the meantime, I've attempted (I think successfully) my first use of CVS (ever) and Drupal CVS (in particular) to post my first attempted contribution to Drupal... I'll definitely appreciate feedback on style, content, process, features, etc. It's a module called og_subgroups. I've also just now used the "create content"->"project" link here to start a project for it. I am unsure if all of this is appropriate.

killes@www.drop.org’s picture

Sure, we want projects to announce themselves, so creating a project node is a good thing.
The code looks good, nicely structured. You should use lowercase html IDs and generally put html output into themable functions. The JS should also be in a separated file. In one place you explicitly load the drupal.js file, this should not be neccessary.

The patch must be attached to some issue in the og issue queue...
--
Drupal services
My Drupal services

mwu’s picture

I'm confused by the reference to a patch. Don made a module, and with my limited knowledge that makes sense to me. Don wants to add various functionality, and og is such a moving target that is so large already. Killes, are you saying it should be a patch and not a module?

killes@www.drop.org’s picture

All I was saing is that I had had a patch to achieve a similar thing. That patch is probably outdated anyway, so it is better to go with Don's module instead.

--
Drupal services
My Drupal services

mwu’s picture

Hi Don,
thanks very much for making the module. I installed it. there was no help text, so maybe I don't know how to use it.

I didn't see any settings.

so I went ahead and made a group. several things came up.

1) I wanted to make a child group, such as a new group called French in European.
What I got appeared to be a parent group. French as a parent group of European. at least that's how it looks to me in the tree.

2) a group was selected by default. it became the subgroup. but I didn't want a default parent/child group to be selected.

3) when i went to post, my new group didn't show up, and I didn't see any clickable interface. javascript is enabled.

donengel’s picture

Hi mariun,

I've reposted your post within the project's page as a support request, so that others looking at the project will find it easily. I've answered it there. Answered is perhaps to strong a word, as it's mostly follow-up questions. I'm sorry for my delay in not responding to your message from yesterday sooner, and I apologize in advance that I'll be comparably slow through this week and next. I'm in training for my new Fellowship, and this has me offline for more of the day than is normal for me (but it's worth it).

The repost and response are at:
http://drupal.org/node/83033

Thanks,
Don