| | |
| | | +-----------------------------------------------------------------------+ |
| | | | Author: Thomas Bruederli <roundcube@gmail.com> | |
| | | +-----------------------------------------------------------------------+ |
| | | |
| | | $Id$ |
| | | |
| | | */ |
| | | |
| | | // define constants for message compose mode |
| | |
| | | } |
| | | |
| | | // redirect to a unique URL with all parameters stored in session |
| | | $OUTPUT->redirect(array('_action' => 'compose', '_id' => $COMPOSE['id'])); |
| | | $OUTPUT->redirect(array( |
| | | '_action' => 'compose', |
| | | '_id' => $COMPOSE['id'], |
| | | '_search' => $_REQUEST['_search'], |
| | | )); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | // If desired, set this textarea to be editable by TinyMCE |
| | | if ($isHtml) { |
| | | $MESSAGE_BODY = htmlentities($MESSAGE_BODY, ENT_NOQUOTES, RCMAIL_CHARSET); |
| | | $attrib['class'] = 'mce_editor'; |
| | | $attrib['is_escaped'] = true; |
| | | $textarea = new html_textarea($attrib); |
| | | $out .= $textarea->show($MESSAGE_BODY); |
| | | } |
| | |
| | | $data = $message->get_part_content($pid); |
| | | } |
| | | |
| | | $mimetype = $part->ctype_primary . '/' . $part->ctype_secondary; |
| | | $filename = $part->filename; |
| | | if (!strlen($filename)) { |
| | | if ($mimetype == 'text/html') { |
| | | $filename = rcube_label('htmlmessage'); |
| | | } |
| | | else { |
| | | $filename = 'Part_'.$pid; |
| | | } |
| | | $filename .= '.' . $part->ctype_secondary; |
| | | } |
| | | |
| | | $attachment = array( |
| | | 'group' => $COMPOSE['id'], |
| | | 'name' => $part->filename ? $part->filename : 'Part_'.$pid.'.'.$part->ctype_secondary, |
| | | 'mimetype' => $part->ctype_primary . '/' . $part->ctype_secondary, |
| | | 'name' => $filename, |
| | | 'mimetype' => $mimetype, |
| | | 'content_id' => $part->content_id, |
| | | 'data' => $data, |
| | | 'path' => $path, |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Register a certain container as active area to drop files onto |
| | | */ |
| | | function compose_file_drop_area($attrib) |
| | | { |
| | | global $OUTPUT; |
| | | |
| | | if ($attrib['id']) { |
| | | $OUTPUT->add_gui_object('filedrop', $attrib['id']); |
| | | $OUTPUT->set_env('filedrop', array('action' => 'upload', 'fieldname' => '_attachments')); |
| | | } |
| | | } |
| | | |
| | | |
| | | // register UI objects |
| | | $OUTPUT->add_handlers(array( |
| | |
| | | 'composeattachmentlist' => 'rcmail_compose_attachment_list', |
| | | 'composeattachmentform' => 'rcmail_compose_attachment_form', |
| | | 'composeattachment' => 'rcmail_compose_attachment_field', |
| | | 'filedroparea' => 'compose_file_drop_area', |
| | | 'priorityselector' => 'rcmail_priority_selector', |
| | | 'editorselector' => 'rcmail_editor_selector', |
| | | 'receiptcheckbox' => 'rcmail_receipt_checkbox', |