Since APK overrides the user page, I never noticed the handy user blocking toggle there until I saw it on g.d.o. This hook will make it work with both APK and AF. For an explanation of this hook, see http://drupal.org/node/326809.
/**
* Implementation of hook_preprocess_author_pane().
*/
function fasttoggle_preprocess_author_pane(&$variables) {
// The full user object for the author
$account = $variables['account'];
$variables['fasttoggle_block_author'] = theme('links', fasttoggle_link('user', $account), array('class' => 'links inline'));
}
This seems to work except for two problems:
1) When you have the fasttoggle settings set to "action" you get "unblock / activate" instead of "block / unblock". That might be a general bug because I get the same thing on the user page when not using my code.
2) When used on the author pane in the forum, and the same user posts more than once, the other posts will still show the old status until the page is refreshed. I'm not sure there's anything that can be done about that and it's a pretty minor inconvenience.
The advantage of this, in addition to not being hidden on the user page when using APK is that you can easily delete a comment and block the user posting it right there without ever leaving the page. So I hope you'll consider adding it.
BTW, this code will work in both D5 and D6, assuming the function call from fasttoggle is the same. I've only tested it in D5.
Thanks,
Michelle
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | fasttoggle.author-pane.txt | 331 bytes | michelle |
| #2 | fasttoggle.author-pane.txt | 343 bytes | michelle |
Comments
Comment #1
michelleOk, found #1 in #249147: The link for blocking users states "unblock" so nevermind that.
Michelle
Comment #2
michelleAnd here's a drop in .inc file (change the extension... silly upload rules) to just drop in if you prefer it that way. APK & AF will automatically find it so no need to touch your .module code.
Michelle
Comment #3
michelleWhoops, I guess I uploaded the version with the missing semicolon. Uploading the fixed file. Also, this has now been tested on D6 as well. Same file, both branches. :)
Michelle
Comment #4
psicomante commented+1 for Michelle's patch!
Comment #5
michelleRequest withdrawn. I have taken the unfortunate step of creating a new project to service my modules since I was unable to get any cooperation from most of the maintainers who's modules I'm trying to make work with mine.
Michelle