| | |
| | | $OUTPUT->add_label('nosubject', 'nosenderwarning', 'norecipientwarning', 'nosubjectwarning', 'cancel', |
| | | 'nobodywarning', 'notsentwarning', 'notuploadedwarning', 'savingmessage', 'sendingmessage', |
| | | 'messagesaved', 'converting', 'editorwarning', 'searching', 'uploading', 'uploadingmany', |
| | | 'fileuploaderror'); |
| | | 'fileuploaderror', 'sendmessage'); |
| | | |
| | | $OUTPUT->set_env('compose_id', $COMPOSE['id']); |
| | | |
| | |
| | | $OUTPUT->set_env('sig_above', $RCMAIL->config->get('sig_above', false)); |
| | | $OUTPUT->set_env('top_posting', $RCMAIL->config->get('top_posting', false)); |
| | | $OUTPUT->set_env('recipients_separator', trim($RCMAIL->config->get('recipients_separator', ','))); |
| | | |
| | | // use jquery UI for showing prompt() dialogs |
| | | $RCMAIL->plugins->load_plugin('jqueryui'); |
| | | |
| | | // get reference message and set compose mode |
| | | if ($msg_uid = $COMPOSE['param']['draft_uid']) { |
| | |
| | | if (count($MESSAGE->identities)) |
| | | { |
| | | foreach ($MESSAGE->identities as $idx => $ident) { |
| | | $email = mb_strtolower(rcube_idn_to_utf8($ident['email'])); |
| | | $ident['email'] = format_email($ident['email']); |
| | | $email = format_email(rcube_idn_to_utf8($ident['email'])); |
| | | |
| | | $MESSAGE->identities[$idx]['email_ascii'] = $ident['email']; |
| | | $MESSAGE->identities[$idx]['ident'] = format_email_recipient($ident['email'], $ident['name']); |
| | |
| | | $a_to = $IMAP->decode_address_list($MESSAGE->headers->to); |
| | | foreach ($a_to as $addr) { |
| | | if (!empty($addr['mailto'])) { |
| | | $a_recipients[] = strtolower($addr['mailto']); |
| | | $a_recipients[] = format_email($addr['mailto']); |
| | | $a_names[] = $addr['name']; |
| | | } |
| | | } |
| | |
| | | $a_cc = $IMAP->decode_address_list($MESSAGE->headers->cc); |
| | | foreach ($a_cc as $addr) { |
| | | if (!empty($addr['mailto'])) { |
| | | $a_recipients[] = strtolower($addr['mailto']); |
| | | $a_recipients[] = format_email($addr['mailto']); |
| | | $a_names[] = $addr['name']; |
| | | } |
| | | } |
| | |
| | | |
| | | // we have a set of recipients stored is session |
| | | if ($header == 'to' && ($mailto_id = $COMPOSE['param']['mailto']) |
| | | && $COMPOSE[$mailto_id] |
| | | && $_SESSION['mailto'][$mailto_id] |
| | | ) { |
| | | $fvalue = urldecode($COMPOSE[$mailto_id]); |
| | | $fvalue = urldecode($_SESSION['mailto'][$mailto_id]); |
| | | $decode_header = false; |
| | | |
| | | // make session to not grow up too much |
| | | unset($_SESSION['mailto'][$mailto_id]); |
| | | $COMPOSE['param']['to'] = $fvalue; |
| | | } |
| | | else if (!empty($_POST['_'.$header])) { |
| | | $fvalue = get_input_value('_'.$header, RCUBE_INPUT_POST, TRUE); |
| | |
| | | if (empty($addr_part['mailto'])) |
| | | continue; |
| | | |
| | | $mailto = mb_strtolower(rcube_idn_to_utf8($addr_part['mailto'])); |
| | | $mailto = format_email(rcube_idn_to_utf8($addr_part['mailto'])); |
| | | |
| | | if (!in_array($mailto, $a_recipients) |
| | | && ($header == 'to' || empty($MESSAGE->compose['from_email']) || $mailto != $MESSAGE->compose['from_email']) |
| | |
| | | if ($isHtml) { |
| | | $attrib['class'] = 'mce_editor'; |
| | | $textarea = new html_textarea($attrib); |
| | | $out .= $textarea->show($MESSAGE_BODY); |
| | | $out .= $textarea->show(htmlentities($MESSAGE_BODY, ENT_NOQUOTES, RCMAIL_CHARSET)); |
| | | } |
| | | else { |
| | | $textarea = new html_textarea($attrib); |
| | |
| | | "<tr><th align=\"right\" nowrap=\"nowrap\" valign=\"baseline\">%s: </th><td>%s</td></tr>", |
| | | rcube_label('subject'), Q($MESSAGE->subject), |
| | | rcube_label('date'), Q($date), |
| | | rcube_label('from'), htmlspecialchars(Q($MESSAGE->get_header('from'), 'replace'), ENT_COMPAT, $charset), |
| | | rcube_label('to'), htmlspecialchars(Q($MESSAGE->get_header('to'), 'replace'), ENT_COMPAT, $charset)); |
| | | rcube_label('from'), Q($MESSAGE->get_header('from'), 'replace'), |
| | | rcube_label('to'), Q($MESSAGE->get_header('to'), 'replace')); |
| | | |
| | | if ($MESSAGE->headers->cc) |
| | | $prefix .= sprintf("<tr><th align=\"right\" nowrap=\"nowrap\" valign=\"baseline\">%s: </th><td>%s</td></tr>", |
| | | rcube_label('cc'), |
| | | htmlspecialchars(Q($MESSAGE->get_header('cc'), 'replace'), ENT_COMPAT, $charset)); |
| | | Q($MESSAGE->get_header('cc'), 'replace')); |
| | | |
| | | if ($MESSAGE->headers->replyto && $MESSAGE->headers->replyto != $MESSAGE->headers->from) |
| | | $prefix .= sprintf("<tr><th align=\"right\" nowrap=\"nowrap\" valign=\"baseline\">%s: </th><td>%s</td></tr>", |
| | | rcube_label('replyto'), |
| | | htmlspecialchars(Q($MESSAGE->get_header('replyto'), 'replace'), ENT_COMPAT, $charset)); |
| | | Q($MESSAGE->get_header('replyto'), 'replace')); |
| | | |
| | | $prefix .= "</tbody></table><br>"; |
| | | } |
| | |
| | | 'title' => rcube_label('delete'), |
| | | 'onclick' => sprintf("return %s.command('remove-attachment','rcmfile%s', this)", JS_OBJECT_NAME, $id)), |
| | | $button) . Q($a_prop['name'])); |
| | | |
| | | |
| | | $jslist['rcmfile'.$id] = array('name' => $a_prop['name'], 'complete' => true, 'mimetype' => $a_prop['mimetype']); |
| | | } |
| | | } |
| | |
| | | |
| | | $OUTPUT->set_env('attachments', $jslist); |
| | | $OUTPUT->add_gui_object('attachmentlist', $attrib['id']); |
| | | |
| | | |
| | | return html::tag('ul', $attrib, $out, html::$common_attrib); |
| | | } |
| | | |
| | | |
| | | function rcmail_compose_attachment_form($attrib) |
| | | { |
| | | global $RCMAIL, $OUTPUT; |
| | | global $OUTPUT; |
| | | |
| | | // add ID if not given |
| | | if (!$attrib['id']) |
| | |
| | | function rcmail_priority_selector($attrib) |
| | | { |
| | | global $MESSAGE; |
| | | |
| | | |
| | | list($form_start, $form_end) = get_form_tags($attrib); |
| | | unset($attrib['form']); |
| | | |
| | |
| | | unset($attrib['form']); |
| | | |
| | | if (!isset($attrib['id'])) |
| | | $attrib['id'] = 'receipt'; |
| | | $attrib['id'] = 'receipt'; |
| | | |
| | | $attrib['name'] = '_receipt'; |
| | | $attrib['value'] = '1'; |
| | |
| | | |
| | | function rcmail_editor_selector($attrib) |
| | | { |
| | | global $CONFIG, $MESSAGE, $compose_mode; |
| | | |
| | | // determine whether HTML or plain text should be checked |
| | | $useHtml = rcmail_compose_editor_mode(); |
| | | |