Added role control
jmiccolis - September 7, 2005 - 02:10
| Project: | Help Edit |
| Version: | 4.6.x-1.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Description
I've added some code to help edit so that you can control what roles see a help message. I had to create a new table "help_roles", and also added a muliple select box to the help/customize page, as well as the code to make it work...
| Attachment | Size |
|---|---|
| helpedit.tar.gz | 10.08 KB |

#1
I've made a few refinements to my previously submitted patch, including;
* Moving the "customize" menu item out from under help, and renaming it "Custom Help". This allows you to turn help.module off and still use help edit, giving you more control over what your users see.
* Changing the way you select what roles can see a help message, from a "select box", to a set of checkboxes.
I also removed some comments I left in my last submission.
Again, this patch extends helpedit to let you select what roles see a help message. It allows you to present different sets of users with different help messages on the same page - ie, you can give the role "competent users" only the essential help, and "incompetent users" all sorts of warnings, and helpful hints.
#2
This sounds excellent! +1 for described functionality, not tested.
#3
I've corrected a bug with my patch (An mysql error was returned if a login fails) , as well as a modified help edit to display multiple help messages on a single page. Previously helpedit only displays the oldest help message for a page, now it displays all messages for a page in the order they were created.
I think this patch is about where I want it; it gives easily customized help messages tuned to user roles. Allowing you to not only augment the normal drupal help, but even replace it. ...but if anyone thinks a few less features, or slightly different ones would be better suited to the official helpedit modules let me know, I'd be happy to change a few things it it means getting some of these features committed.
#4
Your patch doesn't seem to be compatible with shared database installations of Drupal.
The error is occurring here:
SELECT bodyFROM {help}
LEFT JOIN help_roles
ON help.hid=help_roles.hid
LEFT JOIN users_roles
ON help_roles.rid=users_roles.rid
INNER JOIN users
ON users.uid=users_roles.uid
It finds the help table OK, but can't find the help_roles table. (On my installation, both of these tables use the default prefix as specified in settings.php.)
#5
I didn't write the path for a shared database drupal install, and I never checked it on one either... but I really should code correctly. I think I know what needs to be changed, and I should be able to get it done soon(ish).
Sorry 'bout that.
#6
Did this patch ever make it into the tarball for 4.6? Could someone clarify?
#7
I am using the 4.6 version and this patch is not included.
gtoddv