Changeset 389 for trunk/expressoMail1_2
- Timestamp:
- 08/14/08 11:15:07 (16 years ago)
- Location:
- trunk/expressoMail1_2
- Files:
-
- 460 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/js/common_functions.js
r381 r389 455 455 456 456 function preferences_mail(){ 457 connector.loadScript("preferences"); 458 prefe.showList(); 457 if(preferences.type_signature && preferences.type_signature == 'html') { 458 location.href="preferences.php"; 459 } 460 else { 461 connector.loadScript("preferences"); 462 prefe.showList(); 463 } 459 464 } 460 465 -
trunk/expressoMail1_2/js/main.js
r352 r389 509 509 data.date_hour = Element('date_hour_' + border_ID).value; 510 510 } 511 511 var signature = preferences.type_signature == 'html' ? preferences.signature : preferences.signature.replace(/\n/g, "<br>"); 512 512 switch(type){ 513 513 case "reply_without_history": … … 519 519 // Insert the signature automaticaly at message body if use_signature preference is set 520 520 if (preferences.use_signature == "1"){ 521 body.contentWindow.document.write("<html><body bgcolor='#FFFFFF'>" + "<br>" + preferences.signature.replace(/\n/g, "<br>")+ "</body></html>");521 body.contentWindow.document.write("<html><body bgcolor='#FFFFFF'>" + "<br>" + signature + "</body></html>"); 522 522 } 523 523 else{ … … 548 548 // Insert the signature automaticaly at message body if use_signature preference is set 549 549 if (preferences.use_signature == "1") { 550 body.contentWindow.document.write("<html><body bgcolor='#FFFFFF'>" + "<br>" + preferences.signature.replace(/\n/g, "<br>")+ "</body></html>" + block_quoted_body + "</body></html>");550 body.contentWindow.document.write("<html><body bgcolor='#FFFFFF'>" + "<br>" + signature + "</body></html>" + block_quoted_body + "</body></html>"); 551 551 } 552 552 else { … … 593 593 // Insert the signature automaticaly at message body if use_signature preference is set 594 594 if (preferences.use_signature == "1") { 595 body.contentWindow.document.write("<html><body bgcolor='#FFFFFF'>" + "<br>" + preferences.signature.replace(/\n/g, "<br>")+ "</body></html>");595 body.contentWindow.document.write("<html><body bgcolor='#FFFFFF'>" + "<br>" + signature + "</body></html>"); 596 596 } 597 597 else { … … 638 638 // Insert the signature automaticaly at message body if use_signature preference is set 639 639 if (preferences.use_signature == "1") { 640 body.contentWindow.document.write("<html><body bgcolor='#FFFFFF'>" + "<br>" + preferences.signature.replace(/\n/g, "<br>")+ "</body></html>" + block_quoted_body + "</body></html>");640 body.contentWindow.document.write("<html><body bgcolor='#FFFFFF'>" + "<br>" + signature + "</body></html>" + block_quoted_body + "</body></html>"); 641 641 } 642 642 else { … … 686 686 // Insert the signature automaticaly at message body if use_signature preference is set 687 687 if (preferences.use_signature == "1") { 688 body.contentWindow.document.write("<html><body bgcolor='#FFFFFF'>" + "<br>" + preferences.signature.replace(/\n/g, "<br>")+ "</body></html>" + make_forward_body(data.body, data.to, data.date, data.subject, data.to_all, data.cc) + "</body></html>");688 body.contentWindow.document.write("<html><body bgcolor='#FFFFFF'>" + "<br>" + signature + "</body></html>" + make_forward_body(data.body, data.to, data.date, data.subject, data.to_all, data.cc) + "</body></html>"); 689 689 } 690 690 else { … … 719 719 // Insert the signature automaticaly at message body if use_signature preference is set 720 720 if (preferences.use_signature == "1") { 721 body.contentWindow.document.write("<html><body bgcolor='#FFFFFF'>" + "<br>" + preferences.signature.replace(/\n/g, "<br>")+ "</body></html>");721 body.contentWindow.document.write("<html><body bgcolor='#FFFFFF'>" + "<br>" + signature + "</body></html>"); 722 722 } 723 723 else { -
trunk/expressoMail1_2/js/rich_text_editor.js
r351 r389 207 207 var mainField = document.getElementById(this.editor).contentWindow; 208 208 mainField.focus(); 209 var signature = preferences.type_signature == 'html' ? preferences.signature : preferences.signature.replace(/\n/g, "<br>"); 209 210 if (command == 'signature'){ 210 211 if (is_ie){ … … 214 215 var rng = sel.createRange(); 215 216 if (rng!=null) 216 rng.pasteHTML(preferences.signature.replace(/\n/g, "<br>"));217 rng.pasteHTML(signature); 217 218 } 218 219 } 219 220 else{ 220 mainField.document.execCommand('inserthtml', false, preferences.signature.replace(/\n/g, "<br>"));221 mainField.document.execCommand('inserthtml', false, signature); 221 222 } 222 223 } -
trunk/expressoMail1_2/preferences.php
r385 r389 9 9 ); 10 10 11 11 12 include('../header.inc.php'); 12 include('inc/class.imap_functions.inc.php'); 13 include('inc/class.imap_functions.inc.php'); 14 include_once("inc/fckeditor.php"); 13 15 14 16 if (!$_POST['try_saved']) … … 69 71 else 70 72 $GLOBALS['phpgw']->template->set_var('text_signature',''); 71 73 74 if($GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['type_signature']){ 75 $GLOBALS['phpgw']->template->set_var('type_signature_option_'.$GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['type_signature'].'_selected','selected'); 76 $GLOBALS['phpgw']->template->set_var('type_signature_td_'.($GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['type_signature'] == 'html' ? 'text' : 'html'),'display:none'); 77 } 78 else{ 79 $GLOBALS['phpgw']->template->set_var('type_signature_option_text_selected','selected'); 80 $GLOBALS['phpgw']->template->set_var('type_signature_td_html','display:none'); 81 } 82 83 // BEGIN FCKEDITOR 84 $oFCKeditor = new FCKeditor('html_signature') ; 85 $oFCKeditor->BasePath = 'js/fckeditor/'; 86 $oFCKeditor->ToolbarSet = 'ExpressoLivre'; 87 if(is_array($GLOBALS['phpgw_info']['user']['preferences']['expressoMail'])) { 88 $oFCKeditor->Value = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['signature']; 89 } 90 // First Time: The user has no preferences. If the template file exists, then it loads a default signature. 91 // See signature_example.tpl 92 elseif(file_exists($GLOBALS['phpgw']->template->root.'/signature.tpl')){ 93 $filein = fopen($GLOBALS['phpgw']->template->root.'/signature.tpl',"r"); 94 while (!feof ($filein)) 95 $oFCKeditor->Value .= fgets($filein, 1024); 96 } 97 $oFCKeditor->Value = str_replace("{full_name}",$phpgw_info['user']['fullname'],$oFCKeditor->Value); 98 $oFCKeditor->Value = str_replace("{first_name}",$phpgw_info['user']['firstname'],$oFCKeditor->Value); 99 100 $GLOBALS['phpgw']->template->set_var('rtf_signature',$oFCKeditor->Create()); 101 $GLOBALS['phpgw']->template->set_var('text_signature',strip_tags($oFCKeditor->Value)); 102 // END FCKEDITOR 72 103 if ($GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['hide_folders']) 73 104 $GLOBALS['phpgw']->template->set_var('checked_menu','checked'); … … 138 169 else 139 170 $GLOBALS['phpgw']->preferences->add('expressoMail','signature',$_POST['signature']); 171 172 if ($GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['type_signature']) 173 $GLOBALS['phpgw']->preferences->change('expressoMail','type_signature',$_POST['type_signature']); 174 else 175 $GLOBALS['phpgw']->preferences->add('expressoMail','type_signature',$_POST['type_signature']); 140 176 141 177 if ($GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['hide_folders']) … … 196 232 $GLOBALS['phpgw']->template->set_var('medium',lang('Medium')); 197 233 $GLOBALS['phpgw']->template->set_var('normal',lang('Normal')); 234 $GLOBALS['phpgw']->template->set_var('simple_text',lang('Simple Text')); 235 $GLOBALS['phpgw']->template->set_var('html_text',lang('Rich Text')); 236 $GLOBALS['phpgw']->template->set_var('lang_config_signature',lang('Signature Configuration')); 237 $GLOBALS['phpgw']->template->set_var('lang_type_signature',lang('Signature type')); 198 238 $GLOBALS['phpgw']->template->set_var('big',lang('Big')); 199 239 $GLOBALS['phpgw']->template->set_var('lang_use_signature',lang('Insert signature automatically in new messages?')); 200 $GLOBALS['phpgw']->template->set_var('lang_signature',lang('Signature'));201 240 202 241 $boemailadmin = CreateObject('emailadmin.bo'); -
trunk/expressoMail1_2/templates/default/preferences.tpl
r325 r389 2 2 <center> 3 3 4 <table width=" 50%" border="0" cellspacing="2" cellpadding="2">4 <table width="65%" border="0" cellspacing="2" cellpadding="2"> 5 5 6 <form method="POST" action="{save_action}">6 <form method="POST" action="{save_action}" onSubmit="selectValues()"> 7 7 <input type="hidden" name="try_saved" value="false"> 8 9 8 <tr bgcolor="{th_bg}"> 10 9 <td colspan="2" align="center">{lang_config_expressoMail}</td> … … 99 98 </tr> 100 99 101 <tr bgcolor="{tr_color 1}">100 <tr bgcolor="{tr_color2}"> 102 101 <td> 103 102 {lang_auto_save_draft} … … 107 106 </td> 108 107 </tr> 109 108 <tr bgcolor="{th_bg}"> 109 <td colspan="2" align="center">{lang_config_signature}</td> 110 </tr> 110 111 <tr bgcolor="{tr_color1}"> 111 112 <td> … … 116 117 </td> 117 118 </tr> 118 119 119 <tr bgcolor="{tr_color2}"> 120 <td colspan='2'> 121 {lang_signature}<BR> 122 <textarea name="signature" rows=4 cols=50>{text_signature}</textarea> 120 <td valign="center"> 121 {lang_type_signature} 122 </td> 123 <td align="center"> 124 <select id="type_signature" name="type_signature" onChange="javascript:changeTypeSignature(this.value)"> 125 <option {type_signature_option_text_selected} value="text">{simple_text}</option> 126 <option {type_signature_option_html_selected} value="html">{html_text}</option> 127 </select> 128 </td> 129 </tr> 130 <tr bgcolor="{tr_color2}"> 131 <td colspan='2' valign="center" id="td_html_signature" style="{type_signature_td_html}"> 132 {rtf_signature} 123 133 </td> 124 134 </tr> 125 135 <tr bgcolor="{tr_color2}"> 136 <td colspan='2' align="center" id="td_text_signature" style="{type_signature_td_text}"> 137 <textarea name='text_signature' rows='4' cols='70'>{text_signature}</textarea> 138 </td> 139 </tr> 126 140 <tr bgcolor="{th_bg}"> 127 141 <td colspan="2" > … … 140 154 </table> 141 155 </center> 156 <script language="JavaScript" type="text/javascript"> 157 var form = document.forms[0]; 158 159 function selectValues(){ 160 var signature = eval("form."+form.type_signature.value+"_signature"); 161 signature.name = "signature"; 162 return true; 163 } 164 165 function changeTypeSignature(value){ 166 var html_signature = FCKeditorAPI.GetInstance("html_signature"); 167 168 if(value == 'text'){ 169 form.text_signature.value = html_signature.GetHTML(); 170 document.getElementById("td_text_signature").style.display = ''; 171 document.getElementById("td_html_signature").style.display = 'none'; 172 } 173 else if(value == 'html'){ 174 html_signature.SetHTML(form.text_signature.value); 175 document.getElementById("td_text_signature").style.display = 'none'; 176 document.getElementById("td_html_signature").style.display = ''; 177 } 178 179 } 180 </script>
Note: See TracChangeset
for help on using the changeset viewer.