Centralized init
[squirrelmail.git] / plugins / listcommands / mailout.php
CommitLineData
73ee43b1 1<?php
793566f0 2
519f07d7 3/**
4 * mailout.php
73ee43b1 5 *
47ccfad4 6 * @copyright &copy; 1999-2006 The SquirrelMail Project Team
4b4abf93 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
793566f0 8 * @version $Id$
ea5f4b8e 9 * @package plugins
10 * @subpackage listcommands
73ee43b1 11 */
202bcbcc 12/**
13 * Path for SquirrelMail required files.
14 * @ignore
15 */
16require('../../include/init.php');
cdf82d4a 17
18/* SquirrelMail required files. */
202bcbcc 19require(SM_PATH . 'functions/identity.php');
20require(SM_PATH . 'functions/forms.php');
21require(SM_PATH . 'plugins/listcommands/functions.php');
73ee43b1 22
6a85a764 23/* get globals */
b587ac51 24sqgetGlobalVar('mailbox', $mailbox, SQ_GET);
25sqgetGlobalVar('send_to', $send_to, SQ_GET);
26sqgetGlobalVar('subject', $subject, SQ_GET);
27sqgetGlobalVar('body', $body, SQ_GET);
28sqgetGlobalVar('action', $action, SQ_GET);
6a85a764 29
793566f0 30displayPageHeader($color, $mailbox);
31$fieldsdescr = listcommands_fieldsdescr();
32
73ee43b1 33switch ( $action ) {
793566f0 34 case 'help':
35 $out_string = _("This will send a message to %s requesting help for this list. You will receive an emailed response at the address below.");
36 break;
37 case 'subscribe':
38 $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.");
39 break;
40 case 'unsubscribe':
41 $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.");
a6d3eff6 42 break;
43 default:
44 error_box(sprintf(_("Unknown action: %s"),htmlspecialchars($action)), $color);
45 exit;
73ee43b1 46}
47
a6d3eff6 48echo html_tag('p', '', 'left' ) .
49 html_tag( 'table', '', 'center', $color[0], 'border="0" width="75%"' ) . "\n" .
50 html_tag( 'tr',
51 html_tag( 'th', _("Mailinglist") . ': ' . $fieldsdescr[$action], '', $color[9] )
52 ) .
53 html_tag( 'tr' ) .
54 html_tag( 'td', '', 'left' );
55
793566f0 56printf($out_string, '&quot;' . htmlspecialchars($send_to) . '&quot;');
73ee43b1 57
793566f0 58echo addForm(SM_PATH . 'src/compose.php', 'post');
73ee43b1 59
27544ac4 60$idents = get_identities();
61
4cf43843 62echo html_tag('p', '', 'center' ) . _("From:") . ' ';
73ee43b1 63
27544ac4 64if (count($idents) > 1) {
65 echo '<select name="identity">';
66 foreach($idents as $nr=>$data) {
67 echo '<option value="' . $nr . '">' .
68 htmlspecialchars(
793566f0 69 $data['full_name'].' <'.
70 $data['email_address'] . ">\n");
050722c4 71 }
73ee43b1 72 echo '</select>' . "\n" ;
050722c4 73} else {
15ac78fe 74 echo htmlspecialchars('"'.$idents[0]['full_name'].'" <'.$idents[0]['email_address'].'>');
050722c4 75}
76
793566f0 77echo '<br />' .
78 addHidden('send_to', $send_to) .
79 addHidden('subject', $subject) .
80 addHidden('body', $body) .
81 addHidden('mailbox', $mailbox) .
82 addSubmit(_("Send Mail"), 'send');
83?>
c49cc6db 84<br /><br />
793566f0 85</form></td></tr></table></p></body></html>