Changeset 344 in subversion
- Timestamp:
- Sep 13, 2006 11:49:28 PM (7 years ago)
- Location:
- trunk/roundcubemail
- Files:
-
- 204 added
- 24 edited
-
CHANGELOG (modified) (1 diff)
-
SQL/mysql.initial.sql (modified) (1 diff)
-
SQL/mysql.update.sql (modified) (1 diff)
-
SQL/mysql5.initial.sql (modified) (1 diff)
-
SQL/postgres.initial.sql (modified) (1 diff)
-
SQL/postgres.update.sql (modified) (1 diff)
-
SQL/sqlite.initial.sql (modified) (1 diff)
-
index.php (modified) (3 diffs)
-
program/include/bugs.inc (modified) (1 diff)
-
program/include/main.inc (modified) (5 diffs)
-
program/include/rcube_shared.inc (modified) (11 diffs)
-
program/js/app.js (modified) (10 diffs)
-
program/js/editor.js (added)
-
program/js/tiny_mce (added)
-
program/js/tiny_mce/blank.htm (added)
-
program/js/tiny_mce/langs (added)
-
program/js/tiny_mce/langs/en.js (added)
-
program/js/tiny_mce/langs/readme.txt (added)
-
program/js/tiny_mce/license.txt (added)
-
program/js/tiny_mce/plugins (added)
-
program/js/tiny_mce/plugins/cleanup (added)
-
program/js/tiny_mce/plugins/cleanup/editor_plugin.js (added)
-
program/js/tiny_mce/plugins/cleanup/editor_plugin_src.js (added)
-
program/js/tiny_mce/plugins/cleanup/readme.txt (added)
-
program/js/tiny_mce/plugins/emotions (added)
-
program/js/tiny_mce/plugins/emotions/editor_plugin.js (added)
-
program/js/tiny_mce/plugins/emotions/editor_plugin_src.js (added)
-
program/js/tiny_mce/plugins/emotions/emotions.htm (added)
-
program/js/tiny_mce/plugins/emotions/images (added)
-
program/js/tiny_mce/plugins/emotions/images/emotions.gif (added)
-
program/js/tiny_mce/plugins/emotions/images/readme.txt (added)
-
program/js/tiny_mce/plugins/emotions/images/smiley-cool.gif (added)
-
program/js/tiny_mce/plugins/emotions/images/smiley-cry.gif (added)
-
program/js/tiny_mce/plugins/emotions/images/smiley-embarassed.gif (added)
-
program/js/tiny_mce/plugins/emotions/images/smiley-foot-in-mouth.gif (added)
-
program/js/tiny_mce/plugins/emotions/images/smiley-frown.gif (added)
-
program/js/tiny_mce/plugins/emotions/images/smiley-innocent.gif (added)
-
program/js/tiny_mce/plugins/emotions/images/smiley-kiss.gif (added)
-
program/js/tiny_mce/plugins/emotions/images/smiley-laughing.gif (added)
-
program/js/tiny_mce/plugins/emotions/images/smiley-money-mouth.gif (added)
-
program/js/tiny_mce/plugins/emotions/images/smiley-sealed.gif (added)
-
program/js/tiny_mce/plugins/emotions/images/smiley-smile.gif (added)
-
program/js/tiny_mce/plugins/emotions/images/smiley-surprised.gif (added)
-
program/js/tiny_mce/plugins/emotions/images/smiley-tongue-out.gif (added)
-
program/js/tiny_mce/plugins/emotions/images/smiley-undecided.gif (added)
-
program/js/tiny_mce/plugins/emotions/images/smiley-wink.gif (added)
-
program/js/tiny_mce/plugins/emotions/images/smiley-yell.gif (added)
-
program/js/tiny_mce/plugins/emotions/jscripts (added)
-
program/js/tiny_mce/plugins/emotions/jscripts/functions.js (added)
-
program/js/tiny_mce/plugins/emotions/langs (added)
-
program/js/tiny_mce/plugins/emotions/langs/en.js (added)
-
program/js/tiny_mce/plugins/emotions/readme.txt (added)
-
program/js/tiny_mce/plugins/readme.txt (added)
-
program/js/tiny_mce/plugins/searchreplace (added)
-
program/js/tiny_mce/plugins/searchreplace/editor_plugin.js (added)
-
program/js/tiny_mce/plugins/searchreplace/editor_plugin_src.js (added)
-
program/js/tiny_mce/plugins/searchreplace/images (added)
-
program/js/tiny_mce/plugins/searchreplace/images/replace.gif (added)
-
program/js/tiny_mce/plugins/searchreplace/images/search.gif (added)
-
program/js/tiny_mce/plugins/searchreplace/jscripts (added)
-
program/js/tiny_mce/plugins/searchreplace/jscripts/replace.js (added)
-
program/js/tiny_mce/plugins/searchreplace/jscripts/search.js (added)
-
program/js/tiny_mce/plugins/searchreplace/langs (added)
-
program/js/tiny_mce/plugins/searchreplace/langs/en.js (added)
-
program/js/tiny_mce/plugins/searchreplace/readme.txt (added)
-
program/js/tiny_mce/plugins/searchreplace/replace.htm (added)
-
program/js/tiny_mce/plugins/searchreplace/search.htm (added)
-
program/js/tiny_mce/plugins/table (added)
-
program/js/tiny_mce/plugins/table/cell.htm (added)
-
program/js/tiny_mce/plugins/table/css (added)
-
program/js/tiny_mce/plugins/table/css/cell.css (added)
-
program/js/tiny_mce/plugins/table/css/row.css (added)
-
program/js/tiny_mce/plugins/table/css/table.css (added)
-
program/js/tiny_mce/plugins/table/editor_plugin.js (added)
-
program/js/tiny_mce/plugins/table/editor_plugin_src.js (added)
-
program/js/tiny_mce/plugins/table/images (added)
-
program/js/tiny_mce/plugins/table/images/buttons.gif (added)
-
program/js/tiny_mce/plugins/table/images/table.gif (added)
-
program/js/tiny_mce/plugins/table/images/table_cell_props.gif (added)
-
program/js/tiny_mce/plugins/table/images/table_delete.gif (added)
-
program/js/tiny_mce/plugins/table/images/table_delete_col.gif (added)
-
program/js/tiny_mce/plugins/table/images/table_delete_row.gif (added)
-
program/js/tiny_mce/plugins/table/images/table_insert_col_after.gif (added)
-
program/js/tiny_mce/plugins/table/images/table_insert_col_before.gif (added)
-
program/js/tiny_mce/plugins/table/images/table_insert_row_after.gif (added)
-
program/js/tiny_mce/plugins/table/images/table_insert_row_before.gif (added)
-
program/js/tiny_mce/plugins/table/images/table_merge_cells.gif (added)
-
program/js/tiny_mce/plugins/table/images/table_row_props.gif (added)
-
program/js/tiny_mce/plugins/table/images/table_split_cells.gif (added)
-
program/js/tiny_mce/plugins/table/jscripts (added)
-
program/js/tiny_mce/plugins/table/jscripts/cell.js (added)
-
program/js/tiny_mce/plugins/table/jscripts/merge_cells.js (added)
-
program/js/tiny_mce/plugins/table/jscripts/row.js (added)
-
program/js/tiny_mce/plugins/table/jscripts/table.js (added)
-
program/js/tiny_mce/plugins/table/langs (added)
-
program/js/tiny_mce/plugins/table/langs/en.js (added)
-
program/js/tiny_mce/plugins/table/merge_cells.htm (added)
-
program/js/tiny_mce/plugins/table/readme.txt (added)
-
program/js/tiny_mce/plugins/table/row.htm (added)
-
program/js/tiny_mce/plugins/table/table.htm (added)
-
program/js/tiny_mce/themes (added)
-
program/js/tiny_mce/themes/advanced (added)
-
program/js/tiny_mce/themes/advanced/about.htm (added)
-
program/js/tiny_mce/themes/advanced/anchor.htm (added)
-
program/js/tiny_mce/themes/advanced/charmap.htm (added)
-
program/js/tiny_mce/themes/advanced/color_picker.htm (added)
-
program/js/tiny_mce/themes/advanced/docs (added)
-
program/js/tiny_mce/themes/advanced/docs/en (added)
-
program/js/tiny_mce/themes/advanced/docs/en/about.htm (added)
-
program/js/tiny_mce/themes/advanced/docs/en/common_buttons.htm (added)
-
program/js/tiny_mce/themes/advanced/docs/en/create_accessible_content.htm (added)
-
program/js/tiny_mce/themes/advanced/docs/en/images (added)
-
program/js/tiny_mce/themes/advanced/docs/en/images/insert_anchor_window.gif (added)
-
program/js/tiny_mce/themes/advanced/docs/en/images/insert_image_window.gif (added)
-
program/js/tiny_mce/themes/advanced/docs/en/images/insert_link_window.gif (added)
-
program/js/tiny_mce/themes/advanced/docs/en/images/insert_table_window.gif (added)
-
program/js/tiny_mce/themes/advanced/docs/en/index.htm (added)
-
program/js/tiny_mce/themes/advanced/docs/en/insert_anchor_button.htm (added)
-
program/js/tiny_mce/themes/advanced/docs/en/insert_image_button.htm (added)
-
program/js/tiny_mce/themes/advanced/docs/en/insert_link_button.htm (added)
-
program/js/tiny_mce/themes/advanced/docs/en/insert_table_button.htm (added)
-
program/js/tiny_mce/themes/advanced/docs/en/style.css (added)
-
program/js/tiny_mce/themes/advanced/editor_template.js (added)
-
program/js/tiny_mce/themes/advanced/editor_template_src.js (added)
-
program/js/tiny_mce/themes/advanced/image.htm (added)
-
program/js/tiny_mce/themes/advanced/images (added)
-
program/js/tiny_mce/themes/advanced/images/anchor.gif (added)
-
program/js/tiny_mce/themes/advanced/images/anchor_symbol.gif (added)
-
program/js/tiny_mce/themes/advanced/images/backcolor.gif (added)
-
program/js/tiny_mce/themes/advanced/images/bold.gif (added)
-
program/js/tiny_mce/themes/advanced/images/bold_de_se.gif (added)
-
program/js/tiny_mce/themes/advanced/images/bold_es.gif (added)
-
program/js/tiny_mce/themes/advanced/images/bold_fr.gif (added)
-
program/js/tiny_mce/themes/advanced/images/bold_ru.gif (added)
-
program/js/tiny_mce/themes/advanced/images/bold_tw.gif (added)
-
program/js/tiny_mce/themes/advanced/images/browse.gif (added)
-
program/js/tiny_mce/themes/advanced/images/bullist.gif (added)
-
program/js/tiny_mce/themes/advanced/images/button_menu.gif (added)
-
program/js/tiny_mce/themes/advanced/images/buttons.gif (added)
-
program/js/tiny_mce/themes/advanced/images/cancel_button_bg.gif (added)
-
program/js/tiny_mce/themes/advanced/images/charmap.gif (added)
-
program/js/tiny_mce/themes/advanced/images/cleanup.gif (added)
-
program/js/tiny_mce/themes/advanced/images/close.gif (added)
-
program/js/tiny_mce/themes/advanced/images/code.gif (added)
-
program/js/tiny_mce/themes/advanced/images/color.gif (added)
-
program/js/tiny_mce/themes/advanced/images/copy.gif (added)
-
program/js/tiny_mce/themes/advanced/images/custom_1.gif (added)
-
program/js/tiny_mce/themes/advanced/images/cut.gif (added)
-
program/js/tiny_mce/themes/advanced/images/forecolor.gif (added)
-
program/js/tiny_mce/themes/advanced/images/help.gif (added)
-
program/js/tiny_mce/themes/advanced/images/hr.gif (added)
-
program/js/tiny_mce/themes/advanced/images/image.gif (added)
-
program/js/tiny_mce/themes/advanced/images/indent.gif (added)
-
program/js/tiny_mce/themes/advanced/images/insert_button_bg.gif (added)
-
program/js/tiny_mce/themes/advanced/images/italic.gif (added)
-
program/js/tiny_mce/themes/advanced/images/italic_de_se.gif (added)
-
program/js/tiny_mce/themes/advanced/images/italic_es.gif (added)
-
program/js/tiny_mce/themes/advanced/images/italic_ru.gif (added)
-
program/js/tiny_mce/themes/advanced/images/italic_tw.gif (added)
-
program/js/tiny_mce/themes/advanced/images/justifycenter.gif (added)
-
program/js/tiny_mce/themes/advanced/images/justifyfull.gif (added)
-
program/js/tiny_mce/themes/advanced/images/justifyleft.gif (added)
-
program/js/tiny_mce/themes/advanced/images/justifyright.gif (added)
-
program/js/tiny_mce/themes/advanced/images/link.gif (added)
-
program/js/tiny_mce/themes/advanced/images/menu_check.gif (added)
-
program/js/tiny_mce/themes/advanced/images/newdocument.gif (added)
-
program/js/tiny_mce/themes/advanced/images/numlist.gif (added)
-
program/js/tiny_mce/themes/advanced/images/opacity.png (added)
-
program/js/tiny_mce/themes/advanced/images/outdent.gif (added)
-
program/js/tiny_mce/themes/advanced/images/paste.gif (added)
-
program/js/tiny_mce/themes/advanced/images/redo.gif (added)
-
program/js/tiny_mce/themes/advanced/images/removeformat.gif (added)
-
program/js/tiny_mce/themes/advanced/images/separator.gif (added)
-
program/js/tiny_mce/themes/advanced/images/spacer.gif (added)
-
program/js/tiny_mce/themes/advanced/images/statusbar_resize.gif (added)
-
program/js/tiny_mce/themes/advanced/images/strikethrough.gif (added)
-
program/js/tiny_mce/themes/advanced/images/sub.gif (added)
-
program/js/tiny_mce/themes/advanced/images/sup.gif (added)
-
program/js/tiny_mce/themes/advanced/images/underline.gif (added)
-
program/js/tiny_mce/themes/advanced/images/underline_es.gif (added)
-
program/js/tiny_mce/themes/advanced/images/underline_fr.gif (added)
-
program/js/tiny_mce/themes/advanced/images/underline_ru.gif (added)
-
program/js/tiny_mce/themes/advanced/images/underline_tw.gif (added)
-
program/js/tiny_mce/themes/advanced/images/undo.gif (added)
-
program/js/tiny_mce/themes/advanced/images/unlink.gif (added)
-
program/js/tiny_mce/themes/advanced/images/visualaid.gif (added)
-
program/js/tiny_mce/themes/advanced/images/xp (added)
-
program/js/tiny_mce/themes/advanced/images/xp/tab_bg.gif (added)
-
program/js/tiny_mce/themes/advanced/images/xp/tab_end.gif (added)
-
program/js/tiny_mce/themes/advanced/images/xp/tab_sel_bg.gif (added)
-
program/js/tiny_mce/themes/advanced/images/xp/tab_sel_end.gif (added)
-
program/js/tiny_mce/themes/advanced/images/xp/tabs_bg.gif (added)
-
program/js/tiny_mce/themes/advanced/jscripts (added)
-
program/js/tiny_mce/themes/advanced/jscripts/about.js (added)
-
program/js/tiny_mce/themes/advanced/jscripts/anchor.js (added)
-
program/js/tiny_mce/themes/advanced/jscripts/charmap.js (added)
-
program/js/tiny_mce/themes/advanced/jscripts/color_picker.js (added)
-
program/js/tiny_mce/themes/advanced/jscripts/image.js (added)
-
program/js/tiny_mce/themes/advanced/jscripts/link.js (added)
-
program/js/tiny_mce/themes/advanced/jscripts/source_editor.js (added)
-
program/js/tiny_mce/themes/advanced/langs (added)
-
program/js/tiny_mce/themes/advanced/langs/en.js (added)
-
program/js/tiny_mce/themes/advanced/link.htm (added)
-
program/js/tiny_mce/themes/advanced/source_editor.htm (added)
-
program/js/tiny_mce/tiny_mce.js (added)
-
program/js/tiny_mce/tiny_mce_popup.js (added)
-
program/js/tiny_mce/tiny_mce_src.js (added)
-
program/js/tiny_mce/utils (added)
-
program/js/tiny_mce/utils/editable_selects.js (added)
-
program/js/tiny_mce/utils/form_utils.js (added)
-
program/js/tiny_mce/utils/mclayer.js (added)
-
program/js/tiny_mce/utils/mctabs.js (added)
-
program/js/tiny_mce/utils/validate.js (added)
-
program/lib/Mail/mime.php (modified) (3 diffs)
-
program/localization/en_US/labels.inc (modified) (3 diffs)
-
program/localization/en_US/messages.inc (modified) (1 diff)
-
program/steps/mail/compose.inc (modified) (11 diffs)
-
program/steps/mail/func.inc (modified) (5 diffs)
-
program/steps/mail/sendmail.inc (modified) (3 diffs)
-
program/steps/settings/edit_identity.inc (modified) (3 diffs)
-
program/steps/settings/func.inc (modified) (2 diffs)
-
program/steps/settings/save_identity.inc (modified) (2 diffs)
-
program/steps/settings/save_prefs.inc (modified) (1 diff)
-
skins/default/editor_content.css (added)
-
skins/default/editor_popup.css (added)
-
skins/default/editor_ui.css (added)
-
skins/default/templates/compose.html (modified) (1 diff)
-
skins/default/templates/ldappublicsearch.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/CHANGELOG
r342 r344 1 1 CHANGELOG RoundCube Webmail 2 2 --------------------------- 3 4 2006/09/13 (estadtherr) 5 ---------- 6 - Introduction of TinyMCE HTML editor support for message composition and signatures 7 Note : a new column is added to the "identities" database table 8 3 9 4 10 2006/09/12 (estadtherr) -
trunk/roundcubemail/SQL/mysql.initial.sql
r325 r344 59 59 `bcc` varchar(128) NOT NULL default '', 60 60 `signature` text NOT NULL, 61 `html_signature` tinyint(1) NOT NULL default '0', 61 62 PRIMARY KEY (`identity_id`), 62 63 KEY `user_id` (`user_id`) -
trunk/roundcubemail/SQL/mysql.update.sql
r325 r344 8 8 ADD UNIQUE `uniqueness` (`cache_key`, `uid`); 9 9 10 ALTER TABLE 'identities' 11 ADD 'html_signature' tinyint(1) default 0 NOT NULL; -
trunk/roundcubemail/SQL/mysql5.initial.sql
r325 r344 115 115 `bcc` varchar(128) NOT NULL, 116 116 `signature` text NOT NULL, 117 `html_signature` tinyint(1) NOT NULL DEFAULT '0', 117 118 `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0', 118 119 PRIMARY KEY(`identity_id`), -
trunk/roundcubemail/SQL/postgres.initial.sql
r325 r344 70 70 "reply-to" character varying(128), 71 71 bcc character varying(128), 72 signature text 72 signature text, 73 html_signature integer DEFAULT 0 NOT NULL 73 74 ); 74 75 -
trunk/roundcubemail/SQL/postgres.update.sql
r325 r344 6 6 ALTER TABLE "messages" ADD UNIQUE (cache_key, uid); 7 7 8 ALTER TABLE "identities" ADD html_signature integer DEFAULT 0 NOT NULL; 9 -
trunk/roundcubemail/SQL/sqlite.initial.sql
r325 r344 59 59 "reply-to" varchar(128) NOT NULL default '', 60 60 bcc varchar(128) NOT NULL default '', 61 signature text NOT NULL default '' 61 signature text NOT NULL default '', 62 html_signature tinyint NOT NULL default '0' 62 63 ); 63 64 -
trunk/roundcubemail/index.php
r338 r344 82 82 require_once('include/main.inc'); 83 83 require_once('include/cache.inc'); 84 require_once('lib/html2text.inc'); 84 85 require_once('PEAR.php'); 85 86 … … 146 147 } 147 148 149 // handle HTML->text conversion 150 if ($_action=='html2text') 151 { 152 $htmlText = $HTTP_RAW_POST_DATA; 153 $converter = new html2text($htmlText); 154 155 // TODO possibly replace with rcube_remote_response() 156 send_nocacheing_headers(); 157 header('Content-Type: text/plain'); 158 $plaintext = $converter->get_text(); 159 print $plaintext; 160 161 exit; 162 } 163 148 164 149 165 // try to log in … … 241 257 exit; 242 258 } 243 244 259 245 260 // include task specific files -
trunk/roundcubemail/program/include/bugs.inc
r90 r344 116 116 } 117 117 118 function log_debug($filename, $text) 119 { 120 global $CONFIG, $INSTALL_PATH; 121 122 if (empty($CONFIG['log_dir'])) 123 $CONFIG['log_dir'] = $INSTALL_PATH.'logs'; 124 125 // try to open specific log file for writing 126 if ($fp = @fopen($CONFIG['log_dir'].'/'.$filename, 'a')) 127 { 128 fwrite($fp, date("d-M-Y H:i:s", mktime()) . ' ' . $text . "\n"); 129 fclose($fp); 130 } 131 } 118 132 119 133 ?> -
trunk/roundcubemail/program/include/main.inc
r341 r344 376 376 // don't wait for page onload. Call init at the bottom of the page (delayed) 377 377 $javascript_foot = "if (window.call_init)\n call_init('$JS_OBJECT_NAME');"; 378 378 379 379 if (!empty($GLOBALS['_framed'])) 380 380 $javascript .= "$JS_OBJECT_NAME.set_env('framed', true);\n"; … … 1198 1198 'priorityselector' => 'rcmail_priority_selector', 1199 1199 'charsetselector' => 'rcmail_charset_selector', 1200 'editorselector' => 'rcmail_editor_selector', 1200 1201 'searchform' => 'rcmail_search_form', 1201 1202 'receiptcheckbox' => 'rcmail_receipt_checkbox', … … 1280 1281 $attrib['type'] = strtolower($attrib['type']); 1281 1282 else 1282 $attrib['type'] = ($attrib['image'] || $attrib['imagepas'] || $arg['imageact']) ? 'image' : 'link'; 1283 1283 $attrib['type'] = ($attrib['image'] || $attrib['imagepas'] || $attrib['imageact']) ? 'image' : 'link'; 1284 1284 1285 1285 $command = $attrib['command']; … … 1290 1290 1291 1291 // add button to button stack 1292 else if($attrib['image'] || $a rg['imageact'] || $attrib['imagepas'] || $attrib['class'])1292 else if($attrib['image'] || $attrib['imageact'] || $attrib['imagepas'] || $attrib['class']) 1293 1293 { 1294 1294 if(!$attrib['name']) … … 1488 1488 1489 1489 1490 1490 /** 1491 * Create an edit field for inclusion on a form 1492 * 1493 * @param string col field name 1494 * @param string value field value 1495 * @param array attrib HTML element attributes for field 1496 * @param string type HTML element type (default 'text') 1497 * @return string HTML field definition 1498 */ 1491 1499 function rcmail_get_edit_field($col, $value, $attrib, $type='text') 1492 1500 { -
trunk/roundcubemail/program/include/rcube_shared.inc
r331 r344 29 29 var $scripts_path = ''; 30 30 var $script_files = array(); 31 var $external_scripts = array(); 31 32 var $scripts = array(); 32 33 var $charset = 'ISO-8859-1'; … … 35 36 var $script_tag = "<script type=\"text/javascript\">\n<!--\n%s\n\n//-->\n</script>\n"; 36 37 var $default_template = "<html>\n<head><title></title></head>\n<body></body>\n</html>"; 37 38 var $tag_format_external_script = "<script type=\"text/javascript\" src=\"%s\"></script>\n"; 39 38 40 var $title = ''; 39 41 var $header = ''; … … 70 72 } 71 73 72 74 function include_external_script($script_location, $position='head') 75 { 76 if (!is_array($this->external_scripts[$position])) 77 { 78 $this->external_scripts[$position] = array(); 79 } 80 81 $this->external_scripts[$position][] = $script_location; 82 } 83 73 84 function add_script($script, $position='head') 74 85 { 75 86 if (!isset($this->scripts[$position])) 76 $this->scripts[$position] = '';77 78 $this->scripts[$position] .= "\n$script";87 $this->scripts[$position] = "\n$script"; 88 else 89 $this->scripts[$position] .= "\n$script"; 79 90 } 80 91 … … 140 151 $__page_header .= sprintf($this->script_tag_file, $this->scripts_path, $file); 141 152 153 if (is_array($this->external_scripts['head'])) 154 { 155 foreach ($this->external_scripts['head'] as $xscript) 156 { 157 $__page_header .= sprintf($this->tag_format_external_script, $xscript); 158 } 159 } 160 142 161 if (strlen($this->scripts['head'])) 143 162 $__page_header .= sprintf($this->script_tag, $this->scripts['head']); 144 163 145 164 if (is_array($this->script_files['foot'])) 165 { 146 166 foreach ($this->script_files['foot'] as $file) 147 167 $__page_footer .= sprintf($this->script_tag_file, $this->scripts_path, $file); 168 } 148 169 149 170 if (strlen($this->scripts['foot'])) 150 171 $__page_footer .= sprintf($this->script_tag, $this->scripts['foot']); 151 172 152 153 173 $__page_header .= $this->css->show(); 154 155 174 156 175 // find page header … … 193 212 194 213 // find and add page footer 195 if(($fpos = strpos(strtolower($output), '</body>')) || ($fpos = strpos(strtolower($output), '</html>'))) 214 $output_lc = strtolower($output); 215 if(($fpos = strrpos($output_lc, '</body>')) || 216 ($fpos = strrpos($output_lc, '</html>'))) 217 { 196 218 $output = substr($output,0,$fpos) . "$__page_footer\n" . substr($output,$fpos,strlen($output)); 219 } 197 220 else 198 221 $output .= "\n$__page_footer"; … … 203 226 204 227 205 // correct absolute path es in images and other tags228 // correct absolute paths in images and other tags 206 229 $output = preg_replace('/(src|href|background)=(["\']?)(\/[a-z0-9_\-]+)/Ui', "\\1=\\2$base_path\\3", $output); 207 230 $output = str_replace('$__skin_path', $base_path, $output); … … 855 878 unset($this->attrib['value']); 856 879 857 if (strlen($value) )880 if (strlen($value) && !isset($this->attrib['mce_editable'])) 858 881 $value = rep_specialchars_output($value, 'html', 'replace', FALSE); 859 882 860 883 // return final tag 861 884 return sprintf('<%s%s>%s</%s>%s', … … 1234 1257 $key = "'$key'"; 1235 1258 1236 if (!is_array($value) )1259 if (!is_array($value) && is_string($value)) 1237 1260 { 1238 1261 $value = str_replace("\r\n", '\n', $value); … … 1245 1268 if ($type=='string') 1246 1269 $is_string = true; 1270 else if (($type == 'mixed' && is_bool($value)) || $type == 'bool') 1271 { 1272 $is_string = false; 1273 $value = $value ? "true" : "false"; 1274 } 1247 1275 else if ((($type=='mixed' && is_numeric($value)) || $type=='int') && strlen($value)<16) // js interprets numbers with digits >15 as ...e+... 1248 1276 $is_string = FALSE; … … 1271 1299 } 1272 1300 else 1301 { 1273 1302 return $arr; 1303 } 1274 1304 } 1275 1305 … … 1438 1468 1439 1469 1470 /** 1471 * strrstr 1472 * 1473 * return the last occurence of a string in another string 1474 * @param haystack string string in which to search 1475 * @param needle string string for which to search 1476 * @return index of needle within haystack, or false if not found 1477 */ 1478 function strrstr($haystack, $needle) 1479 { 1480 $pver = phpversion(); 1481 if ($pver[0] >= 5) 1482 { 1483 return strrpos($haystack, $needle); 1484 } 1485 else 1486 { 1487 $index = strpos(strrev($haystack), strrev($needle)); 1488 if($index === false) { 1489 return false; 1490 } 1491 $index = strlen($haystack) - strlen($needle) - $index; 1492 return $index; 1493 } 1494 } 1495 1496 1440 1497 ?> -
trunk/roundcubemail/program/js/app.js
r341 r344 143 143 this.gui_objects.remoteobjectsmsg.style.display = 'block'; 144 144 this.enable_command('load-images', true); 145 } 145 } 146 146 147 147 if (this.env.action=='compose') … … 156 156 this.enable_command('savedraft', true); 157 157 } 158 158 159 159 if (this.env.messagecount) 160 160 this.enable_command('select-all', 'select-none', 'sort', 'expunge', true); … … 175 175 if (this.env.action=='print') 176 176 window.print(); 177 177 178 178 // get unread count for each mailbox 179 179 if (this.gui_objects.mailboxlist) … … 438 438 var input_subject = rcube_find_object('_subject'); 439 439 var input_message = rcube_find_object('_message'); 440 440 441 441 // init live search events 442 442 if (input_to) … … 457 457 else if (input_message) 458 458 this.set_caret2start(input_message); // input_message.focus(); 459 459 460 460 // get summary of all field values 461 461 this.cmp_hash = this.compose_field_hash(); … … 2020 2020 2021 2021 // check for empty body 2022 if ( input_message.value=='')2022 if ((input_message.value=='')&&(tinyMCE.getContent()=='')) 2023 2023 { 2024 2024 if (!confirm(this.get_label('nobodywarning'))) … … 2080 2080 var input_message = rcube_find_object('_message'); 2081 2081 var message = input_message ? input_message.value : ''; 2082 var is_html = (rcube_find_object('_is_html').value == '1'); 2082 2083 var sig, p; 2083 2084 2084 2085 if (!this.env.identity) 2085 2086 this.env.identity = id 2086 2087 // remove the 'old' signature 2088 if (this.env.identity && this.env.signatures && this.env.signatures[this.env.identity]) 2089 { 2090 sig = this.env.signatures[this.env.identity]; 2091 if (sig.indexOf('--')!=0) 2092 sig = '--\n'+sig; 2093 2094 p = message.lastIndexOf(sig); 2095 if (p>=0) 2096 message = message.substring(0, p-1) + message.substring(p+sig.length, message.length); 2097 } 2098 2099 // add the new signature string 2100 if (this.env.signatures && this.env.signatures[id]) 2101 { 2102 sig = this.env.signatures[id]; 2103 if (sig.indexOf('--')!=0) 2104 sig = '--\n'+sig; 2105 message += '\n'+sig; 2087 2088 if (!is_html) 2089 { 2090 // remove the 'old' signature 2091 if (this.env.identity && this.env.signatures && this.env.signatures[this.env.identity]) 2092 { 2093 sig = this.env.signatures[this.env.identity]['text']; 2094 if (sig.indexOf('--')!=0) 2095 sig = '--\n'+sig; 2096 2097 p = message.lastIndexOf(sig); 2098 if (p>=0) 2099 message = message.substring(0, p-1) + message.substring(p+sig.length, message.length); 2100 } 2101 2102 // add the new signature string 2103 if (this.env.signatures && this.env.signatures[id]) 2104 { 2105 sig = this.env.signatures[id]['text']; 2106 if (sig.indexOf('--')!=0) 2107 sig = '--\n'+sig; 2108 message += '\n'+sig; 2109 } 2110 } 2111 else 2112 { 2113 var eid = tinyMCE.getEditorId('_message'); 2114 // editor is a TinyMCE_Control object 2115 var editor = tinyMCE.getInstanceById(eid); 2116 var msgDoc = editor.getDoc(); 2117 var msgBody = msgDoc.body; 2118 2119 if (this.env.signatures && this.env.signatures[id]) 2120 { 2121 // Append the signature as a span within the body 2122 var sigElem = msgDoc.getElementById("_rc_sig"); 2123 if (!sigElem) 2124 { 2125 sigElem = msgDoc.createElement("span"); 2126 sigElem.setAttribute("id", "_rc_sig"); 2127 msgBody.appendChild(sigElem); 2128 } 2129 if (this.env.signatures[id]['is_html']) 2130 { 2131 sigElem.innerHTML = this.env.signatures[id]['text']; 2132 } 2133 else 2134 { 2135 sigElem.innerHTML = '<pre>' + this.env.signatures[id]['text'] + '</pre>'; 2136 } 2137 } 2106 2138 } 2107 2139 2108 2140 if (input_message) 2109 2141 input_message.value = message; 2110 2142 2111 2143 this.env.identity = id; 2112 2144 return true; … … 3432 3464 3433 3465 3466 this.toggle_editor = function(checkbox, textElementName) 3467 { 3468 var ischecked = checkbox.checked; 3469 if (ischecked) 3470 { 3471 tinyMCE.execCommand('mceAddControl', true, textElementName); 3472 } 3473 else 3474 { 3475 tinyMCE.execCommand('mceRemoveControl', true, textElementName); 3476 } 3477 } 3434 3478 3435 3479 /********************************************************/ … … 3821 3865 } 3822 3866 3823 // se dnGET request3867 // send GET request 3824 3868 this.GET = function(url) 3825 3869 { … … 3842 3886 3843 3887 3844 this.POST = function(url, a_param) 3845 { 3846 // not implemented yet 3888 this.POST = function(url, body, contentType) 3889 { 3890 // default value for contentType if not provided 3891 contentType = typeof(contentType) != 'undefined' ? 3892 contentType : 'application/x-www-form-urlencoded'; 3893 3894 this.build(); 3895 3896 if (!this.xmlhttp) 3897 { 3898 this.onerror(this); 3899 return false; 3900 } 3901 3902 var ref=this; 3903 this.url = url; 3904 this.busy = true; 3905 3906 this.xmlhttp.onreadystatechange = function() { ref.xmlhttp_onreadystatechange(); }; 3907 this.xmlhttp.open('POST', url, true); 3908 this.xmlhttp.setRequestHeader('Content-Type', contentType); 3909 this.xmlhttp.send(body); 3847 3910 }; 3848 3911 -
trunk/roundcubemail/program/lib/Mail/mime.php
r343 r344 199 199 200 200 /** 201 * returns the HTML body portion of the message 202 * @return string HTML body of the message 203 * @access public 204 */ 205 function getHTMLBody() 206 { 207 return $this->_htmlbody; 208 } 209 210 /** 201 211 * Adds an image to the list of embedded images. 202 212 * … … 207 217 * @param bool $isfilename Whether $file is a filename or not 208 218 * Defaults to true 219 * @param string $contentid Desired Content-ID of MIME part 220 * Defaults to generated unique ID 209 221 * @return mixed true on success or PEAR_Error object 210 222 * @access public 211 223 */ 212 224 function addHTMLImage($file, $c_type='application/octet-stream', 213 $name = '', $isfilename = true )225 $name = '', $isfilename = true, $contentid = '') 214 226 { 215 227 $filedata = ($isfilename === true) ? $this->_file2str($file) … … 223 235 return $filedata; 224 236 } 237 if ($contentid == '') { 238 $contentid = md5(uniqid(time())); 239 } 225 240 $this->_html_images[] = array( 226 241 'body' => $filedata, 227 242 'name' => $filename, 228 243 'c_type' => $c_type, 229 'cid' => md5(uniqid(time()))244 'cid' => $contentid 230 245 ); 231 246 return true; -
trunk/roundcubemail/program/localization/en_US/labels.inc
r337 r344 64 64 $labels['filesize'] = 'File size'; 65 65 66 $labels['preferhtml'] = ' PreferHTML';66 $labels['preferhtml'] = 'Display HTML'; 67 67 $labels['htmlmessage'] = 'HTML Message'; 68 68 $labels['prettydate'] = 'Pretty dates'; … … 121 121 122 122 // message compose 123 $labels['compose'] = 'Compose a message'; 123 $labels['compose'] = 'Compose a message'; 124 $labels['sendmessage'] = 'Send the message now'; 124 125 $labels['savemessage'] = 'Save this draft'; 125 $labels['sendmessage'] = 'Send the message now';126 126 $labels['addattachment'] = 'Attach a file'; 127 $labels['charset'] = 'Charset'; 128 $labels['returnreceipt'] = 'Return receipt'; 127 $labels['charset'] = 'Charset'; 128 $labels['editortype'] = 'Editor type'; 129 $labels['returnreceipt'] = 'Return receipt'; 129 130 130 131 $labels['checkspelling'] = 'Check spelling'; 131 132 $labels['resumeediting'] = 'Resume editing'; 132 $labels['revertto'] = 'Revert to';133 $labels['revertto'] = 'Revert to'; 133 134 134 135 $labels['attachments'] = 'Attachments'; … … 202 203 $labels['signature'] = 'Signature'; 203 204 $labels['dstactive'] = 'Daylight savings'; 205 $labels['htmleditor'] = 'Use HTML editor'; 206 $labels['htmlsignature'] = 'HTML signature'; 204 207 205 208 $labels['autosavedraft'] = 'Automatically save draft'; -
trunk/roundcubemail/program/localization/en_US/messages.inc
r285 r344 107 107 $messages['folderdeleted'] = 'Folder successfully deleted'; 108 108 109 $messages['converting'] = 'Removing formatting from message...'; 109 110 110 111 ?> -
trunk/roundcubemail/program/steps/mail/compose.inc
r339 r344 54 54 55 55 // add some labels to client 56 rcube_add_label('nosubject', 'norecipientwarning', 'nosubjectwarning', 'nobodywarning', 'notsentwarning', 'savingmessage', 'sendingmessage', 'messagesaved' );56 rcube_add_label('nosubject', 'norecipientwarning', 'nosubjectwarning', 'nobodywarning', 'notsentwarning', 'savingmessage', 'sendingmessage', 'messagesaved', 'converting'); 57 57 58 58 // add config parameter to client script … … 273 273 274 274 // get this user's identities 275 $sql_result = $DB->query("SELECT identity_id, name, email, signature 275 $sql_result = $DB->query("SELECT identity_id, name, email, signature, html_signature 276 276 FROM ".get_table_name('identities')." 277 277 WHERE user_id=? … … 279 279 ORDER BY ".$DB->quoteIdentifier('standard')." DESC, name ASC", 280 280 $_SESSION['user_id']); 281 281 282 282 if ($DB->num_rows($sql_result)) 283 283 { 284 284 $from_id = 0; 285 285 $a_signatures = array(); 286 286 287 287 $field_attrib['onchange'] = "$JS_OBJECT_NAME.change_identity(this)"; 288 288 $select_from = new select($field_attrib); 289 289 290 290 while ($sql_arr = $DB->fetch_assoc($sql_result)) 291 291 { 292 $select_from->add(format_email_recipient($sql_arr['email'], $sql_arr['name']), $sql_arr['identity_id']); 292 $identity_id = $sql_arr['identity_id']; 293 $select_from->add(format_email_recipient($sql_arr['email'], $sql_arr['name']), $identity_id); 293 294 294 295 // add signature to array 295 296 if (!empty($sql_arr['signature'])) 296 $a_signatures[$sql_arr['identity_id']] = $sql_arr['signature']; 297 297 { 298 $a_signatures[$identity_id]['text'] = $sql_arr['signature']; 299 $a_signatures[$identity_id]['is_html'] = ($sql_arr['html_signature'] == 1) ? true : false; 300 } 301 298 302 // set identity if it's one of the reply-message recipients 299 303 if (in_array($sql_arr['email'], $a_recipients)) 300 304 $from_id = $sql_arr['identity_id']; 301 305 302 306 if ($compose_mode == RCUBE_COMPOSE_REPLY && is_array($MESSAGE['FROM'])) 303 307 $MESSAGE['FROM'][] = $sql_arr['email']; … … 305 309 if ($compose_mode == RCUBE_COMPOSE_DRAFT && strstr($MESSAGE['headers']->from, $sql_arr['email'])) 306 310 $from_id = $sql_arr['identity_id']; 307 308 311 } 309 312 … … 313 316 314 317 $out = $select_from->show($from_id); 315 316 318 317 319 // add signatures to client … … 341 343 if (empty($attrib['id'])) 342 344 $attrib['id'] = 'rcmComposeMessage'; 343 345 344 346 $attrib['name'] = '_message'; 345 $textarea = new textarea($attrib); 347 348 if ($CONFIG['htmleditor']) 349 $isHtml = true; 350 else 351 $isHtml = false; 346 352 347 353 $body = ''; 348 354 349 355 // use posted message body 350 356 if (!empty($_POST['_message'])) 357 { 351 358 $body = get_input_value('_message', RCUBE_INPUT_POST, TRUE); 352 359 } 353 360 // compose reply-body 354 361 else if ($compose_mode == RCUBE_COMPOSE_REPLY) 355 362 { 356 $body = rcmail_first_text_part($MESSAGE); 363 $hasHtml = rcmail_has_html_part($MESSAGE['parts']); 364 if ($hasHtml && $CONFIG['htmleditor']) 365 { 366 $body = rcmail_first_html_part($MESSAGE); 367 $isHtml = true; 368 } 369 else 370 { 371 $body = rcmail_first_text_part($MESSAGE); 372 $isHtml = false; 373 } 357 374 if (strlen($body)) 358 $body = rcmail_create_reply_body($body); 359 } 360 375 $body = rcmail_create_reply_body($body, $isHtml); 376 } 361 377 // forward message body inline 362 378 else if ($compose_mode == RCUBE_COMPOSE_FORWARD) 363 379 { 364 $body = rcmail_first_text_part($MESSAGE); 380 $hasHtml = rcmail_has_html_part($MESSAGE['parts']); 381 if ($hasHtml && $CONFIG['htmleditor']) 382 { 383 $body = rcmail_first_html_part($MESSAGE); 384 $isHtml = true; 385 } 386 else 387 { 388 $body = rcmail_first_text_part($MESSAGE); 389 $isHtml = false; 390 } 365 391 if (strlen($body)) 366 $body = rcmail_create_forward_body($body); 367 } 368 369 // forward message body inline 392 $body = rcmail_create_forward_body($body, $isHtml); 393 } 370 394 else if ($compose_mode == RCUBE_COMPOSE_DRAFT) 371 395 { 372 $body = rcmail_first_text_part($MESSAGE); 396 $hasHtml = rcmail_has_html_part($MESSAGE['parts']); 397 if ($hasHtml && $CONFIG['htmleditor']) 398 { 399 $body = rcmail_first_html_part($MESSAGE); 400 $isHtml = true; 401 } 402 else 403 { 404 $body = rcmail_first_text_part($MESSAGE); 405 $isHtml = false; 406 } 373 407 if (strlen($body)) 374 $body = rcmail_create_draft_body($body); 375 } 376 408 $body = rcmail_create_draft_body($body, $isHtml); 409 } 410 411 $OUTPUT->include_script('tiny_mce/tiny_mce.js'); 412 $OUTPUT->include_script("editor.js"); 413 $OUTPUT->add_script('rcmail_editor_init($__skin_path);'); 414 377 415 $out = $form_start ? "$form_start\n" : ''; 378 416 … … 383 421 $out .= $drafttoggle->show(); 384 422 423 $msgtype = new hiddenfield(array('name' => '_is_html', 'value' => ($isHtml?"1":"0"))); 424 $out .= $msgtype->show(); 425 426 // If desired, set this text area to be editable by TinyMCE 427 if ($isHtml) 428 $attrib['mce_editable'] = "true"; 429 $textarea = new textarea($attrib); 385 430 $out .= $textarea->show($body); 386 431 $out .= $form_end ? "\n$form_end" : ''; 387 432 388 433 // include GoogieSpell 389 if (!empty($CONFIG['enable_spellcheck']) )434 if (!empty($CONFIG['enable_spellcheck']) && !$isHtml) 390 435 { 391 436 $lang_set = ''; … … 423 468 424 469 425 function rcmail_create_reply_body($body )470 function rcmail_create_reply_body($body, $bodyIsHtml) 426 471 { 427 472 global $IMAP, $MESSAGE; 428 473 429 // soft-wrap message first 430 $body = wordwrap($body, 75); 431 432 // split body into single lines 433 $a_lines = preg_split('/\r?\n/', $body); 434 435 // add > to each line 436 for($n=0; $n<sizeof($a_lines); $n++) 437 { 438 if (strpos($a_lines[$n], '>')===0) 439 $a_lines[$n] = '>'.$a_lines[$n]; 440 else 441 $a_lines[$n] = '> '.$a_lines[$n]; 442 } 474 if (! $bodyIsHtml) 475 { 476 // soft-wrap message first 477 $body = wordwrap($body, 75); 478 479 // split body into single lines 480 $a_lines = preg_split('/\r?\n/', $body); 481 482 // add > to each line 483 for($n=0; $n<sizeof($a_lines); $n++) 484 { 485 if (strpos($a_lines[$n], '>')===0) 486 $a_lines[$n] = '>'.$a_lines[$n]; 487 else 488 $a_lines[$n] = '> '.$a_lines[$n]; 489 } 443 490 444 $body = join("\n", $a_lines); 445 446 // add title line 447 $pefix = sprintf("\n\n\nOn %s, %s wrote:\n", 448 $MESSAGE['headers']->date, 449 $IMAP->decode_header($MESSAGE['headers']->from)); 450 451 452 // try to remove the signature 453 if ($sp = strrpos($body, '-- ')) 454 { 455 if ($body{$sp+3}==' ' || $body{$sp+3}=="\n" || $body{$sp+3}=="\r") 456 $body = substr($body, 0, $sp-1); 457 } 458 459 return $pefix.$body; 460 } 461 462 463 function rcmail_create_forward_body($body) 491 $body = join("\n", $a_lines); 492 493 // add title line 494 $prefix = sprintf("\n\n\nOn %s, %s wrote:\n", 495 $MESSAGE['headers']->date, 496 $IMAP->decode_header($MESSAGE['headers']->from)); 497 498 // try to remove the signature 499 if ($sp = strrstr($body, '-- ')) 500 { 501 if ($body{$sp+3}==' ' || $body{$sp+3}=="\n" || $body{$sp+3}=="\r") 502 $body = substr($body, 0, $sp-1); 503 } 504 $suffix = ''; 505 } 506 else 507 { 508 $prefix = sprintf("<br><br>On %s, %s wrote:<br><blockquote type=\"cite\" " . 509 "style=\"padding-left: 5px; border-left: #1010ff 2px solid; " . 510 "margin-left: 5px; width: 100%%\">", 511 $MESSAGE['headers']->date, 512 $IMAP->decode_header($MESSAGE['headers']->from)); 513 514 $suffix = "</blockquote>"; 515 } 516 517 return $prefix.$body.$suffix; 518 } 519 520 521 function rcmail_create_forward_body($body, $bodyIsHtml) 464 522 { 465 523 global $IMAP, $MESSAGE; 466 524 467 // soft-wrap message first 468 $body = wordwrap($body, 80); 469 470 $prefix = sprintf("\n\n\n-------- Original Message --------\nSubject: %s\nDate: %s\nFrom: %s\nTo: %s\n\n", 471 $MESSAGE['subject'], 472 $MESSAGE['headers']->date, 473 $IMAP->decode_header($MESSAGE['headers']->from), 474 $IMAP->decode_header($MESSAGE['headers']->to)); 475 525 if (! $bodyIsHtml) 526 { 527 // soft-wrap message first 528 $body = wordwrap($body, 80); 529 530 $prefix = sprintf("\n\n\n-------- Original Message --------\nSubject: %s\nDate: %s\nFrom: %s\nTo: %s\n\n", 531 $MESSAGE['subject'], 532 $MESSAGE['headers']->date, 533 $IMAP->decode_header($MESSAGE['headers']->from), 534 $IMAP->decode_header($MESSAGE['headers']->to)); 535 } 536 else 537 { 538 $prefix = sprintf( 539 "<br><br>-------- Original Message --------" . 540 "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tbody>" . 541 "<tr><th align=\"right\" nowrap=\"nowrap\" valign=\"baseline\">Subject: </th><td>%s</td></tr>" . 542 "<tr><th align=\"right\" nowrap=\"nowrap\" valign=\"baseline\">Date: </th><td>%s</td></tr>" . 543 "<tr><th align=\"right\" nowrap=\"nowrap\" valign=\"baseline\">From: </th><td>%s</td></tr>" . 544 "<tr><th align=\"right\" nowrap=\"nowrap\" valign=\"baseline\">To: </th><td>%s</td></tr>" . 545 "</tbody></table><br>", 546 $MESSAGE['subject'], 547 $MESSAGE['headers']->date, 548 $IMAP->decode_header($MESSAGE['headers']->from), 549 $IMAP->decode_header($MESSAGE['headers']->to)); 550 } 551 476 552 // add attachments 477 553 if (!isset($_SESSION['compose']['forward_attachments']) && … … 483 559 484 560 485 function rcmail_create_draft_body($body )561 function rcmail_create_draft_body($body, $bodyIsHtml) 486 562 { 487 563 global $IMAP, $MESSAGE; … … 582 658 function rcmail_compose_attachment_list($attrib) 583 659 { 584 global $OUTPUT, $JS_OBJECT_NAME ;660 global $OUTPUT, $JS_OBJECT_NAME, $CONFIG; 585 661 586 662 // add ID if not given … … 707 783 708 784 785 function rcmail_editor_selector($attrib) 786 { 787 global $CONFIG, $MESSAGE, $compose_mode; 788 789 $choices = array( 790 'html' => 'HTML', 791 'plain' => 'Plain text' 792 ); 793 794 // determine whether HTML or plain text should be checked 795 if ($CONFIG['htmleditor']) 796 $useHtml = true; 797 else 798 $useHtml = false; 799 800 if ($compose_mode == RCUBE_COMPOSE_REPLY || 801 $compose_mode == RCUBE_COMPOSE_FORWARD || 802 $compose_mode == RCUBE_COMPOSE_DRAFT) 803 { 804 $hasHtml = rcmail_has_html_part($MESSAGE['parts']); 805 $useHtml = ($hasHtml && $CONFIG['htmleditor']); 806 } 807 808 $selector = ''; 809 foreach ($choices as $value => $text) 810 { 811 $checked = ''; 812 if ((($text == 'HTML') && $useHtml) || 813 (($text != 'HTML') && !$useHtml)) 814 $checked = 'checked'; 815 816 $selector .= sprintf("<input type='radio' name='_editorSelect' value='%s' %s onclick='return rcmail_toggle_editor(this)'>%s</input>\n", 817 $value, $checked, $text); 818 } 819 820 return $selector; 821 } 822 823 709 824 function get_form_tags($attrib) 710 825 { -
trunk/roundcubemail/program/steps/mail/func.inc
r339 r344 690 690 691 691 $body = is_array($part->replaces) ? strtr($part->body, $part->replaces) : $part->body; 692 692 693 693 // text/html 694 694 if ($part->ctype_secondary=='html') … … 1084 1084 if (empty($part->ctype_parameters) || empty($part->ctype_parameters['charset'])) 1085 1085 $$part->ctype_parameters['charset'] = $MESSAGE['headers']->charset; 1086 1086 1087 1087 // fetch part if not available 1088 1088 if (!isset($part->body)) 1089 1089 $part->body = $IMAP->get_message_part($MESSAGE['UID'], $part->mime_id, $part); 1090 1090 1091 1091 $body = rcmail_print_body($part, $safe_mode); 1092 1092 $out .= '<div class="message-part">'; … … 1188 1188 '<!--\\1-->', 1189 1189 $body); 1190 1190 1191 1191 $out = preg_replace(array('/(<body[^>]*>)/i', 1192 1192 '/(<\/body>)/i'), … … 1194 1194 '</div>'), 1195 1195 $out); 1196 1196 1197 1197 return $out; 1198 1198 } … … 1239 1239 } 1240 1240 1241 1242 function rcmail_has_html_part($message_parts) 1243 { 1244 if (!is_array($message_parts)) 1245 return FALSE; 1246 1247 // check all message parts 1248 foreach ($message_parts as $pid => $part) 1249 { 1250 $mimetype = strtolower($part->ctype_primary.'/'.$part->ctype_secondary); 1251 if ($mimetype=='text/html') 1252 { 1253 return TRUE; 1254 } 1255 } 1256 1257 return FALSE; 1258 } 1259 1260 // return first HTML part of a message 1261 function rcmail_first_html_part($message_struct) 1262 { 1263 global $IMAP; 1264 1265 if (!is_array($message_struct['parts'])) 1266 return FALSE; 1267 1268 $html_part = NULL; 1269 1270 // check all message parts 1271 foreach ($message_struct['parts'] as $pid => $part) 1272 { 1273 $mimetype = strtolower($part->ctype_primary.'/'.$part->ctype_secondary); 1274 if ($mimetype=='text/html') 1275 { 1276 $html_part = $IMAP->get_message_part($message_struct['UID'], $pid, $part); 1277 } 1278 } 1279 1280 if ($html_part) 1281 { 1282 // remove special chars encoding 1283 //$trans = array_flip(get_html_translation_table(HTML_ENTITIES)); 1284 //$html_part = strtr($html_part, $trans); 1285 1286 return $html_part; 1287 } 1288 1289 return FALSE; 1290 } 1241 1291 1242 1292 -
trunk/roundcubemail/program/steps/mail/sendmail.inc
r332 r344 24 24 //require_once('lib/smtp.inc'); 25 25 require_once('include/rcube_smtp.inc'); 26 require_once('lib/html2text.inc'); 26 27 require_once('Mail/mime.php'); 27 28 … … 63 64 } 64 65 66 /** 67 * go from this: 68 * <img src=".../tiny_mce/plugins/emotions/images/smiley-cool.gif" border="0" alt="Cool" title="Cool" /> 69 * 70 * to this: 71 * 72 * <IMG src="cid:smiley-cool.gif"/> 73 * ... 74 * ------part... 75 * Content-Type: image/gif 76 * Content-Transfer-Encoding: base64 77 * Content-ID: <smiley-cool.gif> 78 */ 79 function rcmail_attach_emoticons(&$mime_message) 80 { 81 global $CONFIG, $INSTALL_PATH; 82 83 $htmlContents = $mime_message->getHtmlBody(); 84 85 // remove any null-byte characters before parsing 86 $body = preg_replace('/\x00/', '', $htmlContents); 87 88 $last_img_pos = 0; 89 90 $searchstr = 'program/js/tiny_mce/plugins/emotions/images/'; 91 92 // find emoticon image tags 93 while ($pos = strpos($body, $searchstr, $last_img_pos)) 94 { 95 $pos2 = strpos($body, '"', $pos); 96 $body_pre = substr($body, 0, $pos); 97 $image_name = substr($body, $pos + strlen($searchstr), $pos2 - ($pos + strlen($searchstr))); 98 $body_post = substr($body, $pos2); 99 100 // add the image to the MIME message 101 $img_file = $INSTALL_PATH . '/' . $searchstr . $image_name; 102 if(! $mime_message->addHTMLImage($img_file, 'image/gif', '', true, '_' . $image_name)) 103 { 104 show_message("emoticonerror", 'error'); 105 } 106 107 $body = $body_pre . 'cid:_' . $image_name . $body_post; 108 109 $last_img_pos = $pos2; 110 } 111 112 $mime_message->setHTMLBody($body); 113 } 65 114 66 115 if (strlen($_POST['_draft_saveid']) > 3) … … 185 234 186 235 // create PEAR::Mail_mime instance 236 237 $isHtmlVal = strtolower(get_input_value('_is_html', RCUBE_INPUT_POST)); 238 $isHtml = ($isHtmlVal == "1"); 239 187 240 $MAIL_MIME = new Mail_mime($header_delm); 188 $MAIL_MIME->setTXTBody($message_body, FALSE, TRUE); 189 //$MAIL_MIME->setTXTBody(wordwrap($message_body), FALSE, TRUE); 241 242 // For HTML-formatted messages, construct the MIME message with both 243 // the HTML part and the plain-text part 244 245 if ($isHtml) 246 { 247 $MAIL_MIME->setHTMLBody($message_body); 248 249 // add a plain text version of the e-mail as an alternative part. 250 $h2t = new html2text($message_body); 251 $plainTextPart = $h2t->get_text(); 252 $MAIL_MIME->setTXTBody($plainTextPart); 253 254 // look for "emoticon" images from TinyMCE and copy into message as attachments 255 rcmail_attach_emoticons($MAIL_MIME); 256 } 257 else 258 { 259 $MAIL_MIME->setTXTBody($message_body, FALSE, TRUE); 260 } 190 261 191 262 -
trunk/roundcubemail/program/steps/settings/edit_identity.inc
r319 r344 43 43 function rcube_identity_form($attrib) 44 44 { 45 global $IDENTITY_RECORD, $JS_OBJECT_NAME; 45 global $IDENTITY_RECORD, $JS_OBJECT_NAME, $OUTPUT; 46 47 $OUTPUT->include_script('tiny_mce/tiny_mce_src.js'); 48 $OUTPUT->add_script("tinyMCE.init({ mode : 'specific_textareas'," . 49 "apply_source_formatting : true," . 50 "theme : 'advanced'," . 51 "theme_advanced_toolbar_location : 'top'," . 52 "theme_advanced_toolbar_align : 'left'," . 53 "theme_advanced_buttons1 : 'bold,italic,underline,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,separator,outdent,indent,charmap,hr'," . 54 "theme_advanced_buttons2 : 'link,unlink,forecolor,fontselect,fontsizeselect'," . 55 "theme_advanced_buttons3 : '' });"); 46 56 47 57 if (!$IDENTITY_RECORD && $GLOBALS['_action']!='add-identity') … … 63 73 'reply-to' => array('type' => 'text', 'label' => 'replyto'), 64 74 'bcc' => array('type' => 'text'), 65 'signature' => array('type' => 'textarea'), 75 'signature' => array('type' => 'textarea', 'size' => "40", 'rows' => "6"), 76 'html_signature'=>array('type' => 'checkbox', 'label' => 'htmlsignature', 'onclick' => 'return rcmail.toggle_editor(this, \'_signature\');'), 66 77 'standard' => array('type' => 'checkbox', 'label' => 'setdefault')); 67 78 … … 88 99 { 89 100 $attrib['id'] = 'rcmfd_'.$col; 101 102 if (strlen($colprop['onclick'])) 103 $attrib['onclick'] = $colprop['onclick']; 104 else 105 unset($attrib['onclick']); 106 107 if ($col == 'signature') 108 { 109 $attrib['size'] = $colprop['size']; 110 $attrib['rows'] = $colprop['rows']; 111 $attrib['mce_editable'] = $IDENTITY_RECORD['html_signature'] ? "true" : "false"; 112 } 113 else 114 { 115 unset($attrib['size']); 116 unset($attrib['rows']); 117 unset($attrib['mce_editable']); 118 } 119 90 120 $label = strlen($colprop['label']) ? $colprop['label'] : $col; 91 121 $value = rcmail_get_edit_field($col, $IDENTITY_RECORD[$col], $attrib, $colprop['type']); -
trunk/roundcubemail/program/steps/settings/func.inc
r337 r344 148 148 $input_prettydate->show($CONFIG['prettydate']?1:0)); 149 149 150 // Show checkbox for HTML Editor 151 $field_id = 'rcmfd_htmleditor'; 152 $input_htmleditor = new checkbox(array('name' => '_htmleditor', 'id' => $field_id, 'value' => 1)); 153 $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 154 $field_id, 155 rep_specialchars_output(rcube_label('htmleditor')), 156 $input_htmleditor->show($CONFIG['htmleditor']?1:0)); 157 150 158 if (!empty($CONFIG['drafts_mbox'])) 151 159 { … … 169 177 170 178 171 172 179 function rcmail_identities_list($attrib) 173 180 { -
trunk/roundcubemail/program/steps/settings/save_identity.inc
r330 r344 20 20 */ 21 21 22 $a_save_cols = array('name', 'email', 'organization', 'reply-to', 'bcc', 'standard', 'signature' );22 $a_save_cols = array('name', 'email', 'organization', 'reply-to', 'bcc', 'standard', 'signature', 'html_signature'); 23 23 $a_html_cols = array('signature'); 24 24 $a_boolean_cols = array('standard', 'html_signature'); 25 25 26 26 // check input … … 47 47 $DB->quoteIdentifier($col), 48 48 $DB->quote(get_input_value($fname, RCUBE_INPUT_POST, in_array($col, $a_html_cols)))); 49 } 50 51 // set "off" values for checkboxes that were not checked, and therefore 52 // not included in the POST body. 53 foreach ($a_boolean_cols as $col) 54 { 55 $fname = '_' . $col; 56 if (!isset($_POST[$fname])) 57 { 58 $a_write_sql[] = sprintf("%s=0", $DB->quoteIdentifier($col)); 59 } 49 60 } 50 61 -
trunk/roundcubemail/program/steps/settings/save_prefs.inc
r337 r344 29 29 $a_user_prefs['pagesize'] = is_numeric($_POST['_pagesize']) ? (int)$_POST['_pagesize'] : $CONFIG['pagesize']; 30 30 $a_user_prefs['prefer_html'] = isset($_POST['_prefer_html']) ? TRUE : FALSE; 31 $a_user_prefs['htmleditor'] = isset($_POST['_htmleditor']) ? TRUE : FALSE; 31 32 $a_user_prefs['draft_autosave'] = isset($_POST['_draft_autosave']) ? intval($_POST['_draft_autosave']) : 0; 32 33 -
trunk/roundcubemail/skins/default/templates/compose.html
r281 r344 107 107 <roundcube:label name="charset" />: <roundcube:object name="charsetSelector" tabindex="8" /> 108 108 </td> 109 109 <td align="right"> 110 <roundcube:label name="editortype" />: <roundcube:object name="editorSelector" tabindex="9" /> 111 </td> 110 112 </tr></tbody></table> 111 113 -
trunk/roundcubemail/skins/default/templates/ldappublicsearch.html
r95 r344 23 23 id="ldappublicaddresslist" 24 24 cellspacing="0" 25 summary="L dapemail address list" />25 summary="LDAP email address list" /> 26 26 </div> 27 27
Note: See TracChangeset
for help on using the changeset viewer.
