squirrelmail-webmail  1.4.22
About: SquirrelMail is a standards-based webmail package with strong MIME support, address books, and folder manipulation (written in PHP4).
  Fossies Dox: squirrelmail-webmail-1.4.22.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

setup.php
Go to the documentation of this file.
1 <?php
2 
21 
22  $squirrelmail_plugin_hooks['read_body_header']['listcommands'] = 'plugin_listcommands_menu';
23 }
24 
26  global $passed_id, $passed_ent_id, $color, $mailbox,
27  $message, $compose_new_win, $startMessage;
28 
33  $fieldsdescr = array('post' => _("Post to List"),
34  'reply' => _("Reply to List"),
35  'subscribe' => _("Subscribe"),
36  'unsubscribe' => _("Unsubscribe"),
37  'archive' => _("List Archives"),
38  'owner' => _("Contact Listowner"),
39  'help' => _("Help"));
40  $output = array();
41 
42  foreach ($message->rfc822_header->mlist as $cmd => $actions) {
43 
44  /* I don't know this action... skip it */
45  if ( !array_key_exists($cmd, $fieldsdescr) ) {
46  continue;
47  }
48 
49  /* proto = {mailto,href} */
50  $aActionKeys = array_keys($actions);
51  $proto = array_shift($aActionKeys);
52  $act = array_shift($actions);
53 
54  if ($proto == 'mailto') {
55 
56  if (($cmd == 'post') || ($cmd == 'owner')) {
57  $url = 'src/compose.php?' .
58  (isset($startMessage)?'startMessage='.$startMessage.'&amp;':'');
59  } else {
60  $url = "plugins/listcommands/mailout.php?action=$cmd&amp;";
61  }
62  $url .= 'send_to=' . str_replace('?','&amp;', $act);
63 
64  $output[] = makeComposeLink($url, $fieldsdescr[$cmd]);
65 
66  if ($cmd == 'post') {
67  $url .= '&amp;passed_id='.$passed_id.
68  '&amp;mailbox='.urlencode($mailbox).
69  (isset($passed_ent_id)?'&amp;passed_ent_id='.$passed_ent_id:'');
70  $url .= '&amp;smaction=reply';
71 
72  $output[] = makeComposeLink($url, $fieldsdescr['reply']);
73  }
74  } else if ($proto == 'href') {
75  $output[] = '<a href="' . $act . '" target="_blank">'
76  . $fieldsdescr[$cmd] . '</a>';
77  }
78  }
79 
80  if (count($output) > 0) {
81  echo '<tr>';
82  echo html_tag('td', '<b>' . _("Mailing List") . ':&nbsp;&nbsp;</b>',
83  'right', '', 'valign="middle" width="20%"') . "\n";
84  echo html_tag('td', '<small>' . implode('&nbsp;|&nbsp;', $output) . '</small>',
85  'left', $color[0], 'valign="middle" width="80%"') . "\n";
86  echo '</tr>';
87  }
88 }
89 
html_tag
html_tag( $tag, $val='', $align='', $bgcolor='', $xtra='')
Definition: html.php:27
$mailbox
$mailbox
Definition: options.php:28
$url
$url
Definition: mailto.php:81
plugin_listcommands_menu
plugin_listcommands_menu()
Definition: setup.php:25
$message
$message
Definition: download.php:54
$output
$output
Definition: webmail.php:71
makeComposeLink
makeComposeLink($url, $text=null, $target='')
Definition: strings.php:704
$squirrelmail_plugin_hooks
global $squirrelmail_plugin_hooks
Definition: plugin.php:17
squirrelmail_plugin_init_listcommands
squirrelmail_plugin_init_listcommands()
Definition: setup.php:19
_
_($str)
Definition: gettext.php:160
$color
$color
Definition: load_prefs.php:28
$compose_new_win
$compose_new_win
Definition: load_prefs.php:251