Hey Berdir and all,

Users with the appropriate permissions currently have two different private message related fieldsets on the user edit page (user/[uid]edit): One is named "Privatemsg e-mail notification" and another is named "Privatemsg settings". For improved usability, we should combine these into a single fieldset, with the "Enable Private Messaging" checkbox as the first item in the fieldset (followed by the e-mail notification stuff).

Also, since these are user-facing settings, we shouldn't use an abbreviation like "Privatemsg". So change the title of this new combined fieldset to "Private messages".

Additionally, other modules that integrate with PM (such as User Relationships) should place there PM-related options in this same "Private messages" fieldset. But options supplied by these other modules should appear in the fieldset below options supplied for PM itself.

All of these changes will help the settings make much more sense to the average authenticated user.

--Ben

Comments

berdir’s picture

I think we already have an issue for this, but we can close that one as a duplicate.

The only problem is that this is actually more complicated than it sounds. Because the disable option is conditional (only displayed if you have a permission), the privatemsg fieldset might or might not exist.

I guess the easiest solution is to create a hook_privatemsg_user_settings() and if there are any settings, we add a fieldset and the options inside.

berdir’s picture

Actually, I just had a better idea.

We should be able to use the form API to make the fieldset hide itself if it is empty with an #after_build callback. We can use the same for User Relationships because there us currently no easy to way add fields with other modules.

Will make a patch soon.

berdir’s picture

Status: Active » Needs review
StatusFileSize
new5.69 KB

Ok, attaching a patch, this looks quite nice I think..

I had to merge the fieldset to avoid overriding existing settings (pm_email_notify's hook_form_alter() is executed first) but it works fine now.

I was even able to add some #states fancyness to hide the unecessary options when privatemsg is disabled anyway.

berdir’s picture

StatusFileSize
new5.77 KB

Updated patch, only added a comment.

Status: Needs review » Needs work

The last submitted patch, merge_settings2.patch, failed testing.

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new4.54 KB

No idea why it didn't apply. Here's a re-roll anyway.

Status: Needs review » Needs work

The last submitted patch, merge_settings3.patch, failed testing.

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new4.54 KB

Stupid typo.

New try, for real ;)

BenK’s picture

Status: Needs review » Reviewed & tested by the community

This works and looks great. It's cool how unchecking "Enable private messages" hides the other options. And I changed permissions and the options went away nicely. I think this is ready to be committed!

berdir’s picture

Version: 7.x-1.x-dev »
Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

Great, commited. This can be backported as well...

berdir’s picture

Status: Postponed (maintainer needs more info) » Patch (to be ported)

Oh, wrong status...

berdir’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new4.45 KB

Attaching a patch for 6.x-2.x-dev

berdir’s picture

Status: Needs review » Fixed

Commited.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.