Page MenuHomePhorge

No OneTemporary

Size
62 KB
Referenced Files
None
Subscribers
None
This document is not UTF8. It was detected as ISO-8859-1 (Latin 1) and converted to UTF8 for display.
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index 6d4cf9a61..64b0d6364 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -1,791 +1,799 @@
<?php
/*
+-----------------------------------------------------------------------+
| program/steps/mail/compose.inc |
| |
| This file is part of the RoundCube Webmail client |
| Copyright (C) 2005, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| Compose a new mail message with all headers and attachments |
| |
+-----------------------------------------------------------------------+
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
$Id$
*/
require_once('Mail/mimeDecode.php');
$MESSAGE_FORM = NULL;
$REPLY_MESSAGE = NULL;
$FORWARD_MESSAGE = NULL;
$DRAFT_MESSAGE = NULL;
if (!is_array($_SESSION['compose']))
$_SESSION['compose'] = array('id' => uniqid(rand()));
// remove an attachment
if ($_action=='remove-attachment' && !empty($_GET['_filename']))
{
if (is_array($_SESSION['compose']['attachments']))
foreach ($_SESSION['compose']['attachments'] as $i => $attachment)
if ($attachment['name'] == $_GET['_filename'])
{
@unlink($attachment['path']);
unset($_SESSION['compose']['attachments'][$i]);
$commands = sprintf("parent.%s.remove_from_attachment_list('%s');\n", $JS_OBJECT_NAME, $_GET['_filename']);
rcube_remote_response($commands);
exit;
}
}
// add some labels to client
rcube_add_label('nosubject', 'norecipientwarning', 'nosubjectwarning', 'nobodywarning', 'notsentwarning', 'savingmessage', 'savingmessage', 'messagesaved');
if ($_GET['_reply_uid'] || $_GET['_forward_uid'] || $_GET['_draft_uid'])
{
$msg_uid = ($_GET['_reply_uid'] ? $_GET['_reply_uid'] : ($_GET['_forward_uid'] ? $_GET['_forward_uid'] : $_GET['_draft_uid']));
// similar as in program/steps/mail/show.inc
$MESSAGE = array();
$MESSAGE['headers'] = $IMAP->get_headers($msg_uid);
$MESSAGE['source'] = rcmail_message_source($msg_uid);
$mmd = new Mail_mimeDecode($MESSAGE['source']);
$MESSAGE['structure'] = $mmd->decode(array('include_bodies' => TRUE,
'decode_headers' => TRUE,
'decode_bodies' => FALSE));
$MESSAGE['subject'] = $IMAP->decode_header($MESSAGE['headers']->subject);
$MESSAGE['parts'] = $mmd->getMimeNumbers($MESSAGE['structure']);
if ($_GET['_reply_uid'])
{
$REPLY_MESSAGE = &$MESSAGE;
$_SESSION['compose']['reply_uid'] = $_GET['_reply_uid'];
$_SESSION['compose']['reply_msgid'] = $REPLY_MESSAGE['headers']->messageID;
$_SESSION['compose']['references'] = $REPLY_MESSAGE['headers']->reference;
$_SESSION['compose']['references'] .= !empty($REPLY_MESSAGE['headers']->reference) ? ' ' : '';
$_SESSION['compose']['references'] .= $REPLY_MESSAGE['headers']->messageID;
if ($_GET['_all'])
$REPLY_MESSAGE['reply_all'] = 1;
}
else if ($_GET['_forward_uid'])
{
$FORWARD_MESSAGE = $MESSAGE;
$_SESSION['compose']['forward_uid'] = $_GET['_forward_uid'];
}
else
{
$DRAFT_MESSAGE = $MESSAGE;
$_SESSION['compose']['draft_uid'] = $_GET['_draft_uid'];
}
}
/****** compose mode functions ********/
function rcmail_compose_headers($attrib)
{
global $IMAP, $REPLY_MESSAGE, $DRAFT_MESSAGE, $DB;
static $sa_recipients = array();
list($form_start, $form_end) = get_form_tags($attrib);
$out = '';
$part = strtolower($attrib['part']);
switch ($part)
{
case 'from':
return rcmail_compose_header_from($attrib);
case 'to':
$fname = '_to';
$header = 'to';
// we have contact id's as get parameters
if (!empty($_GET['_to']) && preg_match('/^[0-9]+(,[0-9]+)*$/', $_GET['_to']))
{
$a_recipients = array();
$sql_result = $DB->query("SELECT name, email
FROM ".get_table_name('contacts')."
WHERE user_id=?
AND del<>1
AND contact_id IN (".$_GET['_to'].")",
$_SESSION['user_id']);
while ($sql_arr = $DB->fetch_assoc($sql_result))
$a_recipients[] = format_email_recipient($sql_arr['email'], $sql_arr['name']);
if (sizeof($a_recipients))
$fvalue = join(', ', $a_recipients);
}
else if (!empty($_GET['_to']))
$fvalue = $_GET['_to'];
case 'cc':
if (!$fname)
{
$fname = '_cc';
$header = 'cc';
}
case 'bcc':
if (!$fname)
$fname = '_bcc';
$allow_attrib = array('id', 'class', 'style', 'cols', 'rows', 'wrap', 'tabindex');
$field_type = 'textarea';
break;
case 'replyto':
case 'reply-to':
$fname = '_replyto';
$allow_attrib = array('id', 'class', 'style', 'size', 'tabindex');
$field_type = 'textfield';
break;
}
if ($fname && !empty($_POST[$fname]))
$fvalue = get_input_value($fname, RCUBE_INPUT_POST, TRUE);
else if ($header && is_object($REPLY_MESSAGE['headers']))
{
// get recipent address(es) out of the message headers
if ($header=='to' && $REPLY_MESSAGE['headers']->replyto)
$fvalue = $IMAP->decode_header($REPLY_MESSAGE['headers']->replyto);
else if ($header=='to' && $REPLY_MESSAGE['headers']->from)
$fvalue = $IMAP->decode_header($REPLY_MESSAGE['headers']->from);
// add recipent of original message if reply to all
else if ($header=='cc' && $REPLY_MESSAGE['reply_all'])
{
if ($IMAP->decode_header($REPLY_MESSAGE['headers']->to))
$fvalue .= $IMAP->decode_header($REPLY_MESSAGE['headers']->to);
if ($IMAP->decode_header($REPLY_MESSAGE['headers']->cc))
{
if($fvalue)
$fvalue .= ', ';
$fvalue .= $IMAP->decode_header($REPLY_MESSAGE['headers']->cc);
}
}
// split recipients and put them back together in a unique way
if (!empty($fvalue))
{
$to_addresses = $IMAP->decode_address_list($fvalue);
$fvalue = '';
foreach ($to_addresses as $addr_part)
{
if (!in_array($addr_part['mailto'], $sa_recipients) && (!$REPLY_MESSAGE['FROM'] || !in_array($addr_part['mailto'], $REPLY_MESSAGE['FROM'])))
{
$fvalue .= (strlen($fvalue) ? ', ':'').$addr_part['string'];
$sa_recipients[] = $addr_part['mailto'];
}
}
}
}
else if ($header && is_object($DRAFT_MESSAGE['headers']))
{
// get drafted headers
if ($header=='to' && $DRAFT_MESSAGE['headers']->to)
$fvalue = $IMAP->decode_header($DRAFT_MESSAGE['headers']->to);
if ($header=='cc' && $DRAFT_MESSAGE['headers']->cc)
$fvalue = $IMAP->decode_header($DRAFT_MESSAGE['headers']->cc);
if ($header=='bcc' && $DRAFT_MESSAGE['headers']->bcc)
$fvalue = $IMAP->decode_header($DRAFT_MESSAGE['headers']->bcc);
}
if ($fname && $field_type)
{
// pass the following attributes to the form class
$field_attrib = array('name' => $fname);
foreach ($attrib as $attr => $value)
if (in_array($attr, $allow_attrib))
$field_attrib[$attr] = $value;
// create teaxtarea object
$input = new $field_type($field_attrib);
$out = $input->show($fvalue);
}
if ($form_start)
$out = $form_start.$out;
return $out;
}
function rcmail_compose_header_from($attrib)
{
global $IMAP, $REPLY_MESSAGE, $DRAFT_MESSAGE, $DB, $OUTPUT, $JS_OBJECT_NAME;
// pass the following attributes to the form class
$field_attrib = array('name' => '_from');
foreach ($attrib as $attr => $value)
if (in_array($attr, array('id', 'class', 'style', 'size', 'tabindex')))
$field_attrib[$attr] = $value;
// extract all recipients of the reply-message
$a_recipients = array();
if ($REPLY_MESSAGE && is_object($REPLY_MESSAGE['headers']))
{
$REPLY_MESSAGE['FROM'] = array();
$a_to = $IMAP->decode_address_list($REPLY_MESSAGE['headers']->to);
foreach ($a_to as $addr)
{
if (!empty($addr['mailto']))
$a_recipients[] = $addr['mailto'];
}
if (!empty($REPLY_MESSAGE['headers']->cc))
{
$a_cc = $IMAP->decode_address_list($REPLY_MESSAGE['headers']->cc);
foreach ($a_cc as $addr)
{
if (!empty($addr['mailto']))
$a_recipients[] = $addr['mailto'];
}
}
}
// get this user's identities
$sql_result = $DB->query("SELECT identity_id, name, email, signature
FROM ".get_table_name('identities')."
WHERE user_id=?
AND del<>1
ORDER BY ".$DB->quoteIdentifier('standard')." DESC, name ASC",
$_SESSION['user_id']);
if ($DB->num_rows($sql_result))
{
$from_id = 0;
$a_signatures = array();
$field_attrib['onchange'] = "$JS_OBJECT_NAME.change_identity(this)";
$select_from = new select($field_attrib);
while ($sql_arr = $DB->fetch_assoc($sql_result))
{
$select_from->add(format_email_recipient($sql_arr['email'], $sql_arr['name']), $sql_arr['identity_id']);
// add signature to array
if (!empty($sql_arr['signature']))
$a_signatures[$sql_arr['identity_id']] = $sql_arr['signature'];
// set identity if it's one of the reply-message recipients
if (in_array($sql_arr['email'], $a_recipients))
$from_id = $sql_arr['identity_id'];
if ($REPLY_MESSAGE && is_array($REPLY_MESSAGE['FROM']))
$REPLY_MESSAGE['FROM'][] = $sql_arr['email'];
if (strstr($DRAFT_MESSAGE['headers']->from,$sql_arr['email']))
$from_id = $sql_arr['identity_id'];
}
// overwrite identity selection with post parameter
if (isset($_POST['_from']))
$from_id = $_POST['_from'];
$out = $select_from->show($from_id);
// add signatures to client
$OUTPUT->add_script(sprintf("%s.set_env('signatures', %s);", $JS_OBJECT_NAME, array2js($a_signatures)));
}
else
{
$input_from = new textfield($field_attrib);
$out = $input_from->show($_POST['_from']);
}
if ($form_start)
$out = $form_start.$out;
return $out;
}
function rcmail_compose_body($attrib)
{
global $CONFIG, $OUTPUT, $REPLY_MESSAGE, $FORWARD_MESSAGE, $DRAFT_MESSAGE, $JS_OBJECT_NAME;
list($form_start, $form_end) = get_form_tags($attrib);
unset($attrib['form']);
if (empty($attrib['id']))
$attrib['id'] = 'rcmComposeMessage';
$attrib['name'] = '_message';
$textarea = new textarea($attrib);
$body = '';
// use posted message body
if (!empty($_POST['_message']))
$body = get_input_value('_message', RCUBE_INPUT_POST, TRUE);
// compose reply-body
else if (is_array($REPLY_MESSAGE['parts']))
{
$body = rcmail_first_text_part($REPLY_MESSAGE['parts']);
if (strlen($body))
$body = rcmail_create_reply_body($body);
}
// forward message body inline
else if (is_array($FORWARD_MESSAGE['parts']))
{
$body = rcmail_first_text_part($FORWARD_MESSAGE['parts']);
if (strlen($body))
$body = rcmail_create_forward_body($body);
}
// forward message body inline
else if (is_array($DRAFT_MESSAGE['parts']))
{
$body = rcmail_first_text_part($DRAFT_MESSAGE['parts']);
if (strlen($body))
$body = rcmail_create_draft_body($body);
}
$out = $form_start ? "$form_start\n" : '';
// Check if a previous save was done so we can delete it upon the next save
if (!empty($_POST['_draft_newsaveid']))
$saveid = new hiddenfield(array('name' => '_draft_saveid', 'value' => $_POST['_draft_newsaveid']));
else if (strlen($DRAFT_MESSAGE['headers']->messageID) > 6)
$saveid = new hiddenfield(array('name' => '_draft_saveid', 'value' => str_replace(array('<','>'),"",$DRAFT_MESSAGE['headers']->messageID) ));
if ($saveid)
$out .= $saveid->show();
$newsaveid = new hiddenfield(array('name' => '_draft_newsaveid', 'value' => sprintf('%s@%s', md5(uniqid('rcmail'.rand(),true)), $_SESSION['imap_host']) ));
$out .= $newsaveid->show();
$drafttoggle = new hiddenfield(array('name' => '_draft', 'value' => 'yes'));
$out .= $drafttoggle->show();
$out .= $textarea->show($body);
$out .= $form_end ? "\n$form_end" : '';
// include GoogieSpell
if (!empty($CONFIG['enable_spellcheck']))
{
$OUTPUT->include_script('googiespell.js');
$OUTPUT->add_script(sprintf("var googie = new GoogieSpell('\$__skin_path/images/googiespell/','%s&_action=spell&lang=');\n".
"googie.lang_chck_spell = \"%s\";\n".
"googie.lang_rsm_edt = \"%s\";\n".
"googie.lang_close = \"%s\";\n".
"googie.lang_revert = \"%s\";\n".
"googie.lang_no_error_found = \"%s\";\n".
"googie.decorateTextarea('%s');\n".
"%s.set_env('spellcheck', googie);",
$GLOBALS['COMM_PATH'],
rep_specialchars_output(rcube_label('checkspelling')),
rep_specialchars_output(rcube_label('resumeediting')),
rep_specialchars_output(rcube_label('close')),
rep_specialchars_output(rcube_label('revertto')),
rep_specialchars_output(rcube_label('nospellerrors')),
$attrib['id'],
$JS_OBJECT_NAME), 'foot');
rcube_add_label('checking');
}
return $out;
}
function rcmail_create_reply_body($body)
{
global $IMAP, $REPLY_MESSAGE;
// soft-wrap message first
$body = wordwrap($body, 75);
// split body into single lines
$a_lines = preg_split('/\r?\n/', $body);
// add > to each line
for($n=0; $n<sizeof($a_lines); $n++)
{
if (strpos($a_lines[$n], '>')===0)
$a_lines[$n] = '>'.$a_lines[$n];
else
$a_lines[$n] = '> '.$a_lines[$n];
}
$body = join("\n", $a_lines);
// add title line
$pefix = sprintf("\n\n\nOn %s, %s wrote:\n",
$REPLY_MESSAGE['headers']->date,
$IMAP->decode_header($REPLY_MESSAGE['headers']->from));
// try to remove the signature
if ($sp = strrpos($body, '-- '))
{
if ($body{$sp+3}==' ' || $body{$sp+3}=="\n" || $body{$sp+3}=="\r")
$body = substr($body, 0, $sp-1);
}
return $pefix.$body;
}
function rcmail_create_forward_body($body)
{
global $IMAP, $FORWARD_MESSAGE;
// soft-wrap message first
$body = wordwrap($body, 80);
$prefix = sprintf("\n\n\n-------- Original Message --------\nSubject: %s\nDate: %s\nFrom: %s\nTo: %s\n\n",
$FORWARD_MESSAGE['subject'],
$FORWARD_MESSAGE['headers']->date,
$IMAP->decode_header($FORWARD_MESSAGE['headers']->from),
$IMAP->decode_header($FORWARD_MESSAGE['headers']->to));
// add attachments
if (!isset($_SESSION['compose']['forward_attachments']) && is_array($FORWARD_MESSAGE['parts']) && sizeof($FORWARD_MESSAGE['parts'])>1)
{
$temp_dir = rcmail_create_compose_tempdir();
if (!is_array($_SESSION['compose']['attachments']))
$_SESSION['compose']['attachments'] = array();
foreach ($FORWARD_MESSAGE['parts'] as $part)
{
if ($part->disposition=='attachment' || $part->disposition=='inline' || $part->headers['content-id'] ||
(empty($part->disposition) && ($part->d_parameters['filename'] || $part->ctype_parameters['name'])))
{
$tmp_path = tempnam($temp_dir, 'rcmAttmnt');
if ($fp = fopen($tmp_path, 'w'))
{
fwrite($fp, $IMAP->mime_decode($part->body, $part->headers['content-transfer-encoding']));
fclose($fp);
if ($part->d_parameters['filename'])
$_SESSION['compose']['attachments'][] = array('name' => $part->d_parameters['filename'],
'mimetype' => $part->ctype_primary . '/' . $part->ctype_secondary,
'path' => $tmp_path);
else if ($part->ctype_parameters['name'])
$_SESSION['compose']['attachments'][] = array('name' => $part->ctype_parameters['name'],
'mimetype' => $part->ctype_primary . '/' . $part->ctype_secondary,
'path' => $tmp_path);
else if ($part->headers['content-description'])
$_SESSION['compose']['attachments'][] = array('name' => $part->headers['content-description'],
'mimetype' => $part->ctype_primary . '/' . $part->ctype_secondary,
'path' => $tmp_path);
}
}
}
$_SESSION['compose']['forward_attachments'] = TRUE;
}
return $prefix.$body;
}
function rcmail_create_draft_body($body)
{
global $IMAP, $DRAFT_MESSAGE;
// add attachments
if (!isset($_SESSION['compose']['forward_attachments']) && is_array($DRAFT_MESSAGE['parts']) && sizeof($DRAFT_MESSAGE['parts'])>1)
{
$temp_dir = rcmail_create_compose_tempdir();
if (!is_array($_SESSION['compose']['attachments']))
$_SESSION['compose']['attachments'] = array();
foreach ($DRAFT_MESSAGE['parts'] as $part)
{
if ($part->disposition=='attachment' || $part->disposition=='inline' || $part->headers['content-id'] ||
(empty($part->disposition) && ($part->d_parameters['filename'] || $part->ctype_parameters['name'])))
{
$tmp_path = tempnam($temp_dir, 'rcmAttmnt');
if ($fp = fopen($tmp_path, 'w'))
{
fwrite($fp, $IMAP->mime_decode($part->body, $part->headers['content-transfer-encoding']));
fclose($fp);
if ($part->d_parameters['filename'])
$_SESSION['compose']['attachments'][] = array('name' => $part->d_parameters['filename'],
'mimetype' => $part->ctype_primary . '/' . $part->ctype_secondary,
'path' => $tmp_path);
else if ($part->ctype_parameters['name'])
$_SESSION['compose']['attachments'][] = array('name' => $part->ctype_parameters['name'],
'mimetype' => $part->ctype_primary . '/' . $part->ctype_secondary,
'path' => $tmp_path);
else if ($part->headers['content-description'])
$_SESSION['compose']['attachments'][] = array('name' => $part->headers['content-description'],
'mimetype' => $part->ctype_primary . '/' . $part->ctype_secondary,
'path' => $tmp_path);
}
}
}
$_SESSION['compose']['forward_attachments'] = TRUE;
}
return $body;
}
function rcmail_compose_subject($attrib)
{
global $CONFIG, $REPLY_MESSAGE, $FORWARD_MESSAGE, $DRAFT_MESSAGE;
list($form_start, $form_end) = get_form_tags($attrib);
unset($attrib['form']);
$attrib['name'] = '_subject';
$textfield = new textfield($attrib);
$subject = '';
// use subject from post
if (isset($_POST['_subject']))
$subject = get_input_value('_subject', RCUBE_INPUT_POST, TRUE);
// create a reply-subject
else if (isset($REPLY_MESSAGE['subject']))
{
if (eregi('^re:', $REPLY_MESSAGE['subject']))
$subject = $REPLY_MESSAGE['subject'];
else
$subject = 'Re: '.$REPLY_MESSAGE['subject'];
}
// create a forward-subject
else if (isset($FORWARD_MESSAGE['subject']))
{
if (eregi('^fwd:', $REPLY_MESSAGE['subject']))
$subject = $FORWARD_MESSAGE['subject'];
else
$subject = 'Fwd: '.$FORWARD_MESSAGE['subject'];
}
// creeate a draft-subject
else if (isset($DRAFT_MESSAGE['subject']))
$subject = $DRAFT_MESSAGE['subject'];
$out = $form_start ? "$form_start\n" : '';
$out .= $textfield->show($subject);
$out .= $form_end ? "\n$form_end" : '';
return $out;
}
function rcmail_compose_attachment_list($attrib)
{
global $OUTPUT, $JS_OBJECT_NAME;
// add ID if not given
if (!$attrib['id'])
$attrib['id'] = 'rcmAttachmentList';
// allow the following attributes to be added to the <ul> tag
$attrib_str = create_attrib_string($attrib, array('id', 'class', 'style'));
$out = '<ul'. $attrib_str . ">\n";
if (is_array($_SESSION['compose']['attachments']))
{
if ($attrib['deleteicon'])
- $button = sprintf('<img src="%s%s" alt="%s" border="0" / style="padding-right:2px;vertical-align:middle">', $CONFIG['skin_path'], $attrib['deleteicon'], rcube_label('delete'));
+ $button = sprintf('<img src="%s%s" alt="%s" border="0" / style="padding-right:2px;vertical-align:middle">',
+ $CONFIG['skin_path'],
+ $attrib['deleteicon'],
+ rcube_label('delete'));
else
$button = rcube_label('delete');
foreach ($_SESSION['compose']['attachments'] as $i => $a_prop)
- $out .= sprintf('<li id="%s"><a href="#" onclick="%s.command(\'remove-attachment\',\'%s\')" title="%s">%s</a>%s</li>', $a_prop['name'], $JS_OBJECT_NAME, $a_prop['name'], rcube_label('deletefolder'), $button, $a_prop['name']);
+ $out .= sprintf('<li id="%s"><a href="#" onclick="%s.command(\'remove-attachment\',\'%s\')" title="%s">%s</a>%s</li>',
+ $a_prop['name'],
+ $JS_OBJECT_NAME,
+ $a_prop['name'],
+ rcube_label('delete'),
+ $button, $a_prop['name']);
}
$OUTPUT->add_script(sprintf("%s.gui_object('attachmentlist', '%s');", $JS_OBJECT_NAME, $attrib['id']));
$out .= '</ul>';
return $out;
}
function rcmail_compose_attachment_form($attrib)
{
global $OUTPUT, $JS_OBJECT_NAME, $SESS_HIDDEN_FIELD;
// add ID if not given
if (!$attrib['id'])
$attrib['id'] = 'rcmUploadbox';
// allow the following attributes to be added to the <div> tag
$attrib_str = create_attrib_string($attrib, array('id', 'class', 'style'));
$input_field = rcmail_compose_attachment_field(array());
$label_send = rcube_label('upload');
$label_close = rcube_label('close');
$out = <<<EOF
<div$attrib_str>
<form action="./" method="post" enctype="multipart/form-data">
$SESS_HIDDEN_FIELD
$input_field<br />
<input type="button" value="$label_close" class="button" onclick="document.getElementById('$attrib[id]').style.visibility='hidden'" />
<input type="button" value="$label_send" class="button" onclick="$JS_OBJECT_NAME.command('send-attachment', this.form)" />
</form>
</div>
EOF;
$OUTPUT->add_script(sprintf("%s.gui_object('uploadbox', '%s');", $JS_OBJECT_NAME, $attrib['id']));
return $out;
}
function rcmail_compose_attachment_field($attrib)
{
// allow the following attributes to be added to the <input> tag
$attrib_str = create_attrib_string($attrib, array('id', 'class', 'style', 'size'));
$out = '<input type="file" name="_attachments[]"'. $attrib_str . " />";
return $out;
}
function rcmail_priority_selector($attrib)
{
list($form_start, $form_end) = get_form_tags($attrib);
unset($attrib['form']);
$attrib['name'] = '_priority';
$selector = new select($attrib);
$selector->add(array(rcube_label('lowest'),
rcube_label('low'),
rcube_label('normal'),
rcube_label('high'),
rcube_label('highest')),
array(5, 4, 0, 2, 1));
$sel = isset($_POST['_priority']) ? $_POST['_priority'] : 0;
$out = $form_start ? "$form_start\n" : '';
$out .= $selector->show($sel);
$out .= $form_end ? "\n$form_end" : '';
return $out;
}
function rcmail_receipt_checkbox($attrib)
{
list($form_start, $form_end) = get_form_tags($attrib);
unset($attrib['form']);
$attrib['name'] = '_receipt';
$checkbox = new checkbox(array('name' => '_receipt', 'id' => 'receipt', 'value' => 1));
$out = $form_start ? "$form_start\n" : '';
$out .= $checkbox->show(0);
$out .= $form_end ? "\n$form_end" : '';
return $out;
}
function get_form_tags($attrib)
{
global $CONFIG, $OUTPUT, $JS_OBJECT_NAME, $MESSAGE_FORM, $SESS_HIDDEN_FIELD;
$form_start = '';
if (!strlen($MESSAGE_FORM))
{
$hiddenfields = new hiddenfield(array('name' => '_task', 'value' => $GLOBALS['_task']));
$hiddenfields->add(array('name' => '_action', 'value' => 'send'));
$form_start = empty($attrib['form']) ? '<form name="form" action="./" method="post">' : '';
$form_start .= "\n$SESS_HIDDEN_FIELD\n";
$form_start .= $hiddenfields->show();
}
$form_end = (strlen($MESSAGE_FORM) && !strlen($attrib['form'])) ? '</form>' : '';
$form_name = !empty($attrib['form']) ? $attrib['form'] : 'form';
if (!strlen($MESSAGE_FORM))
$OUTPUT->add_script("$JS_OBJECT_NAME.gui_object('messageform', '$form_name');");
$MESSAGE_FORM = $form_name;
return array($form_start, $form_end);
}
function format_email_recipient($email, $name='')
{
if ($name && $name != $email)
return sprintf('%s <%s>', strpos($name, ",") ? '"'.$name.'"' : $name, $email);
else
return $email;
}
function rcmail_charset_pulldown($selected='ISO-8859-1')
{
$select = new select();
return $select->show($selected);
}
/****** get contacts for this user and add them to client scripts ********/
$sql_result = $DB->query("SELECT name, email
FROM ".get_table_name('contacts')." WHERE user_id=?
AND del<>1",$_SESSION['user_id']);
if ($DB->num_rows($sql_result))
{
$a_contacts = array();
while ($sql_arr = $DB->fetch_assoc($sql_result))
if ($sql_arr['email'])
$a_contacts[] = format_email_recipient($sql_arr['email'], rep_specialchars_output($sql_arr['name'], 'js'));
$OUTPUT->add_script(sprintf("$JS_OBJECT_NAME.set_env('contacts', %s);", array2js($a_contacts)));
}
parse_template('compose');
?>
diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc
index a57f2d4ed..33c1a405e 100644
--- a/program/steps/mail/sendmail.inc
+++ b/program/steps/mail/sendmail.inc
@@ -1,370 +1,370 @@
<?php
/*
+-----------------------------------------------------------------------+
| program/steps/mail/sendmail.inc |
| |
| This file is part of the RoundCube Webmail client |
| Copyright (C) 2005, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| Compose a new mail message with all headers and attachments |
| and send it using IlohaMail's SMTP methods or with PHP mail() |
| |
+-----------------------------------------------------------------------+
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
$Id$
*/
//require_once('lib/smtp.inc');
require_once('include/rcube_smtp.inc');
require_once('Mail/mime.php');
if (!isset($_SESSION['compose']['id']))
{
rcmail_overwrite_action('list');
return;
}
/****** message sending functions ********/
function rcmail_get_identity($id)
{
global $DB, $CHARSET, $OUTPUT;
// get identity record
$sql_result = $DB->query("SELECT *, email AS mailto
FROM ".get_table_name('identities')."
WHERE identity_id=?
AND user_id=?
AND del<>1",
$id,$_SESSION['user_id']);
if ($DB->num_rows($sql_result))
{
$sql_arr = $DB->fetch_assoc($sql_result);
$out = $sql_arr;
$out['string'] = sprintf('%s <%s>',
rcube_charset_convert($sql_arr['name'], $CHARSET, $OUTPUT->get_charset()),
$sql_arr['mailto']);
return $out;
}
return FALSE;
}
if (strlen($_POST['_draft_saveid']) > 3)
$olddraftmessageid = get_input_value('_draft_saveid', RCUBE_INPUT_POST);
if (strlen($_POST['_draft_newsaveid']) > 3)
$newdraftmessageid = get_input_value('_draft_newsaveid', RCUBE_INPUT_POST);
$savedraft = !empty($_POST['_draft']) ? TRUE : FALSE;
/****** check submission and compose message ********/
if (empty($_POST['_to']) && empty($_POST['_subject']) && $_POST['_message'])
{
show_message("sendingfailed", 'error');
rcmail_overwrite_action('compose');
return;
}
// set default charset
$input_charset = $OUTPUT->get_charset();
$message_charset = isset($_POST['_charset']) ? $_POST['_charset'] : $input_charset;
$mailto_regexp = array('/[,;]\s*[\r\n]+/', '/[\r\n]+/', '/[,;]\s*$/m');
$mailto_replace = array(', ', ', ', '');
// repalce new lines and strip ending ', '
$mailto = preg_replace($mailto_regexp, $mailto_replace, get_input_value('_to', RCUBE_INPUT_POST, TRUE, $message_charset));
// decode address strings
$to_address_arr = $IMAP->decode_address_list($mailto);
$identity_arr = rcmail_get_identity(get_input_value('_from', RCUBE_INPUT_POST));
$from = $identity_arr['mailto'];
$first_to = is_array($to_address_arr[0]) ? $to_address_arr[0]['mailto'] : $mailto;
// try the message-id submitted by the compose form
if ($newdraftmessageid)
$message_id = sprintf('<%s>',$newdraftmessageid);
else
$message_id = sprintf('<%s@%s>', md5(uniqid('rcmail'.rand(),true)), $_SESSION['imap_host']);
if (empty($identity_arr['string']))
$identity_arr['string'] = $from;
// compose headers array
$headers = array('Date' => date('D, j M Y G:i:s O'),
'From' => $identity_arr['string'],
- 'To' => $mailto);
+ 'To' => rcube_charset_convert($mailto, $input_charset, $message_charset));
// additional recipients
if (!empty($_POST['_cc']))
$headers['Cc'] = preg_replace($mailto_regexp, $mailto_replace, get_input_value('_cc', RCUBE_INPUT_POST, TRUE, $message_charset));
if (!empty($_POST['_bcc']))
$headers['Bcc'] = preg_replace($mailto_regexp, $mailto_replace, get_input_value('_bcc', RCUBE_INPUT_POST, TRUE, $message_charset));
if (!empty($identity_arr['bcc']))
$headers['Bcc'] = ($headers['Bcc'] ? $headers['Bcc'].', ' : '') . $identity_arr['bcc'];
// add subject
$headers['Subject'] = trim(get_input_value('_subject', RCUBE_INPUT_POST, FALSE, $message_charset));
if (!empty($identity_arr['organization']))
$headers['Organization'] = $identity_arr['organization'];
if (!empty($identity_arr['reply-to']))
$headers['Reply-To'] = $identity_arr['reply-to'];
if (!empty($_SESSION['compose']['reply_msgid']))
$headers['In-Reply-To'] = $_SESSION['compose']['reply_msgid'];
if (!empty($_SESSION['compose']['references']))
$headers['References'] = $_SESSION['compose']['references'];
if (!empty($_POST['_priority']))
{
$priority = (int)$_POST['_priority'];
$a_priorities = array(1=>'lowest', 2=>'low', 4=>'high', 5=>'highest');
if ($str_priority = $a_priorities[$priority])
$headers['X-Priority'] = sprintf("%d (%s)", $priority, ucfirst($str_priority));
}
if (!empty($_POST['_receipt']))
{
$headers['Return-Receipt-To'] = $identity_arr['string'];
$headers['Disposition-Notification-To'] = $identity_arr['string'];
}
// additional headers
$headers['Message-ID'] = $message_id;
$headers['X-Sender'] = $from;
if (!empty($CONFIG['useragent']))
$headers['User-Agent'] = $CONFIG['useragent'];
// fetch message body
$message_body = get_input_value('_message', RCUBE_INPUT_POST, TRUE, $message_charset);
// append generic footer to all messages
if (!empty($CONFIG['generic_message_footer']))
{
$file = realpath($CONFIG['generic_message_footer']);
if($fp = fopen($file, 'r'))
{
$content = fread($fp, filesize($file));
fclose($fp);
$message_body .= "\r\n" . rcube_charset_convert($content, 'UTF-8', $message_charset);
}
}
// try to autodetect operating system and use the correct line endings
// use the configured delimiter for headers
if (!empty($CONFIG['mail_header_delimiter']))
$header_delm = $CONFIG['mail_header_delimiter'];
else if (strtolower(substr(PHP_OS, 0, 3)=='win'))
$header_delm = "\r\n";
else if (strtolower(substr(PHP_OS, 0, 3)=='mac'))
$header_delm = "\r\n";
else
$header_delm = "\n";
// create PEAR::Mail_mime instance
$MAIL_MIME = new Mail_mime($header_delm);
$MAIL_MIME->setTXTBody($message_body, FALSE, TRUE);
//$MAIL_MIME->setTXTBody(wordwrap($message_body), FALSE, TRUE);
// add stored attachments, if any
if (is_array($_SESSION['compose']['attachments']))
foreach ($_SESSION['compose']['attachments'] as $attachment)
$MAIL_MIME->addAttachment($attachment['path'], $attachment['mimetype'], $attachment['name'], TRUE);
// add submitted attachments
if (is_array($_FILES['_attachments']['tmp_name']))
foreach ($_FILES['_attachments']['tmp_name'] as $i => $filepath)
$MAIL_MIME->addAttachment($filepath, $files['type'][$i], $files['name'][$i], TRUE);
// chose transfer encoding
$charset_7bit = array('ASCII', 'ISO-2022-JP', 'ISO-8859-1', 'ISO-8859-2', 'ISO-8859-15');
$transfer_encoding = in_array(strtoupper($message_charset), $charset_7bit) ? '7bit' : '8bit';
// encoding settings for mail composing
$message_param = array('text_encoding' => $transfer_encoding,
'html_encoding' => 'quoted-printable',
'head_encoding' => 'quoted-printable',
'head_charset' => $message_charset,
'html_charset' => $message_charset,
'text_charset' => $message_charset);
// compose message body and get headers
$msg_body = &$MAIL_MIME->get($message_param);
$msg_subject = $headers['Subject'];
if ($MBSTRING && function_exists("mb_encode_mimeheader"))
$headers['Subject'] = mb_encode_mimeheader($headers['Subject'], $message_charset);
// Begin SMTP Delivery Block
if (!$savedraft) {
// send thru SMTP server using custom SMTP library
if ($CONFIG['smtp_server'])
{
// generate list of recipients
$a_recipients = array($mailto);
if (strlen($headers['Cc']))
$a_recipients[] = $headers['Cc'];
if (strlen($headers['Bcc']))
$a_recipients[] = $headers['Bcc'];
// clean Bcc from header for recipients
$send_headers = $headers;
unset($send_headers['Bcc']);
// generate message headers
$header_str = $MAIL_MIME->txtHeaders($send_headers);
// send message
$sent = smtp_mail($from, $a_recipients, $header_str, $msg_body);
// log error
if (!$sent)
{
raise_error(array('code' => 800,
'type' => 'smtp',
'line' => __LINE__,
'file' => __FILE__,
'message' => "SMTP error: $SMTP_ERROR"), TRUE, FALSE);
}
}
// send mail using PHP's mail() function
else
{
// unset some headers because they will be added by the mail() function
$headers_enc = $MAIL_MIME->headers($headers);
$headers_php = $MAIL_MIME->_headers;
unset($headers_php['To'], $headers_php['Subject']);
// reset stored headers and overwrite
$MAIL_MIME->_headers = array();
$header_str = $MAIL_MIME->txtHeaders($headers_php);
if (ini_get('safe_mode'))
$sent = mail($headers_enc['To'], $headers_enc['Subject'], $msg_body, $header_str);
else
$sent = mail($headers_enc['To'], $headers_enc['Subject'], $msg_body, $header_str, "-f$from");
}
// return to compose page if sending failed
if (!$sent)
{
show_message("sendingfailed", 'error');
rcmail_overwrite_action('compose');
return;
}
// set repliead flag
if ($_SESSION['compose']['reply_uid'])
$IMAP->set_flag($_SESSION['compose']['reply_uid'], 'ANSWERED');
} // End of SMTP Delivery Block
// Determine which folder to save message
if ($savedraft)
$store_target = 'drafts_mbox';
else
$store_target = 'sent_mbox';
if ($CONFIG[$store_target])
{
// create string of complete message headers
$header_str = $MAIL_MIME->txtHeaders($headers);
// check if mailbox exists
if (!in_array_nocase($CONFIG[$store_target], $IMAP->list_mailboxes()))
$store_folder = $IMAP->create_mailbox($CONFIG[$store_target], TRUE);
else
$store_folder = TRUE;
// add headers to message body
$msg_body = $header_str."\r\n".$msg_body;
// append message to sent box
if ($store_folder)
$saved = $IMAP->save_message($CONFIG[$store_target], $msg_body);
// raise error if saving failed
if (!$saved)
raise_error(array('code' => 800,
'type' => 'imap',
'file' => __FILE__,
'message' => "Could not save message in $CONFIG[$store_target]"), TRUE, FALSE);
if ($olddraftmessageid)
{
// delete previous saved draft
$a_deleteid = $IMAP->search($CONFIG['drafts_mbox'],'HEADER Message-ID',$olddraftmessageid);
$deleted = $IMAP->delete_message($IMAP->get_uid($a_deleteid[0],$CONFIG['drafts_mbox']),$CONFIG['drafts_mbox']);
if (!$deleted)
raise_error(array('code' => 800,
'type' => 'imap',
'file' => __FILE__,
'message' => "Could not delete message from ".$CONFIG['drafts_mbox']), TRUE, FALSE);
}
}
if ($savedraft)
{
show_message('messagesaved', 'confirmation');
rcmail_overwrite_action('compose');
}
else
{
if ($CONFIG['smtp_log'])
{
$log_entry = sprintf("[%s] User: %d on %s; Message for %s; Subject: %s\n",
date("d-M-Y H:i:s O", mktime()),
$_SESSION['user_id'],
$_SERVER['REMOTE_ADDR'],
$mailto,
$msg_subject);
if ($fp = @fopen($CONFIG['log_dir'].'/sendmail', 'a'))
{
fwrite($fp, $log_entry);
fclose($fp);
}
}
show_message('messagesent', 'confirmation');
rcmail_compose_cleanup();
}
?>
diff --git a/program/steps/mail/upload.inc b/program/steps/mail/upload.inc
index 7fe7d3dcc..39164bb46 100644
--- a/program/steps/mail/upload.inc
+++ b/program/steps/mail/upload.inc
@@ -1,69 +1,69 @@
<?php
/*
+-----------------------------------------------------------------------+
| program/steps/mail/upload.inc |
| |
| This file is part of the RoundCube Webmail client |
| Copyright (C) 2005, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| Handle file-upload and make them available as attachments |
| |
+-----------------------------------------------------------------------+
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
$Id$
*/
if (!$_SESSION['compose'])
{
exit;
}
// create temp dir for file uploads
$temp_dir = rcmail_create_compose_tempdir();
if (!is_array($_SESSION['compose']['attachments']))
$_SESSION['compose']['attachments'] = array();
$response = '';
foreach ($_FILES['_attachments']['tmp_name'] as $i => $filepath)
{
$tmpfname = tempnam($temp_dir, 'rcmAttmnt');
if (move_uploaded_file($filepath, $tmpfname))
{
$_SESSION['compose']['attachments'][] = array('name' => $_FILES['_attachments']['name'][$i],
'mimetype' => $_FILES['_attachments']['type'][$i],
'path' => $tmpfname);
$button = sprintf('<img src="%s/images/icons/remove-attachment.png" alt="%s" border="0" style="padding-right:2px;vertical-align:middle">', $CONFIG['skin_path'], rcube_label('delete'));
- $content = sprintf('<a href="#" onclick="%s.command(\\\'remove-attachment\\\',\\\'%s\\\')" title="%s">%s</a>%s',$JS_OBJECT_NAME, $_FILES['_attachments']['name'][$i], rcube_label('deletefolder'), $button, $_FILES['_attachments']['name'][$i]);
+ $content = sprintf('<a href="#" onclick="%s.command(\\\'remove-attachment\\\',\\\'%s\\\')" title="%s">%s</a>%s',$JS_OBJECT_NAME, $_FILES['_attachments']['name'][$i], rcube_label('delete'), $button, $_FILES['_attachments']['name'][$i]);
$response .= sprintf('parent.%s.add2attachment_list(\'%s\',\'%s\');',$JS_OBJECT_NAME, $_FILES['_attachments']['name'][$i], $content);
}
}
// send html page with JS calls as response
print <<<EOF
<html>
<script type="text/javascript">
if (parent.$JS_OBJECT_NAME)
{
$response
parent.$JS_OBJECT_NAME.show_attachment_form(false);
}
</script>
</html>
EOF;
exit;
?>
diff --git a/skins/default/images/icons/remove-attachment.png b/skins/default/images/icons/remove-attachment.png
index 0712aaa71..8d496fe10 100644
Binary files a/skins/default/images/icons/remove-attachment.png and b/skins/default/images/icons/remove-attachment.png differ
diff --git a/skins/default/mail.css b/skins/default/mail.css
index 4d54be31d..eebe5411e 100644
--- a/skins/default/mail.css
+++ b/skins/default/mail.css
@@ -1,849 +1,854 @@
/***** RoundCube|Mail mail task styles *****/
#messagetoolbar
{
position: absolute;
top: 45px;
left: 200px;
right: 250px;
height: 35px;
white-space: nowrap;
/* border: 1px solid #cccccc; */
}
#messagetoolbar a
{
padding-right: 10px;
}
#messagetoolbar select
{
font-family: "Lucida Grande", Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #333333;
}
#messagetoolbar select.mboxlist
{
position: absolute;
left: 375px;
top: 10px;
}
#messagetoolbar select.mboxlist option
{
padding-left: 15px;
}
#messagetoolbar select.mboxlist option[value="0"]
{
padding-left: 2px;
}
#listcontrols
{
position: absolute;
left: 200px;
bottom: 20px;
height: 16px;
width: 500px;
font-size: 11px;
}
#listcontrols a,
#listcontrols a:active,
#listcontrols a:visited,
#mailboxcontrols a,
#mailboxcontrols a:active,
#mailboxcontrols a:visited
{
color: #999999;
font-size: 11px;
text-decoration: none;
}
#listcontrols a.active,
#listcontrols a.active:active,
#listcontrols a.active:visited,
#mailboxcontrols a.active,
#mailboxcontrols a.active:active,
#mailboxcontrols a.active:visited
{
color: #CC0000;
}
#listcontrols a.active:hover,
#mailboxcontrols a.active:hover
{
text-decoration: underline;
}
#messagecountbar
{
position: absolute;
bottom: 16px;
right: 40px;
width: 300px;
height: 20px;
text-align: right;
white-space: nowrap;
}
#messagecountbar span
{
font-size: 11px;
color: #333333;
}
#messagepartcontainer
{
position: absolute;
top: 80px;
left: 20px;
right: 20px;
bottom: 20px;
}
#mailcontframe
{
position: absolute;
top: 85px;
left: 200px;
right: 40px;
bottom: 40px;
border: 1px solid #999999;
background-color: #F9F9F9;
overflow: auto;
/* css hack for IE */
width: expression((parseInt(document.documentElement.clientWidth)-240)+'px');
height: expression((parseInt(document.documentElement.clientHeight)-125)+'px');
}
#messagepartframe
{
border: 1px solid #999999;
background-color: #F9F9F9;
}
#partheader
{
position: absolute;
top: 10px;
left: 220px;
height: 40px;
}
#partheader table td
{
padding-left: 2px;
padding-right: 4px;
vertical-align: middle;
font-size: 11px;
}
#partheader table td.title
{
color: #666666;
font-weight: bold;
}
#rcmdraglayer
{
width: 300px;
border: 1px solid #999999;
background-color: #F9F9F9;
padding-left: 8px;
padding-right: 8px;
padding-top: 3px;
padding-bottom: 3px;
font-size: 11px;
opacity: 0.6;
-moz-opacity: 0.6;
}
/** mailbox list styles */
#mailboxlist-header
{
position: absolute;
top: 85px;
left: 20px;
width: 140px !important;
/* width: 162px; */
height: 13px;
padding: 3px 10px 2px 10px;
background-color: #EBEBEB;
background-image: url(images/listheader_aqua.gif);
border: 1px solid #CCCCCC;
color: #333333;
font-size: 11px;
font-weight: bold;
}
#mailboxlist-container
{
position: absolute;
top: 105px;
left: 20px;
width: 160px;
bottom: 40px;
border: 1px solid #CCCCCC;
background-color: #F9F9F9;
overflow: auto;
/* css hack for IE */
height: expression((parseInt(document.documentElement.clientHeight)-145)+'px');
}
#mailboxlist
{
width: 100%;
height: auto;
margin: 0px;
padding: 0px;
list-style-image: none;
list-style-type: none;
overflow: hidden;
white-space: nowrap;
}
#mailboxlist li
{
/* height: 18px; */
font-size: 11px;
background: url(images/icons/folder-closed.png) no-repeat;
background-position: 10px 1px;
border-bottom: 1px solid #EBEBEB;
/* IE 5.5 margin-left: -16px; */
}
#mailboxlist li.inbox
{
background-image: url(images/icons/folder-inbox.png);
}
#mailboxlist li.drafts
{
background-image: url(images/icons/folder-drafts.png);
}
#mailboxlist li.sent
{
background-image: url(images/icons/folder-sent.png);
}
#mailboxlist li.junk
{
background-image: url(images/icons/folder-junk.png);
}
#mailboxlist li.trash
{
background-image: url(images/icons/folder-trash.png);
}
#mailboxlist li a
{
display: block;
padding-left: 32px;
padding-top: 2px;
padding-bottom: 2px;
text-decoration: none;
}
#mailboxlist li, #mailboxlist li.unread
{
/* background-image: url(images/mailbox_list.gif); */
}
#mailboxlist li.unread
{
font-weight: bold;
}
#mailboxlist li.selected
{
background-color: #929292;
border-bottom: 1px solid #898989;
}
#mailboxlist li.selected a
{
color: #FFF;
font-weight: bold;
}
/* styles for nested folders */
#mailboxlist ul {
list-style: none;
padding: 0;
margin:0;
border-top: 1px solid #EBEBEB;
}
#mailboxlist ul li {
padding-left: 15px;
background-position: 25px 1px;
}
#mailboxlist li.selected li {
background-color: #F9F9F9;
}
#mailboxlist li.unread li {
font-weight: normal;
}
#mailboxlist li.unread li.unread {
font-weight: bold;
}
#mailboxlist li.selected li a{
color: black;
font-weight: normal;
}
#mailboxcontrols
{
position: absolute;
left: 20px;
width: 160px;
bottom: 20px;
height: 16px;
overflow: hidden;
font-size: 11px;
}
/** message list styles */
body.messagelist
{
margin: 0px;
background-color: #F9F9F9;
}
#messagelist
{
width: 100%;
display: table;
table-layout: fixed;
/* css hack for IE */
width: expression(document.getElementById('mailcontframe').clientWidth);
}
#messagelist thead tr td
{
height: 20px;
padding-top: 0px;
padding-bottom: 0px;
padding-left: 2px;
padding-right: 4px;
vertical-align: middle;
border-bottom: 1px solid #999999;
color: #333333;
background-color: #EBEBEB;
background-image: url(images/listheader_aqua.gif);
font-size: 11px;
font-weight: bold;
}
#messagelist thead tr td.sortedASC,
#messagelist thead tr td.sortedDESC
{
background-image: url(images/listheader_dark.gif);
}
#messagelist thead tr td.sortedASC a
{
background: url(images/sort_asc.gif) top right no-repeat;
}
#messagelist thead tr td.sortedDESC a
{
background: url(images/sort_desc.gif) top right no-repeat;
}
#messagelist thead tr td a,
#messagelist thead tr td a:hover
{
display: block;
width: auto !important;
width: 100%;
color: #333333;
text-decoration: none;
}
#messagelist tbody tr td
{
height: 16px !important;
height: 20px;
padding: 2px;
padding-right: 4px;
font-size: 11px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
border-bottom: 1px solid #EBEBEB;
cursor: pointer;
}
#messagelist col
{
display: table-column;
text-align: left;
}
#messagelist tr td.icon
{
width: 16px;
}
#messagelist tr td.subject
{
overflow: hidden;
}
#messagelist tr td.size
{
width: 60px;
text-align: right;
}
#messagelist tr td.from,
#messagelist tr td.to
{
width: 180px;
}
#messagelist tr td.date
{
width: 110px;
}
#messagelist tr.message
{
background-color: #FFFFFF;
}
/*
#messagelist tr.odd
{
background-color: #F9F9F9;
}
*/
#messagelist tr.unread
{
font-weight: bold;
background-color: #FFFFFF;
}
#messagelist tr.selected td
{
font-weight: bold;
color: #FFFFFF;
background-color: #CC3333;
}
#messagelist tr.focused td
{
border-bottom: thin dotted;
border-top: thin dotted;
}
#messagelist tr.unfocused td
{
font-weight: bold;
color: #FFFFFF;
background-color: #929292;
}
#messagelist tr.selected td a.rcmContactAddress
{
color: #FFFFFF;
}
#messagelist tr.unfocused td a.rcmContactAddress
{
color: #FFFFFF;
}
#messagelist tr.deleted td a.rcmContactAddress
{
color: #CCCCCC;
}
#messagelist tr.deleted td,
#messagelist tr.deleted td a
{
color: #CCCCCC;
}
#quicksearchbar
{
position: absolute;
top: 60px;
right: 40px;
width: 182px;
height: 20px;
text-align: right;
background: url('images/searchfield.gif') top left no-repeat;
}
#quicksearchbar a
{
position: absolute;
top: 3px;
right: 4px;
text-decoration: none;
}
#quicksearchbar img
{
vertical-align: middle;
}
#quicksearchbox
{
position: absolute;
top: 2px;
left: 20px;
width: 140px;
font-size: 11px;
padding: 0px;
border: none;
}
/*\*/
html>body*#quicksearchbar { background-image: none; }
html>body*#quicksearchbar a { top: 5px; }
html>body*#quicksearchbar #quicksearchbox { width: 180px; top:0px; right: 1px; left: auto; }
/**/
#rcversion
{
position: absolute;
top: 67px;
left: 20px;
width: 160px;
text-align: center;
font-weight: normal;
font-size: x-small;
font-variant: small-caps;
color: #999999;
/*border: 1px solid #308014;
background-color: #b4eeb4;*/
}
/** message view styles */
#messageframe
{
position: absolute;
top: 85px;
left: 200px;
right: 40px;
bottom: 40px;
border: 1px solid #cccccc;
background-color: #FFFFFF;
overflow: auto;
/* css hack for IE */
/* margin-bottom: 10px; */
width: expression((parseInt(document.documentElement.clientWidth)-240)+'px');
height: expression((parseInt(document.documentElement.clientHeight)-125)+'px');
}
table.headers-table
{
width: 100%;
background-color: #EBEBEB;
table-layout: fixed;
}
table.headers-table tr td
{
font-size: 11px;
border-bottom:1px solid #FFFFFF;
}
table.headers-table td.header-title
{
width: 80px;
color: #666666;
font-weight: bold;
text-align: right;
white-space: nowrap;
padding-right: 4px;
}
table.headers-table tr td.subject
{
width: 95%;
font-weight: bold;
}
-
+
#attachment-list
{
margin: 0px;
- padding: 0px 0px 0px 0px;
+ padding: 0px 0px 0px 68px;
height: 18px;
list-style-image: none;
list-style-type: none;
- background-color: #DFDFDF;
- background-position: 52px 1px;
+ background: url(images/icons/attachment.png) 52px 1px no-repeat #DFDFDF; 
border-bottom: 1px solid #FFFFFF;
}
#attachment-list li
{
/* display: block; */
float: left;
height: 18px;
font-size: 11px;
padding: 2px 10px 0px 10px;
}
#attachment-list li a
{
text-decoration: none;
}
#attachment-list li a:hover
{
text-decoration: underline;
}
#messagebody
{
min-height: 300px;
padding-top: 10px;
padding-bottom: 10px;
background-color: #FFFFFF;
}
div.message-part
{
padding: 8px;
padding-top: 10px;
overflow: hidden;
}
div.message-part a
{
color: #0000CC;
}
div.message-part pre
{
margin: 0px;
padding: 0px;
}
#remote-objects-message
{
display: none;
height: 20px;
min-height: 20px;
margin: 8px 8px 0px 8px;
padding: 10px 10px 6px 46px;
}
#remote-objects-message a
{
color: #666666;
padding-left: 10px;
}
#remote-objects-message a:hover
{
color: #333333;
}
/** message compose styles */
#priority-selector
{
position: absolute;
left: 280px;
top: 10px;
}
#receipt-selector
{
position: absolute;
left: 450px;
top: 10px;
}
#compose-container
{
position: absolute;
top: 90px;
left: 200px;
right: 40px;
bottom: 40px;
padding: 0px;
margin: 0px;
/* css hack for IE */
width: expression(document.documentElement.clientWidth-240);
height: expression((parseInt(document.documentElement.clientHeight)-130)+'px');
}
/*
#compose-headers
{
position: absolute;
top: 70px;
left: 200px;
height: 84px;
border-top: 1px solid #cccccc;
overflow: auto;
}
#compose-headers td
{
padding-top: 1px;
padding-bottom: 1px;
border-right: 1px solid #cccccc;
border-bottom: 1px solid #cccccc;
}
*/
#compose-headers
{
width: 100%;
}
/*
#compose-headers td
{
width: 100%;
}
*/
#compose-headers td.top
{
vertical-align: top;
}
#compose-headers td.title,
#compose-subject td.title
{
width: 80px !important;
color: #666666;
font-size: 11px;
font-weight: bold;
padding-right: 10px;
white-space: nowrap;
}
#compose-headers td.add-button
{
width: 40px !important;
text-align: right;
vertical-align: bottom;
}
#compose-headers td.add-button a
{
color: #666666;
font-size: 11px;
text-decoration: none;
}
#compose-headers td textarea
{
width: 100%;
height: 40px;
}
#compose-headers td input
{
width: 100%;
}
#compose-cc,
#compose-bcc,
#compose-replyto
{
display: none;
}
#compose-body
{
margin-top: 5px;
margin-bottom: 5px;
width: 99% !important;
width: 95%;
height: 90%;
min-height: 300px;
font-size: 9pt;
font-family: "Courier New", Courier, monospace;
}
#compose-attachments
{
position: absolute;
top: 100px;
left: 20px;
width: 160px;
}
#compose-attachments ul
{
margin: 0px;
padding: 0px;
border: 1px solid #CCCCCC;
background-color: #F9F9F9;
list-style-image: none;
list-style-type: none;
}
#compose-attachments ul li
{
height: 18px;
font-size: 11px;
padding-left: 2px;
padding-top: 2px;
padding-right: 4px;
border-bottom: 1px solid #EBEBEB;
white-space: nowrap;
overflow: hidden;
}
+#attachment-title
+{
+ background: url(images/icons/attachment.png) top left no-repeat;
+ padding: 0px 0px 3px 22px;
+}
+
#attachment-form
{
position: absolute;
top: 150px;
left: 20px;
z-index: 200;
padding: 8px;
visibility: hidden;
border: 1px solid #CCCCCC;
background-color: #F9F9F9;
}
#attachment-form input.button
{
margin-top: 8px;
}
#rcmquotadisplay
{
color: #999999;
font-size: 11px;
}
diff --git a/skins/default/templates/compose.html b/skins/default/templates/compose.html
index bcb232fbc..0ecfb8f1b 100644
--- a/skins/default/templates/compose.html
+++ b/skins/default/templates/compose.html
@@ -1,142 +1,142 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><roundcube:object name="productname" /> :: <roundcube:label name="compose" /></title>
<roundcube:include file="/includes/links.html" />
<link rel="stylesheet" type="text/css" href="/mail.css" />
<link rel="stylesheet" type="text/css" href="/googiespell.css" />
<script type="text/javascript">
<!--
function rcmail_toggle_display(id)
{
var row, disp;
if (row = document.getElementById(id))
{
disp = (!row.style.display || row.style.display=='none') ? ((document.all && !window.opera) ? 'block' : 'table-row') : 'none';
row.style.display = disp;
}
return false;
}
function rcmail_auto_save()
{
rcmail.command('savedraft','',this);
self.setTimeout('rcmail_auto_save()',300000);
}
self.setTimeout('rcmail_auto_save()',300000);
//-->
</script>
</head>
<body>
<roundcube:include file="/includes/taskbar.html" />
<roundcube:include file="/includes/header.html" />
<form name="form" action="./" method="post">
<div id="messagetoolbar">
<roundcube:button command="list" image="/images/buttons/back_act.png" imageSel="/images/buttons/back_sel.png" imageAct="/images/buttons/back_act.png" width="32" height="32" title="backtolist" />
<roundcube:button command="send" imageSel="/images/buttons/send_sel.png" imageAct="/images/buttons/send_act.png" imagePas="/images/buttons/send_pas.png" width="32" height="32" title="sendmessage" />
<!--<roundcube:button command="contacts" imageSel="/images/buttons/contacts_sel.png" imageAct="/images/buttons/contacts_act.png" imagePas="/images/buttons/contacts_pas.png" width="32" height="32" title="addressbook" />-->
<roundcube:button command="spellcheck" imageSel="/images/buttons/spellcheck_sel.png" imageAct="/images/buttons/spellcheck_act.png" imagePas="/images/buttons/spellcheck_pas.png" width="32" height="32" title="checkspelling" />
<roundcube:button command="add-attachment" imageSel="/images/buttons/attach_sel.png" imageAct="/images/buttons/attach_act.png" imagePas="/images/buttons/attach_pas.png" width="32" height="32" title="addattachment" />
<roundcube:button command="savedraft" imageSel="/images/buttons/drafts_sel.png" imageAct="/images/buttons/drafts_act.png" imagePas="/images/buttons/drafts_pas.png" width="32" height="32" title="savemessage" />
<div id="priority-selector">
<roundcube:label name="priority" />:&nbsp;<roundcube:object name="prioritySelector" form="form" />
</div>
<div id="receipt-selector">
<roundcube:object name="receiptCheckBox" form="form" />&nbsp;<roundcube:label name="returnreceipt" />
</div>
</div>
<div id="compose-container">
<table border="0" cellspacing="0" cellpadding="1" style="width:100%; height:100%;" summary=""><tr>
<td>
<table border="0" cellspacing="0" cellpadding="1" id="compose-headers" summary=""><tr>
<td class="title"><roundcube:label name="from" /></td>
<td><roundcube:object name="composeHeaders" part="from" form="form" tabindex="1" /></td>
</tr><tr>
<td class="title top"><roundcube:label name="to" /></td>
<td><roundcube:object name="composeHeaders" part="to" form="form" cols="80" rows="2" tabindex="2" /></td>
<td class="add-button"><a href="#" onclick="return rcmail_toggle_display('compose-cc')">[Cc]</a><br />
<a href="#" onclick="return rcmail_toggle_display('compose-bcc')">[Bcc]</a><br /></td>
</tr><tr id="compose-cc">
<td class="title top"><roundcube:label name="cc" /></td>
<td><roundcube:object name="composeHeaders" part="cc" form="form" cols="80" rows="2" tabindex="3" /></td>
</tr><tr id="compose-bcc">
<td class="title top"><roundcube:label name="bcc" /></td>
<td><roundcube:object name="composeHeaders" part="bcc" form="form" cols="80" rows="2" tabindex="4" /></td>
</tr><tr id="compose-replyto">
<td class="title top"><roundcube:label name="replyto" /></td>
<td><roundcube:object name="composeHeaders" part="replyto" form="form" size="80" tabindex="5" /></td>
<!-- </tr><tr>
<td><roundcube:object name="composeAttachment" size="20" /></td> -->
</tr><tr>
<td class="title"><roundcube:label name="subject" /></td>
<td><roundcube:object name="composeSubject" id="compose-subject" form="form" tabindex="6" /></td>
</tr></table>
</td>
</tr><tr>
<td style="width:100%; height:95%; vertical-align:top;">
<roundcube:object name="composeBody" id="compose-body" form="form" cols="80" rows="20" wrap="virtual" tabindex="7" /><br />
<roundcube:label name="charset" />:&nbsp;<roundcube:object name="charsetSelector" tabindex="8" />
</td>
</tr></table>
</div>
<div id="compose-attachments">
-<div><roundcube:label name="attachments" /></div>
+<div id="attachment-title"><roundcube:label name="attachments" /></div>
<roundcube:object name="composeAttachmentList" deleteIcon="/images/icons/remove-attachment.png"/ >
<p><roundcube:button command="add-attachment" imagePas="/images/buttons/add_pas.png" imageSel="/images/buttons/add_sel.png" imageAct="/images/buttons/add_act.png" width="23" height="18" title="addattachment" />
</div>
</form>
<roundcube:object name="composeAttachmentForm" id="attachment-form" />
<script type="text/javascript">
<!--
var cc_field = document.form._cc;
if (cc_field && cc_field.value!='')
rcmail_toggle_display('compose-cc');
//-->
</script>
<!--
<div id="attachment-form">
<roundcube:object name="composeAttachment" size="20" /><br />
<input type="button" value="<roundcube:label name='close' />" onclick="rcmail_show_attachment_form(0)" />
<input type="button" value="<roundcube:label name='send' />" onclick="rcmail.command('send-attachment', this)" />
</div>
-->
</body>
</html>

File Metadata

Mime Type
text/x-diff
Expires
Mon, Aug 17, 5:08 PM (1 d, 7 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1261526
Default Alt Text
(62 KB)

Event Timeline