I think a good feature would be the ability for the administrators of a group to be able to configure the Homebox for that group [drag n drop etc] and all the members can just see the layout but can not move things around.
Presumably this would mean having just one entry per Homebox per Group rather than one entry per Homebox per User in the databass, and only Group admin's the permission to edit it.
Question > is there a hook to load the layout for any user's Homebox ?
I am using

print homebox_build(homebox_get_page('group_dashboard')); 

at the moment, is there another step that could load the settings for another user as well ?
Then maybe this is a way of achieving what I would like.

Comments

8bitplateau’s picture

just tried a hack, placed the lines

	// global $user;
	$node = node_load(arg(1));
	if(og_is_group_type($node->type)){
		$user = user_load($node->uid);
	}else{
		global $user;
	}

at the top of function _homebox_get_user_settings(); and it is a step towards what I wanted, obviously this is not the proper way to do it, maybe a setting in the homebox_og.module saying something like 'load the group owners homebox settings for group members?' and then if checked the code above is executed.
The next step is to disable the JS and inhibit the abiity for members to move stuff around as they can still do so but it will always revert to the group owners layout.

8bitplateau’s picture

I am just learning about how this module works and now i've realised the actually I want to save one 'Homebox settings per OG' and that to be set by the OG owner. Rather than one 'Homebox settings per Homebox instance' so that each group a user owns can have a different layout. I'd imagine this would require a new table in the databass ? I suppose the table would be: Group ID | Homebox Name | Settings array ?

8bitplateau’s picture

ok, I've managed to get Homebox working with OG's the way I wanted, it was relatively easy but I suppose the elegance is in the patch and really it should go against the homebox_og.module.
The main idea would be to put a few settings on the homebox_og.module's admin page to add
'one homebox per og ?'
and also
'allow only group admin to edit layout ?'
checkboxes.

But the hacks I did were in the main homebox.module so I'm not sure how to achieve this ?
I basically duplicated the '_homebox_save_user_settings()' and '_homebox_get_user_settings()' functions and renamed them '_homebox_save_group_settings()' and '_homebox_save_group_settings()', added a new table in the databse with fields 'gid','name','settings' and made calls to this table from these functions if the Homebox being called was the one assigned to the og's in homebox_og.module. Also I had to edit the ajax functions to allow for node information to be sent as well.

question > what would be the best way forward for creating this functionality as part of the homebox_og.module if there are a few hacks in the main module ?

kristygislason’s picture

Following. I agree that this is how homebox should function with organic groups.

kristygislason’s picture

Issue summary: View changes

changed user to group for clarity

drumm’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Drupal 6 is no longer supported. If this can be reproduced with Drupal 7, please re-open with details.