phpDoc and i18n fixes.
[squirrelmail.git] / plugins / listcommands / mailout.php
1 <?php
2
3 /**
4 * mailout.php
5 *
6 * Copyright (c) 1999-2005 The SquirrelMail Project Team
7 * Licensed under the GNU GPL. For full terms see the file COPYING.
8 *
9 * @version $Id$
10 * @package plugins
11 * @subpackage listcommands
12 */
13
14 /** @ignore */
15 define('SM_PATH','../../');
16
17 /* SquirrelMail required files. */
18 require_once(SM_PATH . 'include/validate.php');
19 include_once(SM_PATH . 'functions/page_header.php');
20 include_once(SM_PATH . 'include/load_prefs.php');
21 include_once(SM_PATH . 'functions/html.php');
22 require_once(SM_PATH . 'functions/identity.php');
23 require_once(SM_PATH . 'functions/forms.php');
24 include_once(SM_PATH . 'plugins/listcommands/functions.php');
25
26 /* get globals */
27 sqgetGlobalVar('mailbox', $mailbox, SQ_GET);
28 sqgetGlobalVar('send_to', $send_to, SQ_GET);
29 sqgetGlobalVar('subject', $subject, SQ_GET);
30 sqgetGlobalVar('body', $body, SQ_GET);
31 sqgetGlobalVar('action', $action, SQ_GET);
32
33 displayPageHeader($color, $mailbox);
34 $fieldsdescr = listcommands_fieldsdescr();
35
36 echo html_tag('p', '', 'left' ) .
37 html_tag( 'table', '', 'center', $color[0], 'border="0" width="75%"' ) . "\n" .
38 html_tag( 'tr',
39 html_tag( 'th', _("Mailinglist") . ': ' . $fieldsdescr[$action], '', $color[9] )
40 ) .
41 html_tag( 'tr' ) .
42 html_tag( 'td', '', 'left' );
43
44 switch ( $action ) {
45 case 'help':
46 $out_string = _("This will send a message to %s requesting help for this list. You will receive an emailed response at the address below.");
47 break;
48 case 'subscribe':
49 $out_string = _("This will send a message to %s requesting that you will be subscribed to this list. You will be subscribed with the address below.");
50 break;
51 case 'unsubscribe':
52 $out_string = _("This will send a message to %s requesting that you will be unsubscribed from this list. It will try to unsubscribe the adress below.");
53 }
54
55 printf($out_string, '&quot;' . htmlspecialchars($send_to) . '&quot;');
56
57 echo addForm(SM_PATH . 'src/compose.php', 'post');
58
59 $idents = get_identities();
60
61 echo html_tag('p', '', 'center' ) . _("From:") . ' ';
62
63 if (count($idents) > 1) {
64 echo '<select name="identity">';
65 foreach($idents as $nr=>$data) {
66 echo '<option value="' . $nr . '">' .
67 htmlspecialchars(
68 $data['full_name'].' <'.
69 $data['email_address'] . ">\n");
70 }
71 echo '</select>' . "\n" ;
72 } else {
73 echo htmlspecialchars('"'.$idents[0]['full_name'].'" <'.$idents[0]['email_address'].'>');
74 }
75
76 echo '<br />' .
77 addHidden('send_to', $send_to) .
78 addHidden('subject', $subject) .
79 addHidden('body', $body) .
80 addHidden('mailbox', $mailbox) .
81 addSubmit(_("Send Mail"), 'send');
82 ?>
83 <br /><br /></center>
84 </form></td></tr></table></p></body></html>