| | |
| | | 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); |
| | | return $form_start . rcmail_compose_header_from($attrib); |
| | | |
| | | case 'to': |
| | | $fname = '_to'; |
| | | $header = $param = 'to'; |
| | | |
| | | |
| | | // we have a set of recipients stored is session |
| | | if (($mailto_id = $_SESSION['compose']['param']['mailto']) && $_SESSION['mailto'][$mailto_id]) |
| | | $fvalue = urldecode($_SESSION['mailto'][$mailto_id]); |
| | | |
| | | |
| | | case 'cc': |
| | | if (!$fname) |
| | | { |
| | |
| | | $fname = '_bcc'; |
| | | $header = $param = 'bcc'; |
| | | } |
| | | |
| | | |
| | | $allow_attrib = array('id', 'class', 'style', 'cols', 'rows', 'tabindex'); |
| | | $field_type = 'html_textarea'; |
| | | break; |
| | |
| | | $input_from = new html_inputfield($field_attrib); |
| | | $out = $input_from->show($_POST['_from']); |
| | | } |
| | | |
| | | if ($form_start) |
| | | $out = $form_start.$out; |
| | | |
| | | return $out; |
| | | } |
| | |
| | | foreach ((array)$message->mime_parts as $pid => $part) |
| | | { |
| | | if (($part->ctype_primary != 'message' || !$bodyIsHtml) && $part->ctype_primary != 'multipart' && |
| | | ($part->disposition == 'attachment' || ($part->disposition == 'inline' && $bodyIsHtml) || $part->filename)) |
| | | { |
| | | ($part->disposition == 'attachment' || ($part->disposition == 'inline' && $bodyIsHtml) || $part->filename) |
| | | && $part->mimetype != 'application/ms-tnef' |
| | | ) { |
| | | $skip = false; |
| | | if ($part->mimetype == 'message/rfc822') { |
| | | $messages[] = $part->mime_id; |
| | |
| | | |
| | | if (!$skip && ($attachment = rcmail_save_attachment($message, $pid))) { |
| | | $_SESSION['compose']['attachments'][$attachment['id']] = $attachment; |
| | | if ($bodyIsHtml && $part->content_id) { |
| | | $cid_map['cid:'.$part->content_id] = $OUTPUT->app->comm_path.'&_action=display-attachment&_file=rcmfile'.$attachment['id']; |
| | | if ($bodyIsHtml && ($part->content_id || $part->content_location)) { |
| | | $url = $OUTPUT->app->comm_path.'&_action=display-attachment&_file=rcmfile'.$attachment['id']; |
| | | if ($part->content_id) |
| | | $cid_map['cid:'.$part->content_id] = $url; |
| | | else |
| | | $cid_map[$part->content_location] = $url; |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | $cid_map = array(); |
| | | foreach ((array)$message->mime_parts as $pid => $part) { |
| | | if ($part->content_id && $part->filename) { |
| | | if (($part->content_id || $part->content_location) && $part->filename) { |
| | | if ($attachment = rcmail_save_attachment($message, $pid)) { |
| | | $_SESSION['compose']['attachments'][$attachment['id']] = $attachment; |
| | | $cid_map['cid:'.$part->content_id] = $OUTPUT->app->comm_path.'&_action=display-attachment&_file=rcmfile'.$attachment['id']; |
| | | $url = $OUTPUT->app->comm_path.'&_action=display-attachment&_file=rcmfile'.$attachment['id']; |
| | | if ($part->content_id) |
| | | $cid_map['cid:'.$part->content_id] = $url; |
| | | else |
| | | $cid_map[$part->content_location] = $url; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | return $cid_map; |
| | | } |
| | | |
| | |
| | | |
| | | list($form_start, $form_end) = get_form_tags($attrib); |
| | | unset($attrib['form']); |
| | | |
| | | |
| | | $attrib['name'] = '_priority'; |
| | | $selector = new html_select($attrib); |
| | | |
| | |
| | | rcube_label('high'), |
| | | rcube_label('highest')), |
| | | array(5, 4, 0, 2, 1)); |
| | | |
| | | |
| | | if (isset($_POST['_priority'])) |
| | | $sel = $_POST['_priority']; |
| | | else if (intval($MESSAGE->headers->priority) != 3) |
| | |
| | | $out = $form_start ? "$form_start\n" : ''; |
| | | $out .= $selector->show($sel); |
| | | $out .= $form_end ? "\n$form_end" : ''; |
| | | |
| | | |
| | | return $out; |
| | | } |
| | | |
| | |
| | | function rcmail_receipt_checkbox($attrib) |
| | | { |
| | | global $MESSAGE, $compose_mode; |
| | | |
| | | |
| | | list($form_start, $form_end) = get_form_tags($attrib); |
| | | unset($attrib['form']); |
| | | |
| | | |
| | | if (!isset($attrib['id'])) |
| | | $attrib['id'] = 'receipt'; |
| | | |
| | |
| | | |
| | | if (empty($attrib['name'])) |
| | | $attrib['name'] = 'editorSelect'; |
| | | |
| | | |
| | | $attrib['onchange'] = "return rcmail_toggle_editor(this, '".$attrib['editorid']."', '_is_html')"; |
| | | |
| | | $select = new html_select($attrib); |
| | |
| | | global $RCMAIL, $MESSAGE_FORM; |
| | | |
| | | $form_start = ''; |
| | | if (!strlen($MESSAGE_FORM)) |
| | | if (!$MESSAGE_FORM) |
| | | { |
| | | $hiddenfields = new html_hiddenfield(array('name' => '_task', 'value' => $RCMAIL->task)); |
| | | $hiddenfields->add(array('name' => '_action', 'value' => 'send')); |
| | |
| | | $form_start .= $hiddenfields->show(); |
| | | } |
| | | |
| | | $form_end = (strlen($MESSAGE_FORM) && !strlen($attrib['form'])) ? '</form>' : ''; |
| | | $form_end = ($MESSAGE_FORM && !strlen($attrib['form'])) ? '</form>' : ''; |
| | | $form_name = !empty($attrib['form']) ? $attrib['form'] : 'form'; |
| | | |
| | | if (!strlen($MESSAGE_FORM)) |
| | | if (!$MESSAGE_FORM) |
| | | $RCMAIL->output->add_gui_object('messageform', $form_name); |
| | | |
| | | $MESSAGE_FORM = $form_name; |
| | |
| | | |
| | | $OUTPUT->send('compose'); |
| | | |
| | | ?> |
| | | |