Closed (duplicate)
Project:
Administration menu
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
1 Dec 2007 at 04:06 UTC
Updated:
4 Jul 2009 at 13:06 UTC
Jump to comment: Most recent file
Comments
Comment #1
sunGood idea. However, not trivial.
With the re-factored code in 5.x-2.x, it might be possible to use the 'package' information of all modules and group them by package (Settings only). I think, that would be the best option. What do you think?
Comment #2
sunThis can certainly considered as a bug and needs to hit 5.x-2.x.
Attached patch implements the proposed solution in #1 -- each contrib module that defines a 'package' in its .info file is moved into a corresponding settings category (package name).
Certain core modules are moved into a new category 'System'.
Modules that do not define a package, are not moved. Thus, this is also great QA tool for module maintainers... ;)
Let me know what you think. I've tested it on a site with 56 enabled modules and the results are quite impressive.
Please bear in mind that this patch is against latest 5.x-2.x.
Comment #3
sunComment #4
sunAny feedback? I like it very much so far. We probably should use the same categorization for the Drupal.org issue queue links.
Re-rolled patch against latest 5.x-2.x.
Comment #5
sunRe-rolled patch against latest 5.x-2.x after code clean-up.
Comment #6
eigentor commentedSorry for not replying until now ;) I did not expect you to act so quickly. Well, just entering the coding business, I don't even know how to apply a patch. I found this tutorial http://drupal.org/patch/apply. Is this the way to do it ?
Sorry for being a noob ;)
OK, I tried. Somehow it refuses to apply the patch, This is what I'm told:
patching file admin_menu.inc
Hunk #1 FAILED at 149.
1 out of 1 hunk FAILED -- saving rejects to file admin_menu.inc.rej
And the file admin_menu.inc.rej is created with your patch in it.
Comment #7
CloudCuckoo commented@eigentor
They're the instructions I followed and it applied for me. Did you apply the patch to 5.x-2.1 or 5.x-2-x-dev (the development snapshot)? The patch is against the dev release.
@sun
Notes I took while taking a tour around a clean install of Drupal 5.5, patched admin_menu and two roles set up:
site administrator: who can access everything.
content manager: with 'administer nodes', 'administer content', 'access administration menu' and the 'administer filters' permissions.
There's some questions in here. I apologise in advance if they're stupid ones.
Logged in as site administrator:
"Yay! Look at how all those menu items that I have so very little cause to use all that often have just been tidied away. That's a +1 right there."
The expected core settings are moved under system menu item. Paths are correct with both ?q= and 'clean-urls'.
Installed and enabled Voting Api and fivestar modules. Both are in the Voting package. As expected Voting api and fivestar settings links are moved under settings category Voting.
Installed and enabled Javascript tools including Tabs, Collapsiblock and Active search modules. Despite all info files defining the package as Javascript tools there is no settings category for Javascript tools and the menu items aren't moved.
Qn: Modules that don't define $items['access'] so use the access rights of the parent menu item aren't moved, is this intentional/desirable?
[EDIT] Qn: Is it safe to assume the path to a modules settings will always be
$path = 'admin/settings/'. $module?(Off-hand I can only think of one module where this isn't the case, that's form inspect).
Logged in as content manager:
The core settings (that I didn't expect to see) are not moved under category System (I expected that).
Qn: Logged in as content manager I expected only 'Content management' with the relevant child menu items and 'Site configuration' with the single child item 'Input format' to be visible. However 'Logs', the icon menu items 'administer' and 'run cron', and ALL the site configuration menu child items are also visible. Are my expectations wrong?
As content manager after assigning voting api permissions to the role:
As expected Voting api link is moved under settings category Voting.
I'm not sure you should but that's because I look for issue queues by project name. What package it's in is irrelevant to me here.
Which leads to -
Qn: Currently links are being created to issue queues that don't exist. Modules such as Views UI, JS Tools Tabs, all of the CCK project don't have issue queues of their own because they're project components. If I have these modules enabled it results in several redundant links to the 'all issues' page at d.o.
Wouldn't it be better to instead link just to the unique project issue queues rather than duplicate them for each module?
e.g.
- CCK issue queue
- Views issue queue
Instead of
- Content issue queue
- Node reference issue queue
- User reference issue queue
- Views issue queue
- Views UI issue queue
And
Qn: shouldn't these urls be created using
$url = 'http://drupal.org/project/issues/'. $info['project']?Comment #8
eigentor commentedFinally I took the right version - 5.2.x.-dev and managed to apply the patch successfully. After it refused to work first (maybe an issue with admin_menu_dropdown, which I also use) I finally got to full sight.
Wonderful, Sun! That's it. The "systems" category and "image" category saves one third of the column height alone!
Yeah, and as you said: It's putting the weight on module maintainers to group modules in a sensible way. Down with scattering... Up with building coherent groups. In Detail, one can find a lot of modules that should place their settings elsewhere than they actually do. Shame I did not find any in a quick search ;)
So it is different than the solution I thought of, but better.
Comment #9
sunNew patch.
No, that's gone now. However, this needs thorough testing.
No, it's not. However, AFAIK there is no way to determine the real paths of module setting pages. So I doubt we can do much here.
That is fixed in this patch, too. Now using 'project' information of module .info files for d.o issue queue links. Downside: 'project' information is added by packaging scripts run on d.o, hence there are no issue queue links for direct CVS checkouts.
Comment #10
sunNot good: The new package grouping menu items are linking to admin/settings and because of that, the menu item id of admin/settings is changed in admin_menu's path index afterwards. This means that a subsequent call to admin_menu_add_item() with the parent menu item id of admin/settings would add an item below the last package grouping menu item instead of "Site configuration".
IMO it would be best, if those grouping menu items wouldn't be a link at all. However, that is not easy to implement, because we need to assign a path for grouping items to move other items below them.
Attached patch works, but I'm not really happy with it.
Comment #11
eigentor commented@sun: Will this patch become part of the regular admin_menu module, once the pitfalls and bugs will be sorted out?
Comment #12
sun@eigentor: Yes, definitely. But I still don't have an idea that works out.
Comment #13
encho commentedSubscribing
Comment #14
cbloodworth commentedWhen I ran this patch, I received error messages in Terminal, telling me that the patch failed on lines 149, 192, and 212. How do I rectify this?
If it is helpful to know, I also have Admin. Menu Dropdown installed.
Comment #15
eigentor commentedCheck the module version this patch is for. I'm pretty sure this is the reason for patch failing.
Comment #16
sunI wonder whether
- some hook_menu_alter() magic would allow us to parse out the module package name of all first-level items below admin/settings, and
- move them below new, injected MENU_DYNAMIC_ITEMs for the package name, i.e. admin/settings/[package-name]
Comment #17
sunBug? I clearly must have been blindfolded back then in 2007.
Comment #18
dave reidMarked #430294: Cycle through long menu lists as a duplicate of this issue.
Comment #19
hapydoyzer commentedsubscribing
Comment #20
giorgio79 commentedI seem to have this issue in Drupal 6 as well
Comment #21
pimok3000 commentedsubscribing
Comment #22
eigentor commentedWell As hopefully the entire structuring of the admin Sectio will be reworked in D7, this might make not as much sense as before. Probably not all Modules will be found under settings or system will be split out. The current state of Marks and Leisas Header does this.
Comment #23
pescetti commentedsubscribing
Comment #24
sunMarking as duplicate of #508458: Config and modules page. You can follow up on that issue to track its status instead. If any information from this issue is missing in the other issue, please make sure you provide it over there.
However, thanks for taking the time to report this issue.