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