| 1 |
<?php |
<?php |
| 2 |
// $Id: lists.module,v 1.8 2007/08/06 06:23:50 dww Exp $ |
// $Id: lists.module,v 1.9 2007/08/06 06:27:04 dww Exp $ |
| 3 |
|
|
| 4 |
function _lists_get_lists() { |
function _lists_get_lists() { |
| 5 |
$lists = array( |
$lists = array( |
| 7 |
'name' => 'Support', |
'name' => 'Support', |
| 8 |
'description' => 'A list for support questions.', |
'description' => 'A list for support questions.', |
| 9 |
'mailto' => 'support-request@drupal.org', |
'mailto' => 'support-request@drupal.org', |
| 10 |
|
'disabled' => FALSE, |
| 11 |
), |
), |
| 12 |
'development' => array( |
'development' => array( |
| 13 |
'name' => 'Development', |
'name' => 'Development', |
| 14 |
'description' => 'A list for Drupal developers.', |
'description' => 'A list for Drupal developers.', |
| 15 |
'mailto' => 'development-request@drupal.org', |
'mailto' => 'development-request@drupal.org', |
| 16 |
|
'disabled' => FALSE, |
| 17 |
), |
), |
| 18 |
'themes' => array( |
'themes' => array( |
| 19 |
'name' => 'Themes', |
'name' => 'Themes', |
| 20 |
'description' => 'A list for Drupal theme developers/designers.', |
'description' => 'A list for Drupal theme developers/designers.', |
| 21 |
'mailto' => 'themes-request@drupal.org', |
'mailto' => 'themes-request@drupal.org', |
| 22 |
|
'disabled' => FALSE, |
| 23 |
), |
), |
| 24 |
'documentation' => array( |
'documentation' => array( |
| 25 |
'name' => 'Documentation', |
'name' => 'Documentation', |
| 26 |
'description' => 'A list for documentation contributors.', |
'description' => 'A list for documentation contributors.', |
| 27 |
'mailto' => 'documentation-request@drupal.org', |
'mailto' => 'documentation-request@drupal.org', |
| 28 |
|
'disabled' => FALSE, |
| 29 |
), |
), |
| 30 |
'translations' => array( |
'translations' => array( |
| 31 |
'name' => 'Translations', |
'name' => 'Translations', |
| 32 |
'description' => 'A list for Drupal UI translators.', |
'description' => 'A list for Drupal UI translators.', |
| 33 |
'mailto' => 'translations-request@drupal.org', |
'mailto' => 'translations-request@drupal.org', |
| 34 |
|
'disabled' => FALSE, |
| 35 |
), |
), |
| 36 |
'consulting' => array( |
'consulting' => array( |
| 37 |
'name' => 'Consulting', |
'name' => 'Consulting', |
| 38 |
'description' => 'A mailing list for Drupal consultants and Drupal service/hosting providers.', |
'description' => 'A mailing list for Drupal consultants and Drupal service/hosting providers.', |
| 39 |
'mailto' => 'consulting-request@drupal.org', |
'mailto' => 'consulting-request@drupal.org', |
| 40 |
|
'disabled' => FALSE, |
| 41 |
), |
), |
| 42 |
'drupal-cvs' => array( |
'drupal-cvs' => array( |
| 43 |
'name' => 'CVS commits', |
'name' => 'CVS commits', |
| 44 |
'description' => 'A list with all CVS commit messages.', |
'description' => 'A list with all CVS commit messages.', |
| 45 |
'mailto' => 'drupal-cvs-request@drupal.org', |
'mailto' => 'drupal-cvs-request@drupal.org', |
| 46 |
|
'disabled' => FALSE, |
| 47 |
), |
), |
| 48 |
'cvs-applications' => array( |
'cvs-applications' => array( |
| 49 |
'name' => 'CVS applications', |
'name' => 'CVS applications', |
| 50 |
'description' => 'A list of all applications for an account in the Drupal contributions CVS repository.', |
'description' => 'A list of all applications for an account in the Drupal contributions CVS repository.', |
| 51 |
'mailto' => 'cvs-applications-request@drupal.org', |
'mailto' => 'cvs-applications-request@drupal.org', |
| 52 |
|
'disabled' => FALSE, |
| 53 |
'private' => TRUE, |
'private' => TRUE, |
| 54 |
), |
), |
| 55 |
'webmasters' => array( |
'webmasters' => array( |
| 56 |
'name' => 'Webmasters', |
'name' => 'Webmasters', |
| 57 |
'description' => 'A list for drupal.org webmasters (e.g. settings and content on the drupal.org website, user management, removing spam, etc.).', |
'description' => 'A list for drupal.org webmasters (e.g. settings and content on the drupal.org website, user management, removing spam, etc.).', |
| 58 |
'mailto' => 'webmasters-request@drupal.org', |
'mailto' => 'webmasters-request@drupal.org', |
| 59 |
|
'disabled' => FALSE, |
| 60 |
'private' => TRUE, |
'private' => TRUE, |
| 61 |
), |
), |
| 62 |
'infrastructure' => array( |
'infrastructure' => array( |
| 63 |
'name' => 'Infrastructure', |
'name' => 'Infrastructure', |
| 64 |
'description' => 'A list for drupal.org infrastructure maintainers (e.g. drupal.org hardware and server configuration, the CVS repository, mailing lists, etc).', |
'description' => 'A list for drupal.org infrastructure maintainers (e.g. drupal.org hardware and server configuration, the CVS repository, mailing lists, etc).', |
| 65 |
'mailto' => 'infrastructure-request@drupal.org', |
'mailto' => 'infrastructure-request@drupal.org', |
| 66 |
|
'disabled' => FALSE, |
| 67 |
'private' => TRUE, |
'private' => TRUE, |
| 68 |
), |
), |
| 69 |
'drupal-con' => array( |
'drupal-con' => array( |
| 70 |
'name' => 'DrupalCON', |
'name' => 'DrupalCON', |
| 71 |
'description' => 'A list for the organization of Drupal conferences and events.', |
'description' => 'A list for the organization of Drupal conferences and events.', |
| 72 |
'mailto' => 'drupal-con-request@drupal.org', |
'mailto' => 'drupal-con-request@drupal.org', |
| 73 |
|
'disabled' => FALSE, |
| 74 |
'private' => TRUE, |
'private' => TRUE, |
| 75 |
), |
), |
| 76 |
); |
); |
| 78 |
return $lists; |
return $lists; |
| 79 |
} |
} |
| 80 |
|
|
| 81 |
function lists_menu($may_cache) { |
function lists_menu() { |
| 82 |
$items = array(); |
$items = array(); |
| 83 |
|
|
| 84 |
if ($may_cache) { |
$items['admin/lists'] = array( |
| 85 |
$items[] = array( |
'title' => t('Mailing lists'), |
| 86 |
'path' => 'lists', |
'page callback' => 'drupal_get_form', |
| 87 |
'title' => t('Mailing lists'), |
'page arguments' => array('lists_subscribe'), |
| 88 |
'access' => user_access('access content'), |
'access' => user_access('access content'), |
| 89 |
'callback' => 'drupal_get_form', |
'type' => MENU_NORMAL_ITEM, |
| 90 |
'callback arguments' => array('lists_subscribe'), |
'file' => 'lists.module', |
| 91 |
'type' => MENU_SUGGESTED_ITEM |
); |
| 92 |
); |
|
|
} |
|
| 93 |
return $items; |
return $items; |
| 94 |
} |
} |
| 95 |
|
|
| 97 |
global $user; |
global $user; |
| 98 |
$lists = _lists_get_lists(); |
$lists = _lists_get_lists(); |
| 99 |
|
|
| 100 |
|
$output = ''; |
| 101 |
foreach ($lists as $list => $info) { |
foreach ($lists as $list => $info) { |
| 102 |
$links = array(); |
$links = array(); |
| 103 |
if (isset($info['private']) && $info['private']) { |
if (isset($info['private']) && $info['private']) { |
| 108 |
$links[] = "<a href=\"http://lists.drupal.org/archives/cgi-bin/namazu.cgi?idxname=$list\">search archive</a>"; |
$links[] = "<a href=\"http://lists.drupal.org/archives/cgi-bin/namazu.cgi?idxname=$list\">search archive</a>"; |
| 109 |
} |
} |
| 110 |
|
|
| 111 |
$output .= "<h2>$info[name]</h2>\n"; |
$output .= "<h2>". $info['name'] ."</h2>\n"; |
| 112 |
if (!$info['disabled']) { |
if (!$info['disabled']) { |
| 113 |
$links[] = "<a href=\"http://lists.drupal.org/listinfo/$list\">mailman page</a>"; |
$links[] = "<a href=\"http://lists.drupal.org/listinfo/$list\">mailman page</a>"; |
| 114 |
} |
} |
| 116 |
$output .= '<i>This list has been disabled.</i>\n'; |
$output .= '<i>This list has been disabled.</i>\n'; |
| 117 |
} |
} |
| 118 |
|
|
| 119 |
$output .= "<p>$info[description]</p>\n"; |
$output .= "<p>". $info['description'] ."</p>\n"; |
| 120 |
$output .= "<p>"; |
$output .= "<p>"; |
| 121 |
|
|
| 122 |
$output .= implode(' . ', $links); |
$output .= implode(' . ', $links); |
| 160 |
|
|
| 161 |
function lists_subscribe_submit($form_id, $form = NULL) { |
function lists_subscribe_submit($form_id, $form = NULL) { |
| 162 |
$flag = FALSE; |
$flag = FALSE; |
| 163 |
$mail = $form['mail']; |
$mail = $form['values']['mail']; |
| 164 |
if ($mail) { |
if ($mail) { |
| 165 |
foreach (_lists_get_lists() as $list => $info) { |
foreach (_lists_get_lists() as $list => $info) { |
| 166 |
if ($form[$list]) { |
if ($form['values'][$list]) { |
| 167 |
if (!$flag) $flag = TRUE; |
if (!$flag) $flag = TRUE; |
| 168 |
$headers = "From: $mail\nReturn-path: $mail\nError-to: $mail"; |
$headers = "From: $mail\nReturn-path: $mail\nError-to: $mail"; |
| 169 |
$result[] = mail($info['mailto'], "subscribe address=$mail", 'subscribe to mailing list', $headers); |
$result[] = mail($info['mailto'], "subscribe address=$mail", 'subscribe to mailing list', $headers); |