| | |
| | | $body = rcmail_create_draft_body($body, $isHtml); |
| | | } |
| | | |
| | | $tinylang = substr($_SESSION['user_lang'], 0, 2); |
| | | if (!file_exists('program/js/tiny_mce/langs/'.$tinylang.'.js')) |
| | | { |
| | | $tinylang = 'en'; |
| | | } |
| | | |
| | | $OUTPUT->include_script('tiny_mce/tiny_mce.js'); |
| | | $OUTPUT->include_script("editor.js"); |
| | | $OUTPUT->add_script('rcmail_editor_init("$__skin_path");'); |
| | | $OUTPUT->add_script('rcmail_editor_init("$__skin_path", "'.$tinylang.'");'); |
| | | |
| | | $out = $form_start ? "$form_start\n" : ''; |
| | | |
| | |
| | | $out .= $msgtype->show(); |
| | | |
| | | // If desired, set this text area to be editable by TinyMCE |
| | | if ($isHtml) |
| | | $attrib['mce_editable'] = "true"; |
| | | if ($isHtml) $attrib['class'] = "mce_editor"; |
| | | $textarea = new html_textarea($attrib); |
| | | $out .= $textarea->show($body); |
| | | $out .= $form_end ? "\n$form_end" : ''; |
| | |
| | | $IMAP->decode_header($MESSAGE['headers']->from)); |
| | | |
| | | // try to remove the signature |
| | | if ($sp = strrstr($body, '-- ')) |
| | | if ($sp = strrpos($body, '-- ')) |
| | | { |
| | | if ($body{$sp+3}==' ' || $body{$sp+3}=="\n" || $body{$sp+3}=="\r") |
| | | $body = substr($body, 0, $sp-1); |
| | |
| | | |
| | | // determine whether HTML or plain text should be checked |
| | | if ($CONFIG['htmleditor']) |
| | | { |
| | | $useHtml = true; |
| | | } |
| | | else |
| | | { |
| | | $useHtml = false; |
| | | } |
| | | |
| | | if ($compose_mode == RCUBE_COMPOSE_REPLY || |
| | | $compose_mode == RCUBE_COMPOSE_FORWARD || |
| | |
| | | $useHtml = ($hasHtml && $CONFIG['htmleditor']); |
| | | } |
| | | |
| | | $chosenvalue = $useHtml ? 'html' : 'plain'; |
| | | |
| | | $selector = ''; |
| | | |
| | | $attrib['name'] = '_editorSelect'; |
| | | $attrib['onchange'] = 'return rcmail_toggle_editor(this)'; |
| | | foreach ($choices as $value => $text) |
| | | { |
| | | $checked = ''; |
| | | if ((($value == 'html') && $useHtml) || |
| | | (($value != 'html') && !$useHtml)) |
| | | $attrib['checked'] = 'true'; |
| | | else |
| | | unset($attrib['checked']); |
| | | |
| | | $attrib['id'] = '_' . $value; |
| | | $attrib['value'] = $value; |
| | | $rb = new html_radiobutton($attrib); |
| | | $selector .= sprintf("%s<label for=\"%s\">%s</label>", |
| | | $rb->show($value), |
| | | $rb->show($chosenvalue), |
| | | $attrib['id'], |
| | | rcube_label($text)); |
| | | } |
| | |
| | | $OUTPUT->set_env('contacts', $a_contacts); |
| | | } |
| | | $OUTPUT->send('compose'); |
| | | ?> |
| | | ?> |