[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 | \**************************************************************************/ |
---|
[5134] | 21 | //include_once("fckeditor.php"); |
---|
| 22 | //include_once("class.functions.inc.php"); |
---|
[4885] | 23 | $type = isset($_GET['type']) ? $_GET['type']:$GLOBALS['type']; // FIX ME |
---|
[4828] | 24 | |
---|
[1035] | 25 | //if ($type == 'user' || $type == ''){ |
---|
[5134] | 26 | global $prefs; |
---|
| 27 | // create_select_box('Signature Type','',$default,'','','','onchange="javascript:changeType(this.value);"'); |
---|
[1405] | 28 | create_script('function exibir_ocultar() |
---|
[1035] | 29 | { |
---|
| 30 | var type = ("'.$type.'" == "") ? "user" : "'.$type.'"; |
---|
[5134] | 31 | var use_signature_digital_cripto = null; |
---|
| 32 | |
---|
| 33 | if (document.all) |
---|
| 34 | { |
---|
| 35 | // is_ie |
---|
| 36 | use_signature_digital_cripto = document.getElementsByName(type+"[use_signature_digital_cripto]")[1]; |
---|
| 37 | } |
---|
| 38 | else |
---|
| 39 | { |
---|
| 40 | // not_ie |
---|
| 41 | use_signature_digital_cripto = document.getElementsByName(type+"[use_signature_digital_cripto]")[0]; |
---|
| 42 | } |
---|
| 43 | |
---|
[1035] | 44 | var default_signature_digital_cripto = "'.$GLOBALS['phpgw_info']['default']['preferences']['expressoMail']['use_signature_digital_cripto'].'"; |
---|
| 45 | |
---|
| 46 | if (use_signature_digital_cripto) |
---|
| 47 | { |
---|
| 48 | var element_signature_digital = document.getElementById(type+"[use_signature_digital]"); |
---|
| 49 | var element_signature_cripto = document.getElementById(type+"[use_signature_cripto]"); |
---|
| 50 | |
---|
| 51 | switch (use_signature_digital_cripto[use_signature_digital_cripto.selectedIndex].value){ |
---|
| 52 | |
---|
| 53 | case "1": |
---|
| 54 | element_signature_digital.style.display=""; |
---|
| 55 | element_signature_cripto.style.display=""; |
---|
| 56 | break; |
---|
| 57 | case "0": |
---|
| 58 | element_signature_digital.style.display="none"; |
---|
| 59 | element_signature_cripto.style.display="none"; |
---|
| 60 | break; |
---|
| 61 | case "": |
---|
| 62 | if (default_signature_digital_cripto){ |
---|
| 63 | element_signature_digital.style.display=""; |
---|
| 64 | element_signature_cripto.style.display=""; |
---|
| 65 | } |
---|
| 66 | else |
---|
| 67 | { |
---|
| 68 | element_signature_digital.style.display="none"; |
---|
| 69 | element_signature_cripto.style.display="none"; |
---|
| 70 | } |
---|
| 71 | |
---|
| 72 | } |
---|
| 73 | |
---|
| 74 | } |
---|
| 75 | |
---|
[4828] | 76 | } |
---|
| 77 | function validateSignature() |
---|
| 78 | { |
---|
| 79 | var sigs_len = parseInt( document.getElementById("counter").value ); |
---|
| 80 | |
---|
| 81 | var signatures = {}, types = {}, noSig = true; |
---|
| 82 | |
---|
| 83 | var default_signature = "", errors = false; |
---|
| 84 | |
---|
| 85 | for( var i = 0; i < sigs_len; i++ ) |
---|
| 86 | { |
---|
| 87 | if( !document.getElementById( "_signature" + i ) ) continue; |
---|
| 88 | |
---|
[8077] | 89 | var key = encode64(document.getElementById( "title_signature" + i ).value); |
---|
[4828] | 90 | var edit = !!document.getElementById( "edit_signature" + i ).checked; |
---|
| 91 | |
---|
[5083] | 92 | var value = edit ? CKEDITOR.instances["user_signature" + i ].getData() : |
---|
[4828] | 93 | document.getElementById( "user_signature" + i ).value; |
---|
| 94 | |
---|
| 95 | if( !value ) |
---|
| 96 | continue; |
---|
| 97 | |
---|
| 98 | if( !key ) |
---|
| 99 | { |
---|
| 100 | alert( "Titulo da assinatura nao pode ser em branco." ); |
---|
| 101 | return( false ); |
---|
| 102 | } |
---|
| 103 | |
---|
| 104 | var openTags = value.match(/<[a-z][^&>]*>/g); |
---|
| 105 | var closedTags = value.match(/<[/][^&>]*>/g); |
---|
| 106 | var oclosedTags = value.match(/[a-z]*[^&<>]* [/]>/g); |
---|
| 107 | |
---|
| 108 | if( ( openTags || [] ).length !== (( closedTags || [] ).length + ( oclosedTags || [] ).length )) |
---|
| 109 | { |
---|
| 110 | errors = errors || []; |
---|
| 111 | errors.push( key ); |
---|
| 112 | } |
---|
| 113 | |
---|
| 114 | if( errors ) |
---|
| 115 | continue; |
---|
| 116 | |
---|
| 117 | if( document.getElementById( "default_signature" + i ).checked ) |
---|
| 118 | default_signature = key; |
---|
| 119 | |
---|
| 120 | signatures[key] = value; |
---|
| 121 | |
---|
| 122 | if( edit ) |
---|
| 123 | types[key] = edit; |
---|
| 124 | |
---|
| 125 | if( noSig ) |
---|
| 126 | noSig = false; |
---|
| 127 | } |
---|
| 128 | |
---|
| 129 | if( errors ){ |
---|
| 130 | |
---|
| 131 | alert( "Há erros de html na(s) assinatura(s) \'" + errors.join("\',\'") + "\'.\\nRevise a informação inserida (somente no modo Texto Simples ou visulização do Código-Fonte, no modo Texto Rico).\\nPossivelmente você copiou e colou sua assinatura de outro software. Para evitar erros, recomendamos utilizar apenas o editor Texto Rico do Expresso." ); |
---|
| 132 | return( false ); |
---|
| 133 | } |
---|
| 134 | |
---|
| 135 | if( !default_signature ){ |
---|
| 136 | |
---|
| 137 | if( !noSig ) |
---|
| 138 | { |
---|
| 139 | alert( "Favor selecionar uma assinatura padrao." ); |
---|
| 140 | return( false ); |
---|
| 141 | } |
---|
| 142 | |
---|
| 143 | document.getElementById( "signature_default" ).value = ""; |
---|
| 144 | document.getElementById( "signature" ).value = ""; |
---|
| 145 | } |
---|
| 146 | else |
---|
| 147 | { |
---|
| 148 | document.getElementById( "signature_default" ).value = default_signature; |
---|
| 149 | document.getElementById( "signature" ).value = types[key] ? signatures[default_signature] : |
---|
| 150 | signatures[default_signature].replace( /\\n/g, "<br>" ); |
---|
| 151 | } |
---|
[8165] | 152 | if (document.getElementById( "signature" ).value != "") |
---|
| 153 | document.getElementById( "signature" ).value = encode64(document.getElementById( "signature" ).value); |
---|
[4828] | 154 | document.getElementById( "signatures" ).value = toJSON( signatures ); |
---|
| 155 | document.getElementById( "signature_types" ).value = toJSON( types ); |
---|
| 156 | |
---|
| 157 | return( true ); |
---|
| 158 | } |
---|
| 159 | function fromJSON( value ) |
---|
| 160 | { |
---|
| 161 | return (new Function( "return " + decode64( value )))(); |
---|
| 162 | } |
---|
| 163 | |
---|
| 164 | function toJSON( value ) |
---|
| 165 | { |
---|
| 166 | var json = []; |
---|
| 167 | |
---|
| 168 | for( var key in value ) |
---|
| 169 | json.push( \'"\' + key + \'":"\' + escape( value[key] ) + \'"\' ); |
---|
| 170 | |
---|
| 171 | return encode64( "{" + json.join( "," ) + "}" ); |
---|
| 172 | } |
---|
| 173 | |
---|
| 174 | // This code was written by Tyler Akins and has been placed in the |
---|
| 175 | // public domain. It would be nice if you left this header intact. |
---|
| 176 | // Base64 code from Tyler Akins -- http://rumkin.com |
---|
| 177 | |
---|
| 178 | var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; |
---|
| 179 | |
---|
| 180 | function encode64(input) { |
---|
| 181 | var output = new StringMaker(); |
---|
| 182 | var chr1, chr2, chr3; |
---|
| 183 | var enc1, enc2, enc3, enc4; |
---|
| 184 | var i = 0; |
---|
| 185 | |
---|
| 186 | while (i < input.length) { |
---|
| 187 | chr1 = input.charCodeAt(i++); |
---|
| 188 | chr2 = input.charCodeAt(i++); |
---|
| 189 | chr3 = input.charCodeAt(i++); |
---|
| 190 | |
---|
| 191 | enc1 = chr1 >> 2; |
---|
| 192 | enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); |
---|
| 193 | enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); |
---|
| 194 | enc4 = chr3 & 63; |
---|
| 195 | |
---|
| 196 | if (isNaN(chr2)) { |
---|
| 197 | enc3 = enc4 = 64; |
---|
| 198 | } else if (isNaN(chr3)) { |
---|
| 199 | enc4 = 64; |
---|
| 200 | } |
---|
| 201 | |
---|
| 202 | output.append(keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4)); |
---|
| 203 | } |
---|
| 204 | |
---|
| 205 | return output.toString(); |
---|
| 206 | } |
---|
| 207 | var ua = navigator.userAgent.toLowerCase(); |
---|
| 208 | if (ua.indexOf(" chrome/") >= 0 || ua.indexOf(" firefox/") >= 0 || ua.indexOf(" gecko/") >= 0) { |
---|
| 209 | var StringMaker = function () { |
---|
| 210 | this.str = ""; |
---|
| 211 | this.length = 0; |
---|
| 212 | this.append = function (s) { |
---|
| 213 | this.str += s; |
---|
| 214 | this.length += s.length; |
---|
| 215 | } |
---|
| 216 | this.prepend = function (s) { |
---|
| 217 | this.str = s + this.str; |
---|
| 218 | this.length += s.length; |
---|
| 219 | } |
---|
| 220 | this.toString = function () { |
---|
| 221 | return this.str; |
---|
| 222 | } |
---|
| 223 | } |
---|
| 224 | } else { |
---|
| 225 | var StringMaker = function () { |
---|
| 226 | this.parts = []; |
---|
| 227 | this.length = 0; |
---|
| 228 | this.append = function (s) { |
---|
| 229 | this.parts.push(s); |
---|
| 230 | this.length += s.length; |
---|
| 231 | } |
---|
| 232 | this.prepend = function (s) { |
---|
| 233 | this.parts.unshift(s); |
---|
| 234 | this.length += s.length; |
---|
| 235 | } |
---|
| 236 | this.toString = function () { |
---|
| 237 | return this.parts.join(""); |
---|
| 238 | } |
---|
| 239 | } |
---|
| 240 | } |
---|
| 241 | function decode64(input) { |
---|
| 242 | var output = new StringMaker(); |
---|
| 243 | var chr1, chr2, chr3; |
---|
| 244 | var enc1, enc2, enc3, enc4; |
---|
| 245 | var i = 0; |
---|
| 246 | |
---|
| 247 | // remove all characters that are not A-Z, a-z, 0-9, +, /, or = |
---|
| 248 | input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); |
---|
| 249 | |
---|
| 250 | while (i < input.length) { |
---|
| 251 | enc1 = keyStr.indexOf(input.charAt(i++)); |
---|
| 252 | enc2 = keyStr.indexOf(input.charAt(i++)); |
---|
| 253 | enc3 = keyStr.indexOf(input.charAt(i++)); |
---|
| 254 | enc4 = keyStr.indexOf(input.charAt(i++)); |
---|
| 255 | |
---|
| 256 | chr1 = (enc1 << 2) | (enc2 >> 4); |
---|
| 257 | chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); |
---|
| 258 | chr3 = ((enc3 & 3) << 6) | enc4; |
---|
| 259 | |
---|
| 260 | output.append(String.fromCharCode(chr1)); |
---|
| 261 | |
---|
| 262 | if (enc3 != 64) { |
---|
| 263 | output.append(String.fromCharCode(chr2)); |
---|
| 264 | } |
---|
| 265 | if (enc4 != 64) { |
---|
| 266 | output.append(String.fromCharCode(chr3)); |
---|
| 267 | } |
---|
| 268 | } |
---|
| 269 | |
---|
| 270 | return output.toString(); |
---|
| 271 | } |
---|
[8077] | 272 | function normalizerSignature(values){ |
---|
| 273 | |
---|
| 274 | var value = {}; |
---|
| 275 | |
---|
| 276 | for( key in values ){ |
---|
| 277 | |
---|
[8160] | 278 | value[isEncoded64(key) ? decode64(key) : key] = values[key]; |
---|
[8077] | 279 | |
---|
| 280 | } |
---|
| 281 | |
---|
| 282 | return value; |
---|
| 283 | } |
---|
[8160] | 284 | /*Verifica se a string input esta em Base 64*/ |
---|
| 285 | function isEncoded64(input){ |
---|
| 286 | var baseStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; |
---|
| 287 | var encoded = true; |
---|
| 288 | if ( (input.length % 4) != 0) |
---|
| 289 | return false; |
---|
| 290 | for(var i=0; i<input.length; i++){ |
---|
| 291 | if ( baseStr.indexOf(input[i]) < 0 ){ |
---|
| 292 | encoded = false; |
---|
| 293 | break; |
---|
| 294 | } |
---|
| 295 | } |
---|
| 296 | return encoded; |
---|
| 297 | } |
---|
[4828] | 298 | function loadSignature() |
---|
| 299 | { |
---|
| 300 | var types = fromJSON( document.getElementById( "signature_types" ).value ); |
---|
[8038] | 301 | var signatures; |
---|
| 302 | if (document.getElementById( "signatures" ).value) |
---|
| 303 | { |
---|
| 304 | signatures = fromJSON(document.getElementById("signatures").value); |
---|
| 305 | } else if (document.getElementById( "signature" ).value) // Caso a assinatura esteja no formato da versão 2.2.10: |
---|
| 306 | { |
---|
| 307 | // TODO: Internazionalizar a string |
---|
| 308 | signatures = {}; |
---|
| 309 | signatures["Assinatura padrão"] = document.getElementById( "signature" ).value; |
---|
| 310 | if (!document.getElementById("signature_default").value) |
---|
| 311 | { |
---|
| 312 | document.getElementById("signature_default").value = "Assinatura padrão"; |
---|
| 313 | } |
---|
| 314 | } |
---|
| 315 | |
---|
[8077] | 316 | signatures = normalizerSignature(signatures); |
---|
| 317 | types = normalizerSignature(types); |
---|
| 318 | |
---|
[8160] | 319 | var old_signature = document.getElementById( "signature" ).value; |
---|
| 320 | var def = document.getElementById( "signature_default" ).value; |
---|
| 321 | def = isEncoded64(def) ? decode64(def) : def; |
---|
[4828] | 322 | |
---|
| 323 | var counter = 0, ids = [], def_signature = "", noSig = true; |
---|
| 324 | |
---|
| 325 | for( key in signatures ) |
---|
| 326 | { |
---|
| 327 | addSignature( !types || !types[key] ); |
---|
| 328 | |
---|
| 329 | var value = unescape( signatures[key] ); |
---|
| 330 | |
---|
| 331 | document.getElementById( "title_signature" + counter ).value = key; |
---|
| 332 | document.getElementById( "user_signature" + counter ).value = value; |
---|
| 333 | |
---|
| 334 | if( def === key ) |
---|
| 335 | def_signature = counter; |
---|
| 336 | |
---|
| 337 | if( noSig ) noSig = false; |
---|
| 338 | |
---|
| 339 | counter++; |
---|
| 340 | } |
---|
| 341 | |
---|
| 342 | if( def_signature !== "" ) |
---|
[8038] | 343 | document.getElementById( "default_signature" + def_signature ).checked = true; |
---|
[4828] | 344 | else if( noSig && old_signature ) |
---|
| 345 | { |
---|
[8038] | 346 | var type_signature = document.getElementById("type_signature"); |
---|
| 347 | if (type_signature) |
---|
| 348 | { |
---|
| 349 | addSignature( type_signature.value !== "html" ); |
---|
| 350 | document.getElementById( "user_signature" + counter ).value = old_signature; |
---|
| 351 | } |
---|
[4828] | 352 | } |
---|
[8038] | 353 | } |
---|
[5134] | 354 | '); |
---|
[1035] | 355 | //} |
---|
[5134] | 356 | $default = false; |
---|
| 357 | create_check_box('Do you want to show common name instead of UID?','uid2cn',$default, |
---|
| 358 | 'Do you want to show common name instead of UID?'); |
---|
| 359 | create_check_box('Do you want to automatically display the message header?','show_head_msg_full',$default,''); |
---|
[5808] | 360 | create_check_box('Do you want to display date in format numerical?','show_date_numerical',$default,''); |
---|
[873] | 361 | $default = array( |
---|
| 362 | '25' => '25', |
---|
| 363 | '50' => '50', |
---|
| 364 | '75' => '75', |
---|
| 365 | '100' => '100' |
---|
| 366 | ); |
---|
| 367 | |
---|
[5134] | 368 | create_select_box('What is the maximum number of messages per page?','max_email_per_page',$default,'This is the number of messages shown in your mailbox per page'); |
---|
| 369 | |
---|
[4231] | 370 | create_check_box('View the user name in the header of the messages printed?', 'show_name_print_messages', 'Displays the user name in the header print email'); |
---|
| 371 | |
---|
[8167] | 372 | create_check_box('Habilitar funcionalidade de notificar ao receber mensagens filtradas por remetente ?', 'use_alert_filter_criteria', ''); |
---|
| 373 | create_check_box('Habilitar sinalizadores e marcadores em mensagens', 'use_followupflags_and_labels', ''); |
---|
| 374 | |
---|
[5134] | 375 | //$default = 0; |
---|
| 376 | create_check_box('Preview message text within subject column','preview_msg_subject','this exhibits a sample of message within the message subject column'); |
---|
| 377 | |
---|
| 378 | //$default = 0; |
---|
| 379 | create_check_box('Preview message text within a tool-tip box','preview_msg_tip','this exhibits a sample of message within a tool-tip box'); |
---|
| 380 | |
---|
| 381 | create_check_box('View extended information about users','extended_info','This exhibits employeenumber and ou from LDAP in searchs'); |
---|
[1285] | 382 | create_check_box('Save deleted messages in trash folder?','save_deleted_msg','When delete message, send it automatically to trash folder'); |
---|
[873] | 383 | $default = array( |
---|
| 384 | '1' => lang('1 day'), |
---|
| 385 | '2' => lang('2 days'), |
---|
| 386 | '3' => lang('3 days'), |
---|
| 387 | '4' => lang('4 days'), |
---|
| 388 | '5' => lang('5 days') |
---|
| 389 | ); |
---|
| 390 | |
---|
[5134] | 391 | $arquived_messages = array(true => lang("Copy"), false => lang("Move")); |
---|
| 392 | |
---|
[7690] | 393 | //Desbilitado limpeza de lixeira por request. Ticket #3253 |
---|
| 394 | //create_select_box('Delete trash messages after how many days?','delete_trash_messages_after_n_days',$default,'Delete automatically the messages in trash folder in how many days'); |
---|
[1285] | 395 | create_check_box('Would you like to use local messages?','use_local_messages','Enabling this options you will be able to store messages in your local computer'); |
---|
[5134] | 396 | create_select_box('Desired action to archive messages to local folders','keep_archived_messages',$arquived_messages,'After store email in your local computer delete it from server'); |
---|
| 397 | create_check_box('Automaticaly create Default local folders?','auto_create_local','Enable this option if you want to automaticaly create the Inbox, Draft, Trash and Sent folders'); |
---|
[1285] | 398 | create_check_box('Show previous message, after delete actual message?','delete_and_show_previous_message','Enable this option if you want to read the next message everytime you delete a message'); |
---|
| 399 | create_check_box('Do you wanna receive an alert for new messages?','alert_new_msg','Everytime you receive new messages you will be informed'); |
---|
[6996] | 400 | |
---|
| 401 | |
---|
| 402 | create_check_box('Wish you receive notifications for: "New messages", "Filter criteria", "Event alerts"?','notifications','Everytime you receive new messages you will be informed'); |
---|
| 403 | |
---|
| 404 | |
---|
| 405 | |
---|
[1285] | 406 | create_check_box('Show default view on main screen?','mainscreen_showmail','Show unread messages in your home page'); |
---|
| 407 | create_check_box('Do you want to use remove attachments function?','remove_attachments_function','It allow you to remove attachments from messages'); |
---|
[1291] | 408 | create_check_box('Do you want to use important flag in email editor?','use_important_flag','It allow you to send emails with important flag, but you can receive unwanted messages with important flag'); |
---|
[5134] | 409 | create_check_box('Do you want to use SpellChecker in email editor?','use_SpellChecker','It allow you to check the spelling of your emails'); |
---|
| 410 | //Use user folders from email |
---|
[4828] | 411 | |
---|
[5134] | 412 | require_once('class.imap_functions.inc.php'); |
---|
| 413 | $boemailadmin = CreateObject('emailadmin.bo'); |
---|
| 414 | $emailadmin_profile = $boemailadmin->getProfileList(); |
---|
| 415 | $_SESSION['phpgw_info']['expressomail']['email_server'] = $boemailadmin->getProfile($emailadmin_profile[0]['profileID']); |
---|
| 416 | $_SESSION['phpgw_info']['expressomail']['user'] = $GLOBALS['phpgw_info']['user']; |
---|
| 417 | $e_server = $_SESSION['phpgw_info']['expressomail']['email_server']; |
---|
| 418 | $imap = CreateObject('expressoMail1_2.imap_functions'); |
---|
| 419 | |
---|
[1285] | 420 | if ($type != "" && $type != "user"){ |
---|
[5134] | 421 | |
---|
[4828] | 422 | $trash = $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultTrashFolder']; |
---|
| 423 | $drafts = $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultDraftsFolder']; |
---|
| 424 | $spam = $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSpamFolder']; |
---|
| 425 | $sent = $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSentFolder']; |
---|
[4726] | 426 | $delimiter = $_SESSION['phpgw_info']['expressomail']['email_server']['imapDelimiter']; |
---|
[1283] | 427 | $default = Array( |
---|
| 428 | 'INBOX' => lang('INBOX'), |
---|
[5134] | 429 | 'INBOX' . $imap->imap_delimiter . $drafts => lang($drafts), |
---|
| 430 | 'INBOX' . $imap->imap_delimiter . $spam => lang($spam), |
---|
| 431 | 'INBOX' . $imap->imap_delimiter . $trash => lang($trash), |
---|
| 432 | 'INBOX' . $imap->imap_delimiter . $sent => lang($sent) |
---|
[1283] | 433 | ); |
---|
| 434 | } |
---|
[1285] | 435 | else |
---|
| 436 | { |
---|
[1378] | 437 | $save_in_folder_selected = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['save_in_folder']; |
---|
[1281] | 438 | |
---|
[1378] | 439 | // Load Special Folders (Sent, Trash, Draft, Spam) from EmailAdmin (if exists, else get_lang) |
---|
| 440 | $specialFolders = array ("Trash" => lang("Trash"), "Drafts" => lang("Drafts"), "Spam" => lang("Spam"), "Sent" => lang("Sent")); |
---|
| 441 | |
---|
| 442 | foreach ($specialFolders as $key => $value){ |
---|
| 443 | if($e_server['imapDefault'.$key.'Folder']) |
---|
| 444 | $specialFolders[$key] = $e_server['imapDefault'.$key.'Folder']; |
---|
| 445 | } |
---|
| 446 | unset($default); |
---|
| 447 | $default[-1] = lang('Select on send'); |
---|
[1373] | 448 | |
---|
[1375] | 449 | foreach($imap -> get_folders_list(array('noSharedFolders' => true)) as $id => $folder){ |
---|
| 450 | if(!is_numeric($id)) |
---|
[1283] | 451 | continue; |
---|
| 452 | else{ |
---|
| 453 | // Translate INBOX (root folder) |
---|
| 454 | if (strtolower($folder['folder_name']) == "inbox") |
---|
| 455 | $folder['folder_name'] = lang("Inbox"); |
---|
| 456 | // Translate Special Folders |
---|
| 457 | elseif (($keyFolder = array_search($folder['folder_name'], $specialFolders)) !== false) |
---|
| 458 | $folder['folder_name'] = lang($keyFolder); |
---|
[1289] | 459 | // Identation for subfolders |
---|
| 460 | $folder_id = explode($e_server['imapDelimiter'],$folder['folder_id']); |
---|
| 461 | $level = count($folder_id); |
---|
| 462 | $ident = ''; |
---|
[7655] | 463 | for($i = 2; $level > 2 && $i < $level;++$i) |
---|
[1289] | 464 | $ident .= ' - '; |
---|
[1373] | 465 | |
---|
[1289] | 466 | $default[$folder['folder_id']] = $ident.$folder['folder_name']; |
---|
[1373] | 467 | } |
---|
[1281] | 468 | } |
---|
[1378] | 469 | |
---|
[1281] | 470 | } |
---|
[1285] | 471 | create_select_box('Save sent messages in folder','save_in_folder',$default,'Save automatically sent messages in selected folder'); |
---|
[5134] | 472 | create_check_box('Show TO: in place of FROM: only in Automatic SEND folder','from_to_sent','Show TO: in place of FROM: only in Automatic SEND folder'); |
---|
| 473 | |
---|
| 474 | |
---|
[1285] | 475 | create_check_box('Hide menu folders?','hide_folders','You can use it if your screen does not have good resolution'); |
---|
[873] | 476 | |
---|
[5134] | 477 | |
---|
[4885] | 478 | $default = array( |
---|
[5134] | 479 | '50' => '50', |
---|
| 480 | '100' => '100', |
---|
| 481 | '150' => '150', |
---|
| 482 | '200' => '200', |
---|
| 483 | '300' => '300', |
---|
| 484 | '400' => '400', |
---|
| 485 | '65536' => lang('unlimited') |
---|
| 486 | ); |
---|
| 487 | |
---|
| 488 | create_select_box('What is the maximum number of results in an e-mail search?','search_result_number',$default,''); |
---|
| 489 | |
---|
[6053] | 490 | $default = array( |
---|
[6055] | 491 | // Não é possivel colocar um 0 como valor, pois ele troca para 4 como padrão! então coloquei um x, e tratei isso la no javascriot .. então x = 0 |
---|
[6053] | 492 | 'x' => lang('unlimited'), |
---|
| 493 | '1' => '1', |
---|
[4885] | 494 | '2' => '2', |
---|
| 495 | '3' => '3', |
---|
| 496 | '4' => '4', |
---|
[6054] | 497 | '5' => '5' |
---|
[4885] | 498 | ); |
---|
| 499 | |
---|
| 500 | create_select_box('What is the minimum number of characters in searching contacts?','search_characters_number',$default,'what is the minimum number of characters in searching contacts'); |
---|
| 501 | |
---|
[5134] | 502 | $default = array( |
---|
[4828] | 503 | '20' => lang('normal'), |
---|
| 504 | '30' => lang('medium'), |
---|
| 505 | '40' => lang('big') |
---|
[5134] | 506 | ); |
---|
[1608] | 507 | |
---|
[5134] | 508 | |
---|
[1035] | 509 | create_select_box('What is the height of the lines in the list of messages?','line_height',$default,''); |
---|
[5134] | 510 | create_check_box('Increases th maximum size of show messages?','max_msg_size','Increases the maximum size of show emails from 100kb to 1mb'); |
---|
[1285] | 511 | create_check_box('Use dynamic contacts?','use_dynamic_contacts','Store your\'s most used contacts'); |
---|
[5134] | 512 | create_check_box('Use shortcuts?','use_shortcuts','n key (Open new message)<br>ESC key (Close tab)<br>i key (print)<br>e key (forward)<br>r key (reply)<br>DELETE key (delete the current message)<br>Ctrl + up (go to previous message)<br>Ctrl + down (go to next message)<br>Shift + up or down (select multiple messages)<br>F9 key (search at catalog)<br>'); |
---|
[1285] | 513 | create_check_box('Auto save draft','auto_save_draft','When you are away from computer it saves automatically the message you are writing'); |
---|
[5134] | 514 | create_check_box('Send messages with return recipient option by default','return_recipient_deafault','With this option every new email will get the return recipient option marked'); |
---|
| 515 | |
---|
| 516 | unset($default); |
---|
| 517 | $functions = new functions(); |
---|
| 518 | $zones = $functions->getTimezones(); |
---|
| 519 | $default = array(sprintf("%s", array_search('America/Sao_Paulo', $zones)) => 'America/Sao_Paulo'); |
---|
| 520 | create_select_box('What is your timezone?', 'timezone', $zones, 'The Timezone you\'re in.', $default); |
---|
| 521 | |
---|
[4885] | 522 | $default = array( |
---|
[5134] | 523 | '1' => lang('contacts'), |
---|
| 524 | '2' => lang('email') |
---|
| 525 | ); |
---|
| 526 | |
---|
| 527 | create_select_box('Where should the quick search be performed by default?','quick_search_default',$default,'It is where the keyword should be searched when the user executes a quick search.'); |
---|
| 528 | |
---|
| 529 | $default = array( |
---|
[1005] | 530 | '65536' => lang('unlimited'), |
---|
| 531 | '640' => '640', |
---|
| 532 | '768' => '768', |
---|
| 533 | '800' => '800', |
---|
| 534 | '1024' => '1024', |
---|
| 535 | '1080' => '1080' |
---|
| 536 | ); |
---|
[873] | 537 | |
---|
[1285] | 538 | create_select_box('What is the maximum size of embedded images?','image_size',$default,'When user send an email with image in body message, it changes the size'); |
---|
[5158] | 539 | create_check_box('Use plain text editor as standard ?','plain_text_editor',''); |
---|
[1005] | 540 | |
---|
[5158] | 541 | |
---|
[5075] | 542 | $default = array( |
---|
| 543 | 'global' => lang("Global catalog"), |
---|
| 544 | 'personal' => lang("Personal catalog"), |
---|
| 545 | 'all' => lang("All catalogs") |
---|
[5134] | 546 | ); |
---|
[5075] | 547 | |
---|
[5134] | 548 | create_select_box('The dynamic search will use the catalog','catalog_search',$default,'Seleciona o catálogo que será usado para fazer a busca'); |
---|
| 549 | $default = false; |
---|
| 550 | create_check_box('Display default fields on the quick search screen?','default_fields_quick_search', $default, 'Mostrar o nome, email e telefone do contato por padrão'); |
---|
[5075] | 551 | |
---|
| 552 | |
---|
[1035] | 553 | if($GLOBALS['phpgw_info']['server']['use_assinar_criptografar']) |
---|
| 554 | { |
---|
| 555 | create_check_box('Enable digitally sign/cipher the message?','use_signature_digital_cripto','','',True,'onchange="javascript:exibir_ocultar();"'); |
---|
| 556 | if ($GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_signature_digital_cripto']) |
---|
| 557 | { |
---|
| 558 | create_check_box('Always sign message digitally?','use_signature_digital',''); |
---|
| 559 | create_check_box('Always cipher message digitally?','use_signature_cripto',''); |
---|
| 560 | } |
---|
| 561 | else |
---|
| 562 | { |
---|
| 563 | create_check_box('Always sign message digitally?','use_signature_digital','','',True,'',False); |
---|
| 564 | create_check_box('Always cipher message digitally?','use_signature_cripto','','',True,'',False); |
---|
| 565 | } |
---|
| 566 | } |
---|
| 567 | |
---|
[6858] | 568 | create_check_box('Would you like to have a read receipt option to read messages?','confirm_read_message',''); |
---|
[7420] | 569 | create_check_box('Would you like to activate the alert for message attachment?','alert_message_attachment',''); |
---|
[6858] | 570 | |
---|
[873] | 571 | $default = array( |
---|
| 572 | 'text' => lang('simple text'), |
---|
| 573 | 'html' => lang('rich text') |
---|
| 574 | ); |
---|
[5134] | 575 | create_check_box('Auto close the first tab on reaching the maximum number of tabs?','auto_close_first_tab',''); |
---|
[1288] | 576 | create_check_box('Insert signature automatically in new messages?','use_signature',''); |
---|
[873] | 577 | |
---|
[5134] | 578 | $default = array('0' => lang('nested in the same tab of the main message'), '1' => lang('in your own tab, one for each attached message')); |
---|
| 579 | create_select_box('Nested messages are shown','nested_messages_are_shown', $default,'How to show nested messages'); |
---|
[873] | 580 | |
---|
[5134] | 581 | $default = array( |
---|
| 582 | 'Arial' => 'Arial', |
---|
| 583 | 'Verdana' => 'Verdana', |
---|
| 584 | 'Times new roman' => 'Times New Roman', |
---|
| 585 | 'Tahoma' => 'Tahoma', |
---|
| 586 | ); |
---|
| 587 | create_select_box( 'Default font editor' , 'font_family_editor' , $default ); |
---|
[873] | 588 | |
---|
[5134] | 589 | $default = array( |
---|
| 590 | '8pt' => '8', |
---|
| 591 | '9pt' => '9', |
---|
| 592 | '10pt' => '10', |
---|
| 593 | '11pt' => '11', |
---|
| 594 | '12pt' => '12', |
---|
| 595 | '14pt' => '14', |
---|
| 596 | '16pt' => '16', |
---|
| 597 | '18pt' => '18', |
---|
| 598 | '20pt' => '20', |
---|
| 599 | '22pt' => '22', |
---|
| 600 | '24pt' => '24', |
---|
| 601 | '26pt' => '26', |
---|
| 602 | '28pt' => '28', |
---|
| 603 | '36pt' => '36', |
---|
| 604 | '48pt' => '48', |
---|
| 605 | '72pt' => '72', |
---|
| 606 | ); |
---|
| 607 | |
---|
| 608 | create_select_box( 'Default font size editor' , 'font_size_editor' , $default ); |
---|
| 609 | |
---|
| 610 | if ($type == 'user' || $type == ''){ |
---|
[4828] | 611 | $vars = $GLOBALS['phpgw']->preferences->user['expressoMail']; |
---|
[1244] | 612 | |
---|
[5134] | 613 | |
---|
| 614 | create_html_code("signature","<script src='../library/jquery/jquery.js' language='javascript'></script> |
---|
[5083] | 615 | <script src='../library/ckeditor/ckeditor.js' language='javascript'></script> |
---|
| 616 | <script src='../library/ckeditor/adapters/jquery.js' language='javascript'></script> |
---|
[5134] | 617 | |
---|
[4828] | 618 | <input type='hidden' id='counter' value='0'> |
---|
| 619 | <input type='hidden' id='signatures' name='user[signatures]' value='". $vars['signatures']."'> |
---|
| 620 | <input type='hidden' id='signature_default' name='user[signature_default]' value='".$vars['signature_default']."'> |
---|
| 621 | <input type='hidden' id='signature' name='user[signature]' value='","' > |
---|
| 622 | <input type='hidden' id='signature_types' name='user[signature_types]' value='".$vars['signature_types']."'> |
---|
[1873] | 623 | |
---|
[4828] | 624 | <div id='_signature' name='signature' style='display: none;'> |
---|
| 625 | <div id='options_signature'> |
---|
[5083] | 626 | <input id='edit_signature' type='checkbox' name='isEditor' onclick='changeType( this, this.id.replace( /[^0-9]*/gi, \"\" ) );' checked='checked'><label for='isEditor'>Editor de texto</label> | Titulo da assinatura <input type='text' id='title_signature'> | <input type='radio' id='default_signature' name='signature_default'><label>Usar como padrao</label> | <a href='#' onclick='javascript: return removeSignature( this );' id='remove_signature'> Remover</a> |
---|
[4828] | 627 | </div><br/> |
---|
| 628 | <div id='text_signature'> |
---|
[5083] | 629 | <textarea rows='10' cols='65' id='user_signature' class='editor'></textarea></div> |
---|
[4828] | 630 | </div> |
---|
| 631 | |
---|
[4885] | 632 | <script language='javascript'> |
---|
| 633 | |
---|
[4828] | 634 | $(document).ready(function(){ |
---|
[4885] | 635 | |
---|
[4828] | 636 | loadSignature(); |
---|
[4885] | 637 | |
---|
[4828] | 638 | }); |
---|
[4885] | 639 | |
---|
[5083] | 640 | function changeType(obj, target){ |
---|
| 641 | if(obj.checked === true) |
---|
| 642 | $('#user_signature' + target).ckeditor( { toolbar:'signature' }); |
---|
| 643 | else |
---|
| 644 | CKEDITOR.instances['user_signature' + target ].destroy(); |
---|
[4885] | 645 | } |
---|
[1544] | 646 | |
---|
[4828] | 647 | // var counter = 0; |
---|
| 648 | |
---|
| 649 | function addSignature( simple ) |
---|
[1244] | 650 | { |
---|
[4828] | 651 | var sig = document.getElementById('_signature').cloneNode( true ); |
---|
| 652 | var counter = document.getElementById( 'counter' ).value; |
---|
[4885] | 653 | |
---|
[4828] | 654 | sig.innerHTML = sig.innerHTML.replace( /_signature/g, '_signature' + counter ); |
---|
| 655 | |
---|
| 656 | sig.id = '_signature' + counter; |
---|
| 657 | sig.style.display = ''; |
---|
| 658 | |
---|
| 659 | $( '#add_signature' ).before( sig ); |
---|
| 660 | |
---|
| 661 | if( !simple ) |
---|
[5083] | 662 | $('#user_signature' + counter).ckeditor( { toolbar:'signature' }); |
---|
[4828] | 663 | else |
---|
| 664 | document.getElementById('edit_signature' + counter ).checked = ''; |
---|
| 665 | |
---|
| 666 | document.getElementById( 'counter' ).value = ++counter; |
---|
[5134] | 667 | } |
---|
[1244] | 668 | |
---|
[4828] | 669 | function removeSignature( el ) |
---|
| 670 | { |
---|
| 671 | counter = el.id.replace( /[^0-9]*/gi, \"\" ); |
---|
| 672 | |
---|
| 673 | el = document.getElementById( '_signature' + counter ); |
---|
| 674 | el.parentNode.removeChild( el ); |
---|
| 675 | |
---|
| 676 | return( false ); |
---|
[5134] | 677 | } |
---|
[4828] | 678 | </script> |
---|
| 679 | <input id='add_signature' type='button' onclick='addSignature();' value='Adicionar Assinatura'> |
---|
| 680 | "); |
---|
[873] | 681 | } |
---|
| 682 | ?> |
---|