When you are on the admin/by-module page and click on "Configure Permissions" it takes you to the access control page, but just to the top of the page.

This patch adds a named anchor to each .module level row of the access control page and adds the fragment identifier to the "configure permissions" link so things go to the right place.

I believe this is a usability issue. I just fired up 5.x for the first time and was very happy with all the new admin interface changes. However, the link to the access control page makes user interaction much slower - they go from a specific page (the by modules page) to a big sea of information. Using the named anchors helps direct people right to the section they want to modify.

Comments

MrPrise’s picture

The patch works well and I like it. It makes that admin page more user-friendly. After I apply the patch I wonder why that feature is not the part of the system by the begining.

webchick’s picture

Status: Needs review » Needs work

Awesome.

Two things:

1. The attribute should be id="" and not name="" for XHTML compliance.

2. You can't do simply id="module" because there are already classes declared for #menu and such which will screw up the way the table looks. So something like id="perm-module" or something will work fine.

greggles’s picture

Status: Needs work » Needs review
StatusFileSize
new1.59 KB

@webchick - thanks for the review.

Here is an updated file including your suggested changes, so I'm changing it back to patch-CNR.

dries’s picture

Let's write 'permission' or 'permissions' rather than 'perm'.

dries’s picture

Do we need the 'perm-' to begin with? Why not just the module name?

webchick’s picture

Status: Needs review » Needs work

Dries: Because some of these module names (like menu, iirc) are already IDs in CSS (#menu) that have their own formatting. So if we just use id="menu", the table gets distorted because a few oddball modules get right-aligned or what have you.

At least this is what I remember from when I worked on merlin's big administration patch where this functionality first showed up.

greggles’s picture

Status: Needs work » Needs review
StatusFileSize
new1.6 KB

@dries - webchick's advice is indeed correct in my testing: if you are using bluemarine and try to visit admin/user/access#menu then your page won't drop down at all, but will just sit there. Prefixing the module with permission- fixes this issue.

Here's a new patch with your requested change to permission included.

neclimdul’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new1.6 KB

This patch just syncs and adds a space to the line in system.module to conform with coding standards. Great work Greg. Works as specified and does improve usability. I'm going to RTBC with the assumption that Dries' concerns have been addressed.

profix898’s picture

Do you think <a id="permission-@module">@module module</a> should be translatable? If someone does, it could break the desired functionality. This is not a language-specific string and it shouldnt be wrapped in t() IMO.

profix898’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new1.61 KB

This patch adds the "id=..." stuff via #prefix/#suffix, so no translator will see it. Only the translatable part is still wrapped in t().

greggles’s picture

thanks for the updates neclimudl and profix898 - works

I'm guessing that it's ok to say

'#prefix' => '<a id="permission-'. $module .'">',

Though I get nervous looking at anything that involves .$ instead of using the printf style substitution.

webchick’s picture

Might not hurt to wrap $module in a check_plain.

profix898’s picture

StatusFileSize
new1.62 KB

Not sure this is really needed, but added check_plain.

kkaefer’s picture

StatusFileSize
new1.71 KB

If you wrap one in check_plain, do it with the other as well.

+1 on this patch. Looks good to go.

kkaefer’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new1.71 KB

Corrected a whitespace issue and added a comma to the last array element.

dries’s picture

AFAIK, these check_plain()s are not needed.

profix898’s picture

You can use #10. Its the same patch, but without the check_plain()s.

dries’s picture

Status: Reviewed & tested by the community » Needs work

profix: #10 actually fails ... needs to be re-rolled, I'm afraid.

profix898’s picture

Status: Needs work » Needs review
StatusFileSize
new1.6 KB

re-rolled

kkaefer’s picture

StatusFileSize
new1.79 KB

Removed the whitespace again.

profix898’s picture

@kkaefer: Thanks and Sorry for 'again' :)

kkaefer’s picture

StatusFileSize
new1.79 KB

Ah, the capitalization patch. Made the "Configure" uppercase just in the original.

edmund.kwok’s picture

+1 to the patch. Tested on HEAD, did not apply cleanly though. Just one question, would it be slightly misleading if the module names in the access control page inherits link styles? Like having link colors and having on hover styles. Apart from that, looks RTBC to me :)

greggles’s picture

StatusFileSize
new1.8 KB

Thanks for letting us know it wasn't working edkwh

I rerolled it. This version doesn't have the check_plains in it.

greggles’s picture

StatusFileSize
new1.66 KB

This patch no longer applied because of http://drupal.org/node/90614

I rerolled it. It applies cleanly for me.

This version does not include the check_plains, keeps the divs in the prefix/suffix for easier translation, and uses permission- to create the id so we don't collide with other id values on the page. I believe this is RTBC.

profix898’s picture

Status: Needs review » Reviewed & tested by the community

Lets set this RTBC and see what happens ... we all did enough re-rolls, I think.

drumm’s picture

Status: Reviewed & tested by the community » Needs work

Please use an id on an existing element instead of throwing in an extra a tag.

Aren't these modules, not permissions? I think the id should be module-name.

webchick’s picture

Status: Needs work » Needs review
StatusFileSize
new2.31 KB

Ok, let's try this.

kkaefer’s picture

Status: Needs review » Needs work

webchick's patch can't work because there are not yet any existing IDs for each module on the permissions page.

webchick’s picture

Status: Needs work » Needs review

Huh? It does work..? I add the ID to the table cell.

Tested in Firefox and Safari.

greggles’s picture

I confirm webchick's comment - works fine for me in FF2.

neclimdul’s picture

Status: Needs review » Needs work

Doesn't seem to be working in IE. Most likely this is IE being stupid about implementing something. Either way, it look like we have to work around it and may need to go with the <a ... anchor instead of embedding it in an existing tag to support IE.

RobRoy’s picture

Status: Needs work » Needs review

This works for me in IE6.0.2 on Windows XP (and all the other browsers). Having any element's ID used as an anchor is a standard HTML 4 trait so not sure what's going on with your browser.

Not sure what the issue is here, but this works fine for me. +1

greggles’s picture

Works fine for me in IE7 and IE6.0.2

In IRC neclimdul mentioned using IE6.0.2 Robroy tested in IE6.0.2 and it worked fine for him.

kkaefer’s picture

After a short discussion with webchick, I'm fine with this patch.

kkaefer’s picture

Status: Needs review » Reviewed & tested by the community

Works also in Safari.

neclimdul’s picture

Status: Reviewed & tested by the community » Needs review

I don't know either. It was IE 6.0.2 but if everyone else is working then I'm not going to argue. Its the first time I've used IE in a couple years so its just as likely I was overlooking something. The id thing seems pretty standard so lets get this thing committed.

neclimdul’s picture

Status: Needs review » Reviewed & tested by the community

woops, that wasn't my fault. I agree, RTBC.

drumm’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD.

Anonymous’s picture

Status: Fixed » Closed (fixed)