I wanted to have the archive url appear as a link in the user form in much the same way as it does in the user form supplied by Mailman manager module.
The following patch works for me (Mostly just a copy from Mailman Manager)
--- user_mailman_register.module 2010-01-07 12:53:10.000000000 +1000
+++ user_mailman_register.module.patched 2010-01-07 12:56:36.000000000 +1000
@@ -225,6 +225,21 @@
'#description' => t('If checked, member postings will be moderated.'),
);
}
+//------------------
+ if ($list['web'] || $list['webarch']) {
+ $link_output = '
'. t('Visit') .': ';
+ if ($list['web']) {
+ $link_output .= l(t('Mailman Interface'), $list['web']);
+ }
+ if ($list['web'] && $list['webarch']) {
+ $link_output .= ' '. t('or') .': ';
+ }
+ if ($list['webarch']) {
+ $link_output .= l($list['name'] .' '. t('archive') .'.', $list['webarch']);
+ }
+ $form['user_mailman_register']['lists']['list'. trim($list['lid'])]['links'] = array('#type' => 'markup', '#value' => $link_output);
+ }
+//------------------------
}
if (!$lists_available) {
$form['user_mailman_register']['lists']['#description'] = t('No mailing lists are avaiable.');
Comments
Comment #1
samuelet commentedThanks but i think that the "Description" option in the UMR list settings is a better solution in this case.
It lets to add any custom html text, included a link to a mailman archive, without forcing to display the mailman archive link also for sites that want to keep hide it.
.
Comment #2
jzornig commentedDidn't think of that solution. I picked this way because there are already fields for these urls in the Mailman Manager admin form. The links only show if the url's are entered in the Mailman Manager admin form, so it is easy to have the links be shown or not.
Comment #3
rjlang commentedSorry, no further changes will happen on versions 5.x and 6.x.