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
10 require_once('../env.inc.php');
11 require_once $gfcommon.'include/pre.php';
12 require_once $gfwww.'mail/../mail/mail_utils.php';
14 require_once $gfcommon.'mail/MailingList.class.php';
15 require_once $gfcommon.'mail/MailingListFactory.class.php';
17 $group_id = getIntFromGet('group_id');
20 $Group =& group_get_object($group_id);
21 if (!$Group || !is_object($Group)) {
22 exit_error(_('Error'), 'Could Not Get Group');
23 } elseif ($Group->isError()) {
27 $mlFactory = new MailingListFactory($Group);
28 if (!$mlFactory || !is_object($mlFactory)) {
29 exit_error(_('Error'), 'Could Not Get MailingListFactory');
30 } elseif ($mlFactory->isError()) {
31 exit_error(_('Error'), $mlFactory->getErrorMessage());
35 'title' => sprintf(_('Mailing Lists for %1$s'), $Group->getPublicName())
38 plugin_hook ("blocks", "mail index");
40 $mlArray =& $mlFactory->getMailingLists();
42 if ($mlFactory->isError()) {
43 echo '<h1>'._('Error').' '.sprintf(_('Unable to get the list %s'), $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>Choose a list to browse, search, and post messages.</p>');
59 $tableHeaders = array(
64 echo $HTML->listTableTop($tableHeaders);
66 for ($j = 0; $j < $mlCount; $j++) {
67 $currentList =& $mlArray[$j];
68 echo '<tr '. $HTML->boxGetAltRowStyle($j) .'>';
69 if ($currentList->isError()) {
70 echo '<td colspan="3">'.$currentList->getErrorMessage().'</td></tr>';
71 } else if($currentList->getStatus() == MAIL__MAILING_LIST_IS_REQUESTED) {
72 echo '<td width="33%">'.
73 '<strong>'.$currentList->getName().'</strong></td>'.
74 '<td width="33%">'.htmlspecialchars($currentList->getDescription()). '</td>'.
75 '<td width="33%" style="text-align:center">'._('Not activated yet').'</td></tr>';
77 echo '<td width="33%">'.
78 '<strong><a href="'.$currentList->getArchivesUrl().'">' .
79 sprintf(_('%1$s Archives'), $currentList->getName()).'</a></strong></td>'.
80 '<td>'.htmlspecialchars($currentList->getDescription()). '</td>'.
81 '<td width="33%" style="text-align:center"><a href="'.$currentList->getExternalInfoUrl().'">'._('Subscribe/Unsubscribe/Preferences').'</a>'.
87 echo $HTML->listTableBottom();