diff --git a/CHANGELOG b/CHANGELOG index e683252f3..debca4992 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,12 @@ CHANGELOG RoundCube Webmail --------------------------- +2006/09/13 (estadtherr) +---------- +- Introduction of TinyMCE HTML editor support for message composition and signatures + Note : a new column is added to the "identities" database table + + 2006/09/12 (estadtherr) ---------- - Fixed html2text treatment of table headers (Bug #1484020) diff --git a/SQL/mysql.initial.sql b/SQL/mysql.initial.sql index 716268b1a..f49fd7084 100644 --- a/SQL/mysql.initial.sql +++ b/SQL/mysql.initial.sql @@ -58,6 +58,7 @@ CREATE TABLE `identities` ( `reply-to` varchar(128) NOT NULL default '', `bcc` varchar(128) NOT NULL default '', `signature` text NOT NULL, + `html_signature` tinyint(1) NOT NULL default '0', PRIMARY KEY (`identity_id`), KEY `user_id` (`user_id`) ); diff --git a/SQL/mysql.update.sql b/SQL/mysql.update.sql index cfd5af361..b16f2555f 100644 --- a/SQL/mysql.update.sql +++ b/SQL/mysql.update.sql @@ -7,3 +7,5 @@ ALTER TABLE `messages` ADD `structure` TEXT, ADD UNIQUE `uniqueness` (`cache_key`, `uid`); +ALTER TABLE 'identities' + ADD 'html_signature' tinyint(1) default 0 NOT NULL; diff --git a/SQL/mysql5.initial.sql b/SQL/mysql5.initial.sql index 24e143119..ee6fc3352 100644 --- a/SQL/mysql5.initial.sql +++ b/SQL/mysql5.initial.sql @@ -114,6 +114,7 @@ CREATE TABLE `identities` ( `reply-to` varchar(128) NOT NULL, `bcc` varchar(128) NOT NULL, `signature` text NOT NULL, + `html_signature` tinyint(1) NOT NULL DEFAULT '0', `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0', PRIMARY KEY(`identity_id`), CONSTRAINT `User_ID_FK_identities` FOREIGN KEY (`user_id`) @@ -123,4 +124,4 @@ CREATE TABLE `identities` ( ) TYPE=MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci; -SET FOREIGN_KEY_CHECKS=1; \ No newline at end of file +SET FOREIGN_KEY_CHECKS=1; diff --git a/SQL/postgres.initial.sql b/SQL/postgres.initial.sql index 029afaab3..ebd504d0d 100755 --- a/SQL/postgres.initial.sql +++ b/SQL/postgres.initial.sql @@ -69,7 +69,8 @@ CREATE TABLE identities ( email character varying(128) NOT NULL, "reply-to" character varying(128), bcc character varying(128), - signature text + signature text, + html_signature integer DEFAULT 0 NOT NULL ); diff --git a/SQL/postgres.update.sql b/SQL/postgres.update.sql index 6ca855edc..2ad60298f 100644 --- a/SQL/postgres.update.sql +++ b/SQL/postgres.update.sql @@ -5,3 +5,5 @@ ALTER TABLE "messages" DROP body; ALTER TABLE "messages" ADD structure TEXT; ALTER TABLE "messages" ADD UNIQUE (cache_key, uid); +ALTER TABLE "identities" ADD html_signature integer DEFAULT 0 NOT NULL; + diff --git a/SQL/sqlite.initial.sql b/SQL/sqlite.initial.sql index 4ddc40d5d..5be69785a 100644 --- a/SQL/sqlite.initial.sql +++ b/SQL/sqlite.initial.sql @@ -58,7 +58,8 @@ CREATE TABLE identities ( email varchar(128) NOT NULL default '', "reply-to" varchar(128) NOT NULL default '', bcc varchar(128) NOT NULL default '', - signature text NOT NULL default '' + signature text NOT NULL default '', + html_signature tinyint NOT NULL default '0' ); CREATE INDEX ix_identities_user_id ON identities(user_id); diff --git a/index.php b/index.php index 85a9eefef..4e9dee1c7 100644 --- a/index.php +++ b/index.php @@ -81,6 +81,7 @@ require_once('include/rcube_imap.inc'); require_once('include/bugs.inc'); require_once('include/main.inc'); require_once('include/cache.inc'); +require_once('lib/html2text.inc'); require_once('PEAR.php'); @@ -145,6 +146,21 @@ if ($_action=='error' && !empty($_GET['_code'])) raise_error(array('code' => hexdec($_GET['_code'])), FALSE, TRUE); } +// handle HTML->text conversion +if ($_action=='html2text') + { + $htmlText = $HTTP_RAW_POST_DATA; + $converter = new html2text($htmlText); + + // TODO possibly replace with rcube_remote_response() + send_nocacheing_headers(); + header('Content-Type: text/plain'); + $plaintext = $converter->get_text(); + print $plaintext; + + exit; + } + // try to log in if ($_action=='login' && $_task=='mail') @@ -241,7 +257,6 @@ if ($_action=='keep-alive') exit; } - // include task specific files if ($_task=='mail') { diff --git a/program/include/bugs.inc b/program/include/bugs.inc index 771f1aeda..bf4c572c8 100644 --- a/program/include/bugs.inc +++ b/program/include/bugs.inc @@ -115,5 +115,19 @@ function log_bug($arg_arr) } } +function log_debug($filename, $text) +{ + global $CONFIG, $INSTALL_PATH; + + if (empty($CONFIG['log_dir'])) + $CONFIG['log_dir'] = $INSTALL_PATH.'logs'; + + // try to open specific log file for writing + if ($fp = @fopen($CONFIG['log_dir'].'/'.$filename, 'a')) + { + fwrite($fp, date("d-M-Y H:i:s", mktime()) . ' ' . $text . "\n"); + fclose($fp); + } +} ?> \ No newline at end of file diff --git a/program/include/main.inc b/program/include/main.inc index 02f5b5713..bbda83aa7 100644 --- a/program/include/main.inc +++ b/program/include/main.inc @@ -375,7 +375,7 @@ function load_gui() // don't wait for page onload. Call init at the bottom of the page (delayed) $javascript_foot = "if (window.call_init)\n call_init('$JS_OBJECT_NAME');"; - + if (!empty($GLOBALS['_framed'])) $javascript .= "$JS_OBJECT_NAME.set_env('framed', true);\n"; @@ -1197,6 +1197,7 @@ function rcube_xml_command($command, $str_attrib, $add_attrib=array()) 'composeattachment' => 'rcmail_compose_attachment_field', 'priorityselector' => 'rcmail_priority_selector', 'charsetselector' => 'rcmail_charset_selector', + 'editorselector' => 'rcmail_editor_selector', 'searchform' => 'rcmail_search_form', 'receiptcheckbox' => 'rcmail_receipt_checkbox', @@ -1279,8 +1280,7 @@ function rcube_button($attrib) if ($attrib['type']) $attrib['type'] = strtolower($attrib['type']); else - $attrib['type'] = ($attrib['image'] || $attrib['imagepas'] || $arg['imageact']) ? 'image' : 'link'; - + $attrib['type'] = ($attrib['image'] || $attrib['imagepas'] || $attrib['imageact']) ? 'image' : 'link'; $command = $attrib['command']; @@ -1289,7 +1289,7 @@ function rcube_button($attrib) $attrib = $sa_buttons[$attrib['name']]; // add button to button stack - else if($attrib['image'] || $arg['imageact'] || $attrib['imagepas'] || $attrib['class']) + else if($attrib['image'] || $attrib['imageact'] || $attrib['imagepas'] || $attrib['class']) { if(!$attrib['name']) $attrib['name'] = $command; @@ -1487,7 +1487,15 @@ function rcube_table_output($attrib, $table_data, $a_show_cols, $id_col) } - +/** + * Create an edit field for inclusion on a form + * + * @param string col field name + * @param string value field value + * @param array attrib HTML element attributes for field + * @param string type HTML element type (default 'text') + * @return string HTML field definition + */ function rcmail_get_edit_field($col, $value, $attrib, $type='text') { $fname = '_'.$col; diff --git a/program/include/rcube_shared.inc b/program/include/rcube_shared.inc index af4c295dd..11af48205 100644 --- a/program/include/rcube_shared.inc +++ b/program/include/rcube_shared.inc @@ -28,13 +28,15 @@ class rcube_html_page var $scripts_path = ''; var $script_files = array(); + var $external_scripts = array(); var $scripts = array(); var $charset = 'ISO-8859-1'; var $script_tag_file = "\n"; var $script_tag = "\n"; var $default_template = "\n