| | |
| | | define('RCUBE_COMPOSE_EDIT', 0x0109); |
| | | |
| | | $MESSAGE_FORM = null; |
| | | $MESSAGE = null; |
| | | $COMPOSE_ID = get_input_value('_id', RCUBE_INPUT_GET); |
| | | $COMPOSE = null; |
| | | |
| | |
| | | } |
| | | |
| | | // 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'], |
| | | )); |
| | | } |
| | | |
| | | |
| | |
| | | $MESSAGE = new rcube_message($msg_uid); |
| | | |
| | | // make sure message is marked as read |
| | | if ($MESSAGE && $MESSAGE->headers && empty($MESSAGE->headers->flags['SEEN'])) |
| | | if ($MESSAGE->headers && empty($MESSAGE->headers->flags['SEEN'])) |
| | | $RCMAIL->storage->set_flag($msg_uid, 'SEEN'); |
| | | |
| | | if (!empty($MESSAGE->headers->charset)) |
| | |
| | | if (!empty($COMPOSE['param']['attachment'])) |
| | | $MESSAGE->forward_attachment = true; |
| | | } |
| | | } |
| | | else { |
| | | $MESSAGE = new stdClass(); |
| | | } |
| | | |
| | | $MESSAGE->compose = array(); |
| | |
| | | // include HTML editor |
| | | rcube_html_editor(); |
| | | |
| | | // include GoogieSpell |
| | | // Set language list |
| | | if (!empty($CONFIG['enable_spellcheck'])) { |
| | | $engine = $RCMAIL->config->get('spellcheck_engine','googie'); |
| | | $dictionary = (bool) $RCMAIL->config->get('spellcheck_dictionary'); |
| | | $spellcheck_langs = (array) $RCMAIL->config->get('spellcheck_languages', |
| | | array('da'=>'Dansk', 'de'=>'Deutsch', 'en' => 'English', 'es'=>'Español', |
| | | 'fr'=>'Français', 'it'=>'Italiano', 'nl'=>'Nederlands', 'pl'=>'Polski', |
| | | 'pt'=>'Português', 'fi'=>'Suomi', 'sv'=>'Svenska')); |
| | | 'pt'=>'Português', 'ru'=>'Русский', 'fi'=>'Suomi', 'sv'=>'Svenska')); |
| | | |
| | | // googie works only with two-letter codes |
| | | if ($engine == 'googie') { |
| | |
| | | if (!$spellcheck_langs[$lang]) |
| | | $lang = 'en'; |
| | | |
| | | $OUTPUT->set_env('spell_langs', $spellcheck_langs); |
| | | $OUTPUT->set_env('spell_lang', $lang); |
| | | |
| | | $editor_lang_set = array(); |
| | | foreach ($spellcheck_langs as $key => $name) { |
| | | $editor_lang_set[] = ($key == $lang ? '+' : '') . JQ($name).'='.JQ($key); |
| | | } |
| | | |
| | | // include GoogieSpell |
| | | $OUTPUT->include_script('googiespell.js'); |
| | | $OUTPUT->add_script(sprintf( |
| | | "var googie = new GoogieSpell('%s/images/googiespell/','%s&lang=', %s);\n". |
| | |
| | | "googie.lang_learn_word = \"%s\";\n". |
| | | "googie.setLanguages(%s);\n". |
| | | "googie.setCurrentLanguage('%s');\n". |
| | | "googie.setSpellContainer('spellcheck-control');\n". |
| | | "googie.setDecoration(false);\n". |
| | | "googie.decorateTextarea('%s');\n". |
| | | "%s.set_env('spellcheck', googie);", |
| | | $RCMAIL->output->get_skin_path(), |
| | |
| | | $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, |
| | |
| | | $attrib['value'] = '1'; |
| | | $checkbox = new html_checkbox($attrib); |
| | | |
| | | if ($MESSAGE && in_array($compose_mode, array(RCUBE_COMPOSE_DRAFT, RCUBE_COMPOSE_EDIT))) |
| | | if (in_array($compose_mode, array(RCUBE_COMPOSE_DRAFT, RCUBE_COMPOSE_EDIT))) |
| | | $mdn_default = (bool) $MESSAGE->headers->mdn_to; |
| | | else |
| | | $mdn_default = $RCMAIL->config->get('mdn_default'); |
| | |
| | | } |
| | | |
| | | |
| | | function rcmail_adressbook_list($attrib = array()) |
| | | function rcmail_addressbook_list($attrib = array()) |
| | | { |
| | | global $RCMAIL, $OUTPUT; |
| | | |
| | |
| | | $js_id, (!empty($source['name']) ? Q($source['name']) : Q($id))); |
| | | } |
| | | |
| | | $OUTPUT->add_gui_object('adressbookslist', $attrib['id']); |
| | | $OUTPUT->add_gui_object('addressbookslist', $attrib['id']); |
| | | |
| | | return html::tag('ul', $attrib, $out, html::$common_attrib); |
| | | } |
| | |
| | | 'receiptcheckbox' => 'rcmail_receipt_checkbox', |
| | | 'dsncheckbox' => 'rcmail_dsn_checkbox', |
| | | 'storetarget' => 'rcmail_store_target_selection', |
| | | 'adressbooks' => 'rcmail_adressbook_list', |
| | | 'addressbooks' => 'rcmail_addressbook_list', |
| | | 'addresslist' => 'rcmail_contacts_list', |
| | | )); |
| | | |