3 * GForge Mailing Lists Facility
5 * Portions Copyright 1999-2001 (c) VA Linux Systems
6 * The rest Copyright 2003-2004 (c) Guillaume Smet - Open Wide
11 require_once('../env.inc.php');
12 require_once('pre.php');
13 require_once('../mail/mail_utils.php');
15 require_once('common/mail/MailingList.class');
16 require_once('common/mail/MailingListFactory.class');
18 $group_id = getIntFromGet('group_id');
21 $Group =& group_get_object($group_id);
22 if (!$Group || !is_object($Group)) {
23 exit_error(_('Error'), 'Could Not Get Group');
24 } elseif ($Group->isError()) {
28 $mlFactory = new MailingListFactory($Group);
29 if (!$mlFactory || !is_object($mlFactory)) {
30 exit_error(_('Error'), 'Could Not Get MailingListFactory');
31 } elseif ($mlFactory->isError()) {
32 exit_error(_('Error'), $mlFactory->getErrorMessage());
36 'title' => sprintf(_('Mailing Lists for %1$s'), $Group->getPublicName())
40 $mlArray =& $mlFactory->getMailingLists();
42 if ($mlFactory->isError()) {
43 echo '<h1>'._('Error').' '.sprintf(_('Error'), $Group->getPublicName()) .'</h1>';
44 echo $mlFactory->getErrorMessage();
49 $mlCount = count($mlArray);
51 echo '<p>'.sprintf(_('No Lists found for %1$s'), $Group->getPublicName()) .'</p>';
52 echo '<p>'._('Project administrators use the admin link to request mailing lists.').'</p>';
57 echo _('<p>Mailing lists provided via a GForge version of <a href="http://www.list.org/">GNU Mailman</a>. Thanks to the Mailman and <a href="http://www.python.org/">Python</a> crews for excellent software.</p>');
58 echo _('<p>Choose a list to browse, search, and post messages.</p>');
60 $tableHeaders = array(
65 echo $HTML->listTableTop($tableHeaders);
67 for ($j = 0; $j < $mlCount; $j++) {
68 $currentList =& $mlArray[$j];
69 echo '<tr '. $HTML->boxGetAltRowStyle($j) .'>';
70 if ($currentList->isError()) {
71 echo '<td colspan="3">'.$currentList->getErrorMessage().'</td></tr>';
72 } else if($currentList->getStatus() == MAIL__MAILING_LIST_IS_REQUESTED) {
73 echo '<td width="33%">'.
74 '<strong>'.$currentList->getName().'</strong></td>'.
75 '<td width="33%">'.htmlspecialchars($currentList->getDescription()). '</td>'.
76 '<td width="33%" style="text-align:center">'._('Not activated yet').'</td></tr>';
78 echo '<td width="33%">'.
79 '<strong><a href="'.$currentList->getArchivesUrl().'">' .
80 sprintf(_('%1$s Archives'), $currentList->getName()).'</a></strong></td>'.
81 '<td>'.htmlspecialchars($currentList->getDescription()). '</td>'.
82 '<td width="33%" style="text-align:center"><a href="'.$currentList->getExternalInfoUrl().'">'._('Subscribe/Unsubscribe/Preferences').'</a>'.
88 echo $HTML->listTableBottom();