[873] | 1 | <?php |
---|
[1037] | 2 | if(!isset($GLOBALS['phpgw_info'])){ |
---|
[1036] | 3 | $GLOBALS['phpgw_info']['flags'] = array( |
---|
| 4 | 'currentapp' => 'expressoMail1_2', |
---|
| 5 | 'nonavbar' => true, |
---|
| 6 | 'noheader' => true |
---|
| 7 | ); |
---|
[1037] | 8 | } |
---|
[1040] | 9 | require_once '../header.inc.php'; |
---|
[1036] | 10 | |
---|
[873] | 11 | /**************************************************************************\ |
---|
| 12 | * eGroupWare - ExpressoMail Preferences * |
---|
| 13 | * http://www.expressolivre.org * |
---|
| 14 | * Modified by Alexandre Felipe Muller de Souza <amuller@celepar.pr.gov.br> * |
---|
| 15 | * -------------------------------------------- * |
---|
| 16 | * This program is free software; you can redistribute it and/or modify it * |
---|
| 17 | * under the terms of the GNU General Public License as published by the * |
---|
| 18 | * Free Software Foundation; either version 2 of the License, or (at your * |
---|
| 19 | * option) any later version. * |
---|
| 20 | \**************************************************************************/ |
---|
| 21 | include_once("fckeditor.php"); |
---|
| 22 | $type = $_GET['type']; // FIX ME |
---|
| 23 | |
---|
[1035] | 24 | //if ($type == 'user' || $type == ''){ |
---|
[1053] | 25 | create_html_code("script", '<script language="JavaScript" type="text/javascript"> |
---|
[1035] | 26 | function exibir_ocultar() |
---|
| 27 | { |
---|
| 28 | var type = ("'.$type.'" == "") ? "user" : "'.$type.'"; |
---|
| 29 | var use_signature_digital_cripto = document.getElementsByName(type+"[use_signature_digital_cripto]")[0]; |
---|
| 30 | var default_signature_digital_cripto = "'.$GLOBALS['phpgw_info']['default']['preferences']['expressoMail']['use_signature_digital_cripto'].'"; |
---|
| 31 | |
---|
| 32 | if (use_signature_digital_cripto) |
---|
| 33 | { |
---|
| 34 | var element_signature_digital = document.getElementById(type+"[use_signature_digital]"); |
---|
| 35 | var element_signature_cripto = document.getElementById(type+"[use_signature_cripto]"); |
---|
| 36 | |
---|
| 37 | switch (use_signature_digital_cripto[use_signature_digital_cripto.selectedIndex].value){ |
---|
| 38 | |
---|
| 39 | case "1": |
---|
| 40 | element_signature_digital.style.display=""; |
---|
| 41 | element_signature_cripto.style.display=""; |
---|
| 42 | break; |
---|
| 43 | case "0": |
---|
| 44 | element_signature_digital.style.display="none"; |
---|
| 45 | element_signature_cripto.style.display="none"; |
---|
| 46 | break; |
---|
| 47 | case "": |
---|
| 48 | if (default_signature_digital_cripto){ |
---|
| 49 | element_signature_digital.style.display=""; |
---|
| 50 | element_signature_cripto.style.display=""; |
---|
| 51 | } |
---|
| 52 | else |
---|
| 53 | { |
---|
| 54 | element_signature_digital.style.display="none"; |
---|
| 55 | element_signature_cripto.style.display="none"; |
---|
| 56 | } |
---|
| 57 | |
---|
| 58 | } |
---|
| 59 | |
---|
| 60 | } |
---|
| 61 | |
---|
[1053] | 62 | }', |
---|
[1035] | 63 | |
---|
[1053] | 64 | '</script>'); |
---|
[1035] | 65 | //} |
---|
| 66 | |
---|
[873] | 67 | $default = array( |
---|
| 68 | '25' => '25', |
---|
| 69 | '50' => '50', |
---|
| 70 | '75' => '75', |
---|
| 71 | '100' => '100' |
---|
| 72 | ); |
---|
| 73 | |
---|
[1035] | 74 | create_select_box('What is the maximum number of messages per page?','max_email_per_page',$default, |
---|
[873] | 75 | 'What is the maximum number of messages per page?'); |
---|
[1035] | 76 | create_check_box('Save deleted messages in trash folder?','save_deleted_msg','Save deleted messages in trash folder?'); |
---|
[873] | 77 | $default = array( |
---|
| 78 | '1' => lang('1 day'), |
---|
| 79 | '2' => lang('2 days'), |
---|
| 80 | '3' => lang('3 days'), |
---|
| 81 | '4' => lang('4 days'), |
---|
| 82 | '5' => lang('5 days') |
---|
| 83 | ); |
---|
| 84 | |
---|
[1035] | 85 | create_select_box('Delete trash messages after how many days?','delete_trash_messages_after_n_days',$default,lang('Delete trash messages after how many days?')); |
---|
| 86 | create_check_box('Would you like to use local messages?','use_local_messages',''); |
---|
| 87 | create_check_box('Would you like to keep archived messages?','keep_archived_messages',''); |
---|
| 88 | create_check_box('Show previous message, after delete actual message?','delete_and_show_previous_message',''); |
---|
| 89 | create_check_box('Do you wanna receive an alert for new messages?','alert_new_msg',''); |
---|
| 90 | create_check_box('Show default view on main screen?','mainscreen_showmail',''); |
---|
| 91 | create_check_box('Do you want to use remove attachments function?','remove_attachments_function',''); |
---|
| 92 | create_check_box('Do you want to use important flag in email editor?','enable_important_flag',''); |
---|
[873] | 93 | |
---|
| 94 | //TODO use default folders from email admin |
---|
| 95 | $default = array( |
---|
| 96 | 'INBOX' => lang('INBOX'), |
---|
| 97 | 'INBOX/'.lang('Drafts') => lang('Drafts'), |
---|
| 98 | 'INBOX/'.lang('Sent') => lang('Sent'), |
---|
| 99 | 'INBOX/'.lang('Trash') => lang('Trash') |
---|
| 100 | ); |
---|
[1035] | 101 | create_select_box('Save sent messages in folder','save_in_folder',$default,''); |
---|
[1217] | 102 | create_check_box('Hide menu folders?','hide_folders',''); |
---|
[873] | 103 | |
---|
| 104 | $default = array( |
---|
| 105 | '20' => lang('normal'), |
---|
| 106 | '30' => lang('medium'), |
---|
| 107 | '40' => lang('big') |
---|
| 108 | ); |
---|
| 109 | |
---|
[1035] | 110 | create_select_box('What is the height of the lines in the list of messages?','line_height',$default,''); |
---|
[873] | 111 | $default = array( |
---|
| 112 | '10' => lang('small'), |
---|
| 113 | '11' => lang('normal'), |
---|
| 114 | '15' => lang('big') |
---|
| 115 | ); |
---|
| 116 | |
---|
[1035] | 117 | create_select_box('What the font size in the list of messages?','font_size',$default,''); |
---|
| 118 | create_check_box('Use dynamic contacts?','use_dynamic_contacts',''); |
---|
[1203] | 119 | create_check_box('Use shortcuts?','use_shortcuts',''); |
---|
[1035] | 120 | create_check_box('Auto save draft','auto_save_draft',''); |
---|
[1005] | 121 | $default = array( |
---|
| 122 | '65536' => lang('unlimited'), |
---|
| 123 | '640' => '640', |
---|
| 124 | '768' => '768', |
---|
| 125 | '800' => '800', |
---|
| 126 | '1024' => '1024', |
---|
| 127 | '1080' => '1080' |
---|
| 128 | ); |
---|
[873] | 129 | |
---|
[1035] | 130 | create_select_box('What is the maximum size of embedded images'."?",'image_size',$default,''); |
---|
[1005] | 131 | |
---|
[1035] | 132 | if($GLOBALS['phpgw_info']['server']['use_assinar_criptografar']) |
---|
| 133 | { |
---|
| 134 | create_check_box('Enable digitally sign/cipher the message?','use_signature_digital_cripto','','',True,'onchange="javascript:exibir_ocultar();"'); |
---|
| 135 | if ($GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_signature_digital_cripto']) |
---|
| 136 | { |
---|
| 137 | create_check_box('Always sign message digitally?','use_signature_digital',''); |
---|
| 138 | create_check_box('Always cipher message digitally?','use_signature_cripto',''); |
---|
| 139 | } |
---|
| 140 | else |
---|
| 141 | { |
---|
| 142 | create_check_box('Always sign message digitally?','use_signature_digital','','',True,'',False); |
---|
| 143 | create_check_box('Always cipher message digitally?','use_signature_cripto','','',True,'',False); |
---|
| 144 | } |
---|
| 145 | } |
---|
| 146 | |
---|
[873] | 147 | $default = array( |
---|
| 148 | 'text' => lang('simple text'), |
---|
| 149 | 'html' => lang('rich text') |
---|
| 150 | ); |
---|
| 151 | |
---|
[1035] | 152 | create_select_box('Signature Type','type_signature',$default,'','','','onchange="javascript:changeType(this.value);" onload="javascript:alert(this.value);"'); |
---|
[873] | 153 | |
---|
[874] | 154 | if ($type == 'user' || $type == ''){ |
---|
[873] | 155 | $oFCKeditor = new FCKeditor('html_signature'); |
---|
| 156 | $oFCKeditor->BasePath = '../expressoMail1_2/js/fckeditor/'; |
---|
| 157 | $oFCKeditor->ToolbarSet = 'ExpressoLivre'; |
---|
| 158 | |
---|
| 159 | $vars = $GLOBALS['phpgw']->preferences->user[$appname]; |
---|
| 160 | |
---|
[1002] | 161 | create_html_code("signature","<div id='text_signature'> |
---|
[1134] | 162 | <textarea rows='5' cols='50' id='user_signature' name='user[signature]'>","</textarea></div> |
---|
[873] | 163 | <div style='display:none;' id='html_signature'>".$oFCKeditor->Create()."</div> |
---|
| 164 | <script language='javascript'> |
---|
[1134] | 165 | document.getElementById('user_signature').value = '".$vars['signature']."'; |
---|
[873] | 166 | function changeType(value){ |
---|
| 167 | var html_signature = FCKeditorAPI.GetInstance(\"html_signature\"); |
---|
| 168 | if(value == 'text'){ |
---|
[1134] | 169 | document.getElementById('user_signature').value = html_signature.GetHTML(); |
---|
[873] | 170 | document.getElementById(\"text_signature\").style.display = ''; |
---|
| 171 | document.getElementById(\"html_signature\").style.display = 'none'; |
---|
[1002] | 172 | } |
---|
[1244] | 173 | else if(value == 'html'){ |
---|
[1134] | 174 | html_signature.SetHTML(document.getElementById('user_signature').value); |
---|
[1002] | 175 | document.getElementById(\"text_signature\").style.display = 'none'; |
---|
| 176 | document.getElementById(\"html_signature\").style.display = ''; |
---|
| 177 | } |
---|
[873] | 178 | } |
---|
[1244] | 179 | function get_html_translation_table(table, quote_style) { |
---|
| 180 | // http://kevin.vanzonneveld.net |
---|
| 181 | var entities = {}, hash_map = {}, decimal = 0, symbol = ''; |
---|
| 182 | var constMappingTable = {}, constMappingQuoteStyle = {}; |
---|
| 183 | var useTable = {}, useQuoteStyle = {}; |
---|
| 184 | // Translate arguments |
---|
| 185 | constMappingTable[0] = 'HTML_SPECIALCHARS'; |
---|
| 186 | constMappingTable[1] = 'HTML_ENTITIES'; |
---|
| 187 | constMappingQuoteStyle[0] = 'ENT_NOQUOTES'; |
---|
| 188 | constMappingQuoteStyle[2] = 'ENT_COMPAT'; |
---|
| 189 | constMappingQuoteStyle[3] = 'ENT_QUOTES'; |
---|
| 190 | |
---|
| 191 | useTable = !isNaN(table) ? constMappingTable[table] : table ? table.toUpperCase() : 'HTML_SPECIALCHARS'; |
---|
| 192 | useQuoteStyle = !isNaN(quote_style) ? constMappingQuoteStyle[quote_style] : quote_style ? quote_style.toUpperCase() : 'ENT_COMPAT'; |
---|
| 193 | |
---|
| 194 | if (useTable !== 'HTML_SPECIALCHARS' && useTable !== 'HTML_ENTITIES') { |
---|
| 195 | throw new Error(\"Table: \"+useTable+' not supported'); |
---|
| 196 | // return false; |
---|
| 197 | } |
---|
| 198 | |
---|
| 199 | entities['38'] = '&'; |
---|
| 200 | if (useTable === 'HTML_ENTITIES') { |
---|
| 201 | entities['160'] = ' '; |
---|
| 202 | entities['161'] = '¡'; |
---|
| 203 | entities['162'] = '¢'; |
---|
| 204 | entities['163'] = '£'; |
---|
| 205 | entities['164'] = '¤'; |
---|
| 206 | entities['165'] = '¥'; |
---|
| 207 | entities['166'] = '¦'; |
---|
| 208 | entities['167'] = '§'; |
---|
| 209 | entities['168'] = '¨'; |
---|
| 210 | entities['169'] = '©'; |
---|
| 211 | entities['170'] = 'ª'; |
---|
| 212 | entities['171'] = '«'; |
---|
| 213 | entities['172'] = '¬'; |
---|
| 214 | entities['173'] = '­'; |
---|
| 215 | entities['174'] = '®'; |
---|
| 216 | entities['175'] = '¯'; |
---|
| 217 | entities['176'] = '°'; |
---|
| 218 | entities['177'] = '±'; |
---|
| 219 | entities['178'] = '²'; |
---|
| 220 | entities['179'] = '³'; |
---|
| 221 | entities['180'] = '´'; |
---|
| 222 | entities['181'] = 'µ'; |
---|
| 223 | entities['182'] = '¶'; |
---|
| 224 | entities['183'] = '·'; |
---|
| 225 | entities['184'] = '¸'; |
---|
| 226 | entities['185'] = '¹'; |
---|
| 227 | entities['186'] = 'º'; |
---|
| 228 | entities['187'] = '»'; |
---|
| 229 | entities['188'] = '¼'; |
---|
| 230 | entities['189'] = '½'; |
---|
| 231 | entities['190'] = '¾'; |
---|
| 232 | entities['191'] = '¿'; |
---|
| 233 | entities['192'] = 'À'; |
---|
| 234 | entities['193'] = 'Á'; |
---|
| 235 | entities['194'] = 'Â'; |
---|
| 236 | entities['195'] = 'Ã'; |
---|
| 237 | entities['196'] = 'Ä'; |
---|
| 238 | entities['197'] = 'Å'; |
---|
| 239 | entities['198'] = 'Æ'; |
---|
| 240 | entities['199'] = 'Ç'; |
---|
| 241 | entities['200'] = 'È'; |
---|
| 242 | entities['201'] = 'É'; |
---|
| 243 | entities['202'] = 'Ê'; |
---|
| 244 | entities['203'] = 'Ë'; |
---|
| 245 | entities['204'] = 'Ì'; |
---|
| 246 | entities['205'] = 'Í'; |
---|
| 247 | entities['206'] = 'Î'; |
---|
| 248 | entities['207'] = 'Ï'; |
---|
| 249 | entities['208'] = 'Ð'; |
---|
| 250 | entities['209'] = 'Ñ'; |
---|
| 251 | entities['210'] = 'Ò'; |
---|
| 252 | entities['211'] = 'Ó'; |
---|
| 253 | entities['212'] = 'Ô'; |
---|
| 254 | entities['213'] = 'Õ'; |
---|
| 255 | entities['214'] = 'Ö'; |
---|
| 256 | entities['215'] = '×'; |
---|
| 257 | entities['216'] = 'Ø'; |
---|
| 258 | entities['217'] = 'Ù'; |
---|
| 259 | entities['218'] = 'Ú'; |
---|
| 260 | entities['219'] = 'Û'; |
---|
| 261 | entities['220'] = 'Ü'; |
---|
| 262 | entities['221'] = 'Ý'; |
---|
| 263 | entities['222'] = 'Þ'; |
---|
| 264 | entities['223'] = 'ß'; |
---|
| 265 | entities['224'] = 'à'; |
---|
| 266 | entities['225'] = 'á'; |
---|
| 267 | entities['226'] = 'â'; |
---|
| 268 | entities['227'] = 'ã'; |
---|
| 269 | entities['228'] = 'ä'; |
---|
| 270 | entities['229'] = 'å'; |
---|
| 271 | entities['230'] = 'æ'; |
---|
| 272 | entities['231'] = 'ç'; |
---|
| 273 | entities['232'] = 'è'; |
---|
| 274 | entities['233'] = 'é'; |
---|
| 275 | entities['234'] = 'ê'; |
---|
| 276 | entities['235'] = 'ë'; |
---|
| 277 | entities['236'] = 'ì'; |
---|
| 278 | entities['237'] = 'í'; |
---|
| 279 | entities['238'] = 'î'; |
---|
| 280 | entities['239'] = 'ï'; |
---|
| 281 | entities['240'] = 'ð'; |
---|
| 282 | entities['241'] = 'ñ'; |
---|
| 283 | entities['242'] = 'ò'; |
---|
| 284 | entities['243'] = 'ó'; |
---|
| 285 | entities['244'] = 'ô'; |
---|
| 286 | entities['245'] = 'õ'; |
---|
| 287 | entities['246'] = 'ö'; |
---|
| 288 | entities['247'] = '÷'; |
---|
| 289 | entities['248'] = 'ø'; |
---|
| 290 | entities['249'] = 'ù'; |
---|
| 291 | entities['250'] = 'ú'; |
---|
| 292 | entities['251'] = 'û'; |
---|
| 293 | entities['252'] = 'ü'; |
---|
| 294 | entities['253'] = 'ý'; |
---|
| 295 | entities['254'] = 'þ'; |
---|
| 296 | entities['255'] = 'ÿ'; |
---|
| 297 | } |
---|
| 298 | if (useQuoteStyle !== 'ENT_NOQUOTES') { |
---|
| 299 | entities['34'] = '"'; |
---|
| 300 | } |
---|
| 301 | if (useQuoteStyle === 'ENT_QUOTES') { |
---|
| 302 | entities['39'] = '''; |
---|
| 303 | } |
---|
| 304 | entities['60'] = '<'; |
---|
| 305 | entities['62'] = '>'; |
---|
| 306 | |
---|
| 307 | // ascii decimals to real symbols |
---|
| 308 | for (decimal in entities) { |
---|
| 309 | symbol = String.fromCharCode(decimal); |
---|
| 310 | hash_map[symbol] = entities[decimal]; |
---|
| 311 | } |
---|
| 312 | return hash_map; |
---|
| 313 | } |
---|
| 314 | function html_entity_decode( string, quote_style ) { |
---|
| 315 | // http://kevin.vanzonneveld.net |
---|
| 316 | var hash_map = {}, symbol = '', tmp_str = '', entity = ''; |
---|
| 317 | tmp_str = string.toString(); |
---|
| 318 | if (false === (hash_map = this.get_html_translation_table('HTML_ENTITIES', quote_style))) { |
---|
| 319 | return false; |
---|
| 320 | } |
---|
| 321 | for (symbol in hash_map) { |
---|
| 322 | entity = hash_map[symbol]; |
---|
| 323 | tmp_str = tmp_str.split(entity).join(symbol); |
---|
| 324 | } |
---|
| 325 | tmp_str = tmp_str.split(''').join(\"'\"); |
---|
| 326 | return tmp_str; |
---|
| 327 | } |
---|
| 328 | |
---|
| 329 | function config_form(pObj,pHandler) |
---|
| 330 | { |
---|
| 331 | pObj.onclick=function () { return pHandler(\"text\") }; |
---|
| 332 | } |
---|
| 333 | document.getElementById('user_signature').value=html_entity_decode(document.getElementById('user_signature').innerHTML); |
---|
| 334 | |
---|
| 335 | setTimeout('config_form(document.getElementsByName(\'submit\')[0],changeType);changeType(document.getElementsByName(\'user[type_signature]\')[0].value==\'html\'?\'html\':\'\')',2000); |
---|
[873] | 336 | </script>"); |
---|
| 337 | } |
---|
| 338 | ?> |
---|