Currently, the 'Switch user' list is composed of two sorted sublists, each sorted by last access. This could look like
sysadmin
member
account
webmaster
The placeholder-formatted (italic) items are sorted among themselves (those are the accounts that can switch back), followed by the other items, also sorted among themselves.
I see no value in having two sublists, since the two kinds of items are easy to distinguish. Instead I'd like to really sort the entire list, so that it might look like this...
sysadmin
account
webmaster
member
... if that's what last access gives.
The attached patch implements this for D7. I'll do some additional clean-up of the devel_switch_user_list() function and update the older versions, too, of course, if this is acceptable. (I asked for this in one of my very first posts here on d.o, but I didn't find the right code and tone at the time...)
Implementation note: it would be tempting to use $user->access as key for the $links array, but we can't assure that no two accounts in the list won't ever have the same $user->access.
Comment | File | Size | Author |
---|---|---|---|
devel.sort-switch-users-list.patch | 1.03 KB | salvis | |
Comments
Comment #1
moshe weitzman CreditAttribution: moshe weitzman commentedcould we use a key called 'access'. more descriptive than 0. also, needs doxygen for new function. after these, feel free to commit and backport if you wish.
Comment #2
salvisCommitted to D7 and D6 with your requested changes. Thanks!
(I left D5 alone because the logic is different and it would require additional effort.)