5 * Daniel Perez <danielperez.arg@gmail.com>
7 * This is an example to watch things in action. You can obviously modify things and logic as you see fit
9 * Portions Copyright 2010 (c) Mélanie Le Bail
10 * Copyright (C) 2012 Alain Peyrat - Alcatel-Lucent
12 require_once 'env.inc.php';
13 require_once 'pre.php';
14 require_once 'preplugins.php';
15 require_once 'plugins_utils.php';
16 require_once 'mailman_utils.php';
17 $request =& HTTPRequest::instance();
19 $group_id = $request->get('group_id');
20 $pm = ProjectManager::instance();
21 $Group = $pm->getProject($group_id);
22 if (isset ($group_id)) {
24 if (!$Group || !is_object($Group)) {
25 exit_error(_('Error'), 'Could Not Get Group');
26 } elseif ($Group->isError()) {
30 $mlFactory = new MailmanListFactory($Group);
31 if (!$mlFactory || !is_object($mlFactory)) {
32 exit_error(_('Error'), 'Could Not Get MailmanListFactory');
34 elseif ($mlFactory->isError()) {
35 exit_error(_('Error'), $mlFactory->getErrorMessage());
38 mailman_header(array (
39 'title' => sprintf(_("Mailing Lists for %s"), $group->getPublicName()),
40 'help' => 'CommunicationServices.html#MailingLists',
41 'pv' => isset ($pv) ? $pv : false
44 $mlArray = & $mlFactory->getMailmanLists();
46 if ($mlFactory->isError()) {
47 echo '<h1>' . _('Error') . ' ' . sprintf(_('Unable to get the list %s'), $Group->getPublicName()) . '</h1>';
48 echo $mlFactory->getErrorMessage();
53 $mlCount = count($mlArray);
55 echo '<p>' . sprintf(_('No Lists found for %s'), $Group->getPublicName()) . '</p>';
56 echo '<p>' . _('Project administrators use the admin link to request mailing lists.') . '</p>';
62 if ($mlFactory->compareInfos()) {
64 echo _('You seem to have mailman account with a different name or password. If you want to update mailman information, click on ');
65 echo '<a href="index.php?group_id=' . $group_id . '&action=update">' . _('Update') . '</a>';
71 echo _('Choose a list to browse, search, and post messages.');
75 for ($j = 0; $j < $mlCount; $j++) {
76 $currentList = & $mlArray[$j];
77 display_list($currentList);
81 if ($request->exist('action')) {
82 if ($request->exist('id')) {
83 $list = new MailmanList($group_id, $request->get('id'));
84 switch ($request->get('action')) {
86 $list->getOptionsURL();
95 $list->getArchivesUrl();
98 $list->getExternalAdminUrl();
104 if ($request->get('action') == 'update') {
105 $mlFactory->updateInfos();