| | |
| | | { |
| | | rcmail_compose_cleanup(); |
| | | $_SESSION['compose'] = array( |
| | | 'id' => uniqid(rand()), |
| | | 'id' => uniqid(mt_rand()), |
| | | 'param' => request2param(RCUBE_INPUT_GET), |
| | | 'mailbox' => $IMAP->get_mailbox_name(), |
| | | ); |
| | |
| | | |
| | | $attrib['name'] = '_message'; |
| | | |
| | | if ($CONFIG['htmleditor'] || (($compose_mode == RCUBE_COMPOSE_DRAFT || $compose_mode == RCUBE_COMPOSE_EDIT) && $MESSAGE->first_html_part())) |
| | | if ($CONFIG['htmleditor'] || (($compose_mode == RCUBE_COMPOSE_DRAFT || $compose_mode == RCUBE_COMPOSE_EDIT) && $MESSAGE->has_html_part())) |
| | | $isHtml = true; |
| | | else |
| | | $isHtml = false; |
| | |
| | | $body = $MESSAGE->first_text_part(); |
| | | $isHtml = false; |
| | | } |
| | | |
| | | |
| | | // compose reply-body |
| | | if ($compose_mode == RCUBE_COMPOSE_REPLY) |
| | | $body = rcmail_create_reply_body($body, $isHtml); |
| | |
| | | // add ID if not given |
| | | if (!$attrib['id']) |
| | | $attrib['id'] = 'rcmUploadbox'; |
| | | |
| | | // find max filesize value |
| | | $max_filesize = parse_bytes(ini_get('upload_max_filesize')); |
| | | $max_postsize = parse_bytes(ini_get('post_max_size')); |
| | | if ($max_postsize && $max_postsize < $max_filesize) |
| | | $max_filesize = $max_postsize; |
| | | $max_filesize = show_bytes($max_filesize); |
| | | |
| | | $button = new html_inputfield(array('type' => 'button', 'class' => 'button')); |
| | | $button = new html_inputfield(array('type' => 'button')); |
| | | |
| | | $out = html::div($attrib, |
| | | $OUTPUT->form_tag(array('name' => 'form', 'method' => 'post', 'enctype' => 'multipart/form-data'), |
| | | html::div(null, rcmail_compose_attachment_field(array())) . |
| | | html::div('hint', rcube_label(array('name' => 'maxuploadsize', 'vars' => array('size' => show_bytes(parse_bytes(ini_get('upload_max_filesize'))))))) . |
| | | html::div(null, rcmail_compose_attachment_field(array('size' => $attrib[attachmentfieldsize]))) . |
| | | html::div('hint', rcube_label(array('name' => 'maxuploadsize', 'vars' => array('size' => $max_filesize)))) . |
| | | html::div('buttons', |
| | | $button->show(rcube_label('close'), array('onclick' => "document.getElementById('$attrib[id]').style.visibility='hidden'")) . ' ' . |
| | | $button->show(rcube_label('upload'), array('onclick' => JS_OBJECT_NAME . ".command('send-attachment', this.form)")) |
| | | $button->show(rcube_label('close'), array('class' => 'button', 'onclick' => "document.getElementById('$attrib[id]').style.visibility='hidden'")) . ' ' . |
| | | $button->show(rcube_label('upload'), array('class' => 'button mainaction', 'onclick' => JS_OBJECT_NAME . ".command('send-attachment', this.form)")) |
| | | ) |
| | | ) |
| | | ); |
| | |
| | | global $CONFIG, $MESSAGE, $compose_mode; |
| | | |
| | | // determine whether HTML or plain text should be checked |
| | | $useHtml = $CONFIG['htmleditor'] ? true : false; |
| | | |
| | | if ($compose_mode) |
| | | $useHtml = ($useHtml && $MESSAGE->has_html_part()); |
| | | $useHtml = (($CONFIG['htmleditor'] || $compose_mode == RCUBE_COMPOSE_DRAFT || $compose_mode == RCUBE_COMPOSE_EDIT) |
| | | && $MESSAGE->has_html_part()); |
| | | else |
| | | $useHtml = $CONFIG['htmleditor'] ? true : false; |
| | | |
| | | if (empty($attrib['editorid'])) |
| | | $attrib['editorid'] = 'rcmComposeBody'; |