[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"); |
---|
[3493] | 22 | include_once("class.functions.inc.php"); |
---|
[1890] | 23 | $type = isset($_GET['type']) ? $_GET['type']:$GLOBALS['type']; // FIX ME |
---|
[873] | 24 | |
---|
[1035] | 25 | //if ($type == 'user' || $type == ''){ |
---|
[1405] | 26 | create_script('function exibir_ocultar() |
---|
[1035] | 27 | { |
---|
| 28 | var type = ("'.$type.'" == "") ? "user" : "'.$type.'"; |
---|
[3277] | 29 | var use_signature_digital_cripto = null; |
---|
[3278] | 30 | |
---|
[3277] | 31 | if (document.all) |
---|
| 32 | { |
---|
[3278] | 33 | // is_ie |
---|
| 34 | use_signature_digital_cripto = document.getElementsByName(type+"[use_signature_digital_cripto]")[1]; |
---|
[3277] | 35 | } |
---|
[3278] | 36 | else |
---|
[3277] | 37 | { |
---|
[3278] | 38 | // not_ie |
---|
[3277] | 39 | use_signature_digital_cripto = document.getElementsByName(type+"[use_signature_digital_cripto]")[0]; |
---|
| 40 | } |
---|
[3278] | 41 | |
---|
[1035] | 42 | var default_signature_digital_cripto = "'.$GLOBALS['phpgw_info']['default']['preferences']['expressoMail']['use_signature_digital_cripto'].'"; |
---|
| 43 | |
---|
| 44 | if (use_signature_digital_cripto) |
---|
| 45 | { |
---|
| 46 | var element_signature_digital = document.getElementById(type+"[use_signature_digital]"); |
---|
| 47 | var element_signature_cripto = document.getElementById(type+"[use_signature_cripto]"); |
---|
| 48 | |
---|
| 49 | switch (use_signature_digital_cripto[use_signature_digital_cripto.selectedIndex].value){ |
---|
| 50 | |
---|
| 51 | case "1": |
---|
| 52 | element_signature_digital.style.display=""; |
---|
| 53 | element_signature_cripto.style.display=""; |
---|
| 54 | break; |
---|
| 55 | case "0": |
---|
| 56 | element_signature_digital.style.display="none"; |
---|
| 57 | element_signature_cripto.style.display="none"; |
---|
| 58 | break; |
---|
| 59 | case "": |
---|
| 60 | if (default_signature_digital_cripto){ |
---|
| 61 | element_signature_digital.style.display=""; |
---|
| 62 | element_signature_cripto.style.display=""; |
---|
| 63 | } |
---|
| 64 | else |
---|
| 65 | { |
---|
| 66 | element_signature_digital.style.display="none"; |
---|
| 67 | element_signature_cripto.style.display="none"; |
---|
| 68 | } |
---|
| 69 | |
---|
| 70 | } |
---|
| 71 | |
---|
| 72 | } |
---|
| 73 | |
---|
[1405] | 74 | }'); |
---|
[1035] | 75 | //} |
---|
[1747] | 76 | $default = false; |
---|
| 77 | create_check_box('Do you want to show common name instead of UID?','uid2cn',$default, |
---|
| 78 | 'Do you want to show common name instead of UID?'); |
---|
[3165] | 79 | create_check_box('Do you want to automatically display the message header?','show_head_msg_full',$default,''); |
---|
[873] | 80 | $default = array( |
---|
| 81 | '25' => '25', |
---|
| 82 | '50' => '50', |
---|
| 83 | '75' => '75', |
---|
| 84 | '100' => '100' |
---|
| 85 | ); |
---|
| 86 | |
---|
[1285] | 87 | 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'); |
---|
[1752] | 88 | |
---|
| 89 | //$default = 0; |
---|
| 90 | create_check_box('Preview message text within subject column','preview_msg_subject','this exhibits a sample of message within the message subject column'); |
---|
| 91 | |
---|
| 92 | //$default = 0; |
---|
| 93 | 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'); |
---|
| 94 | |
---|
[3388] | 95 | create_check_box('View extended information about users','extended_info','This exhibits employeenumber and ou from LDAP in searchs'); |
---|
[1752] | 96 | |
---|
[1285] | 97 | create_check_box('Save deleted messages in trash folder?','save_deleted_msg','When delete message, send it automatically to trash folder'); |
---|
[873] | 98 | $default = array( |
---|
| 99 | '1' => lang('1 day'), |
---|
| 100 | '2' => lang('2 days'), |
---|
| 101 | '3' => lang('3 days'), |
---|
| 102 | '4' => lang('4 days'), |
---|
| 103 | '5' => lang('5 days') |
---|
| 104 | ); |
---|
| 105 | |
---|
[3283] | 106 | $arquived_messages = array(true => lang("Copy"), false => lang("Move")); |
---|
| 107 | |
---|
[1285] | 108 | 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'); |
---|
| 109 | 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'); |
---|
[3283] | 110 | 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'); |
---|
[3365] | 111 | 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] | 112 | 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'); |
---|
| 113 | create_check_box('Do you wanna receive an alert for new messages?','alert_new_msg','Everytime you receive new messages you will be informed'); |
---|
| 114 | create_check_box('Show default view on main screen?','mainscreen_showmail','Show unread messages in your home page'); |
---|
| 115 | create_check_box('Do you want to use remove attachments function?','remove_attachments_function','It allow you to remove attachments from messages'); |
---|
[1291] | 116 | 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'); |
---|
[3400] | 117 | create_check_box('Do you want to use SpellChecker in email editor?','use_SpellChecker','It allow you to check the spelling of your emails'); |
---|
[1281] | 118 | //Use user folders from email |
---|
[3810] | 119 | |
---|
| 120 | require_once('class.imap_functions.inc.php'); |
---|
| 121 | $boemailadmin = CreateObject('emailadmin.bo'); |
---|
| 122 | $emailadmin_profile = $boemailadmin->getProfileList(); |
---|
| 123 | $_SESSION['phpgw_info']['expressomail']['email_server'] = $boemailadmin->getProfile($emailadmin_profile[0]['profileID']); |
---|
| 124 | $_SESSION['phpgw_info']['expressomail']['user'] = $GLOBALS['phpgw_info']['user']; |
---|
| 125 | $e_server = $_SESSION['phpgw_info']['expressomail']['email_server']; |
---|
| 126 | $imap = CreateObject('expressoMail1_2.imap_functions'); |
---|
| 127 | |
---|
[1285] | 128 | if ($type != "" && $type != "user"){ |
---|
[3812] | 129 | |
---|
[1283] | 130 | $trash = $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultTrashFolder']; |
---|
| 131 | $drafts = $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultDraftsFolder']; |
---|
| 132 | $spam = $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSpamFolder']; |
---|
| 133 | $sent = $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSentFolder']; |
---|
| 134 | $default = Array( |
---|
| 135 | 'INBOX' => lang('INBOX'), |
---|
[3812] | 136 | 'INBOX' . $imap->imap_delimiter . $drafts => lang($drafts), |
---|
| 137 | 'INBOX' . $imap->imap_delimiter . $spam => lang($spam), |
---|
| 138 | 'INBOX' . $imap->imap_delimiter . $trash => lang($trash), |
---|
| 139 | 'INBOX' . $imap->imap_delimiter . $sent => lang($sent) |
---|
[1283] | 140 | ); |
---|
| 141 | } |
---|
[1285] | 142 | else |
---|
| 143 | { |
---|
[1378] | 144 | $save_in_folder_selected = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['save_in_folder']; |
---|
[1281] | 145 | |
---|
[1378] | 146 | // Load Special Folders (Sent, Trash, Draft, Spam) from EmailAdmin (if exists, else get_lang) |
---|
| 147 | $specialFolders = array ("Trash" => lang("Trash"), "Drafts" => lang("Drafts"), "Spam" => lang("Spam"), "Sent" => lang("Sent")); |
---|
| 148 | |
---|
| 149 | foreach ($specialFolders as $key => $value){ |
---|
| 150 | if($e_server['imapDefault'.$key.'Folder']) |
---|
| 151 | $specialFolders[$key] = $e_server['imapDefault'.$key.'Folder']; |
---|
| 152 | } |
---|
| 153 | unset($default); |
---|
| 154 | $default[-1] = lang('Select on send'); |
---|
[1373] | 155 | |
---|
[1375] | 156 | foreach($imap -> get_folders_list(array('noSharedFolders' => true)) as $id => $folder){ |
---|
| 157 | if(!is_numeric($id)) |
---|
[1283] | 158 | continue; |
---|
| 159 | else{ |
---|
| 160 | // Translate INBOX (root folder) |
---|
| 161 | if (strtolower($folder['folder_name']) == "inbox") |
---|
| 162 | $folder['folder_name'] = lang("Inbox"); |
---|
| 163 | // Translate Special Folders |
---|
| 164 | elseif (($keyFolder = array_search($folder['folder_name'], $specialFolders)) !== false) |
---|
| 165 | $folder['folder_name'] = lang($keyFolder); |
---|
[1289] | 166 | // Identation for subfolders |
---|
| 167 | $folder_id = explode($e_server['imapDelimiter'],$folder['folder_id']); |
---|
| 168 | $level = count($folder_id); |
---|
| 169 | $ident = ''; |
---|
| 170 | for($i = 2; $level > 2 && $i < $level;$i++) |
---|
| 171 | $ident .= ' - '; |
---|
[1373] | 172 | |
---|
[1289] | 173 | $default[$folder['folder_id']] = $ident.$folder['folder_name']; |
---|
[1373] | 174 | } |
---|
[1281] | 175 | } |
---|
[1378] | 176 | |
---|
[1281] | 177 | } |
---|
[1285] | 178 | create_select_box('Save sent messages in folder','save_in_folder',$default,'Save automatically sent messages in selected folder'); |
---|
[3245] | 179 | 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'); |
---|
| 180 | |
---|
| 181 | |
---|
[1285] | 182 | create_check_box('Hide menu folders?','hide_folders','You can use it if your screen does not have good resolution'); |
---|
[873] | 183 | |
---|
| 184 | $default = array( |
---|
| 185 | '20' => lang('normal'), |
---|
| 186 | '30' => lang('medium'), |
---|
| 187 | '40' => lang('big') |
---|
| 188 | ); |
---|
| 189 | |
---|
[1608] | 190 | $default = array( |
---|
| 191 | '50' => '50', |
---|
| 192 | '100' => '100', |
---|
| 193 | '150' => '150', |
---|
| 194 | '200' => '200', |
---|
| 195 | '300' => '300', |
---|
| 196 | '400' => '400', |
---|
| 197 | '65536' => lang('unlimited') |
---|
| 198 | ); |
---|
| 199 | |
---|
| 200 | create_select_box('What is the maximum number of results in an e-mail search?','search_result_number',$default,''); |
---|
| 201 | |
---|
[1610] | 202 | $default = array( |
---|
| 203 | '1' => lang('unlimited'), |
---|
| 204 | '2' => '2', |
---|
| 205 | '3' => '3', |
---|
| 206 | '4' => '4', |
---|
| 207 | '5' => '5' |
---|
| 208 | ); |
---|
| 209 | |
---|
| 210 | 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'); |
---|
| 211 | |
---|
[1035] | 212 | create_select_box('What is the height of the lines in the list of messages?','line_height',$default,''); |
---|
[3414] | 213 | 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] | 214 | create_check_box('Use dynamic contacts?','use_dynamic_contacts','Store your\'s most used contacts'); |
---|
[1498] | 215 | 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] | 216 | create_check_box('Auto save draft','auto_save_draft','When you are away from computer it saves automatically the message you are writing'); |
---|
[3493] | 217 | |
---|
| 218 | unset($default); |
---|
| 219 | $functions = new functions(); |
---|
| 220 | $zones = $functions->getTimezones(); |
---|
| 221 | $default = array(sprintf("%s", array_search('America/Sao_Paulo', $zones)) => 'America/Sao_Paulo'); |
---|
| 222 | create_select_box('What is your timezone?', 'timezone', $zones, 'The Timezone you\'re in.', $default); |
---|
| 223 | |
---|
[3581] | 224 | $default = array( |
---|
| 225 | '1' => lang('contacts'), |
---|
| 226 | '2' => lang('email') |
---|
| 227 | ); |
---|
| 228 | |
---|
| 229 | 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.'); |
---|
| 230 | |
---|
[1005] | 231 | $default = array( |
---|
| 232 | '65536' => lang('unlimited'), |
---|
| 233 | '640' => '640', |
---|
| 234 | '768' => '768', |
---|
| 235 | '800' => '800', |
---|
| 236 | '1024' => '1024', |
---|
| 237 | '1080' => '1080' |
---|
| 238 | ); |
---|
[873] | 239 | |
---|
[1285] | 240 | 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'); |
---|
[1005] | 241 | |
---|
[1035] | 242 | if($GLOBALS['phpgw_info']['server']['use_assinar_criptografar']) |
---|
| 243 | { |
---|
| 244 | create_check_box('Enable digitally sign/cipher the message?','use_signature_digital_cripto','','',True,'onchange="javascript:exibir_ocultar();"'); |
---|
| 245 | if ($GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_signature_digital_cripto']) |
---|
| 246 | { |
---|
| 247 | create_check_box('Always sign message digitally?','use_signature_digital',''); |
---|
| 248 | create_check_box('Always cipher message digitally?','use_signature_cripto',''); |
---|
| 249 | } |
---|
| 250 | else |
---|
| 251 | { |
---|
| 252 | create_check_box('Always sign message digitally?','use_signature_digital','','',True,'',False); |
---|
| 253 | create_check_box('Always cipher message digitally?','use_signature_cripto','','',True,'',False); |
---|
| 254 | } |
---|
| 255 | } |
---|
| 256 | |
---|
[873] | 257 | $default = array( |
---|
| 258 | 'text' => lang('simple text'), |
---|
| 259 | 'html' => lang('rich text') |
---|
| 260 | ); |
---|
[1288] | 261 | create_check_box('Insert signature automatically in new messages?','use_signature',''); |
---|
[1873] | 262 | create_select_box('Signature Type','type_signature',$default,'','','','onchange="javascript:changeType(this.value);" onload="javascript:alert(this.value);"'); |
---|
[873] | 263 | |
---|
[874] | 264 | if ($type == 'user' || $type == ''){ |
---|
[873] | 265 | $oFCKeditor = new FCKeditor('html_signature'); |
---|
| 266 | $oFCKeditor->BasePath = '../expressoMail1_2/js/fckeditor/'; |
---|
| 267 | $oFCKeditor->ToolbarSet = 'ExpressoLivre'; |
---|
| 268 | |
---|
| 269 | $vars = $GLOBALS['phpgw']->preferences->user[$appname]; |
---|
| 270 | |
---|
[1002] | 271 | create_html_code("signature","<div id='text_signature'> |
---|
[1134] | 272 | <textarea rows='5' cols='50' id='user_signature' name='user[signature]'>","</textarea></div> |
---|
[873] | 273 | <div style='display:none;' id='html_signature'>".$oFCKeditor->Create()."</div> |
---|
| 274 | <script language='javascript'> |
---|
[1544] | 275 | //document.getElementById('user_signature').value = '".$vars['signature']."'; |
---|
[873] | 276 | function changeType(value){ |
---|
| 277 | var html_signature = FCKeditorAPI.GetInstance(\"html_signature\"); |
---|
[1544] | 278 | value=value.replace('d',''); |
---|
[873] | 279 | if(value == 'text'){ |
---|
[1134] | 280 | document.getElementById('user_signature').value = html_signature.GetHTML(); |
---|
[873] | 281 | document.getElementById(\"text_signature\").style.display = ''; |
---|
| 282 | document.getElementById(\"html_signature\").style.display = 'none'; |
---|
[1002] | 283 | } |
---|
[1244] | 284 | else if(value == 'html'){ |
---|
[1134] | 285 | html_signature.SetHTML(document.getElementById('user_signature').value); |
---|
[1002] | 286 | document.getElementById(\"text_signature\").style.display = 'none'; |
---|
| 287 | document.getElementById(\"html_signature\").style.display = ''; |
---|
| 288 | } |
---|
[873] | 289 | } |
---|
[1244] | 290 | function get_html_translation_table(table, quote_style) { |
---|
| 291 | // http://kevin.vanzonneveld.net |
---|
| 292 | var entities = {}, hash_map = {}, decimal = 0, symbol = ''; |
---|
| 293 | var constMappingTable = {}, constMappingQuoteStyle = {}; |
---|
| 294 | var useTable = {}, useQuoteStyle = {}; |
---|
| 295 | // Translate arguments |
---|
| 296 | constMappingTable[0] = 'HTML_SPECIALCHARS'; |
---|
| 297 | constMappingTable[1] = 'HTML_ENTITIES'; |
---|
| 298 | constMappingQuoteStyle[0] = 'ENT_NOQUOTES'; |
---|
| 299 | constMappingQuoteStyle[2] = 'ENT_COMPAT'; |
---|
| 300 | constMappingQuoteStyle[3] = 'ENT_QUOTES'; |
---|
| 301 | |
---|
| 302 | useTable = !isNaN(table) ? constMappingTable[table] : table ? table.toUpperCase() : 'HTML_SPECIALCHARS'; |
---|
| 303 | useQuoteStyle = !isNaN(quote_style) ? constMappingQuoteStyle[quote_style] : quote_style ? quote_style.toUpperCase() : 'ENT_COMPAT'; |
---|
| 304 | |
---|
| 305 | if (useTable !== 'HTML_SPECIALCHARS' && useTable !== 'HTML_ENTITIES') { |
---|
| 306 | throw new Error(\"Table: \"+useTable+' not supported'); |
---|
| 307 | // return false; |
---|
| 308 | } |
---|
| 309 | |
---|
| 310 | entities['38'] = '&'; |
---|
| 311 | if (useTable === 'HTML_ENTITIES') { |
---|
| 312 | entities['160'] = ' '; |
---|
| 313 | entities['161'] = '¡'; |
---|
| 314 | entities['162'] = '¢'; |
---|
| 315 | entities['163'] = '£'; |
---|
| 316 | entities['164'] = '¤'; |
---|
| 317 | entities['165'] = '¥'; |
---|
| 318 | entities['166'] = '¦'; |
---|
| 319 | entities['167'] = '§'; |
---|
| 320 | entities['168'] = '¨'; |
---|
| 321 | entities['169'] = '©'; |
---|
| 322 | entities['170'] = 'ª'; |
---|
| 323 | entities['171'] = '«'; |
---|
| 324 | entities['172'] = '¬'; |
---|
| 325 | entities['173'] = '­'; |
---|
| 326 | entities['174'] = '®'; |
---|
| 327 | entities['175'] = '¯'; |
---|
| 328 | entities['176'] = '°'; |
---|
| 329 | entities['177'] = '±'; |
---|
| 330 | entities['178'] = '²'; |
---|
| 331 | entities['179'] = '³'; |
---|
| 332 | entities['180'] = '´'; |
---|
| 333 | entities['181'] = 'µ'; |
---|
| 334 | entities['182'] = '¶'; |
---|
| 335 | entities['183'] = '·'; |
---|
| 336 | entities['184'] = '¸'; |
---|
| 337 | entities['185'] = '¹'; |
---|
| 338 | entities['186'] = 'º'; |
---|
| 339 | entities['187'] = '»'; |
---|
| 340 | entities['188'] = '¼'; |
---|
| 341 | entities['189'] = '½'; |
---|
| 342 | entities['190'] = '¾'; |
---|
| 343 | entities['191'] = '¿'; |
---|
| 344 | entities['192'] = 'À'; |
---|
| 345 | entities['193'] = 'Á'; |
---|
| 346 | entities['194'] = 'Â'; |
---|
| 347 | entities['195'] = 'Ã'; |
---|
| 348 | entities['196'] = 'Ä'; |
---|
| 349 | entities['197'] = 'Å'; |
---|
| 350 | entities['198'] = 'Æ'; |
---|
| 351 | entities['199'] = 'Ç'; |
---|
| 352 | entities['200'] = 'È'; |
---|
| 353 | entities['201'] = 'É'; |
---|
| 354 | entities['202'] = 'Ê'; |
---|
| 355 | entities['203'] = 'Ë'; |
---|
| 356 | entities['204'] = 'Ì'; |
---|
| 357 | entities['205'] = 'Í'; |
---|
| 358 | entities['206'] = 'Î'; |
---|
| 359 | entities['207'] = 'Ï'; |
---|
| 360 | entities['208'] = 'Ð'; |
---|
| 361 | entities['209'] = 'Ñ'; |
---|
| 362 | entities['210'] = 'Ò'; |
---|
| 363 | entities['211'] = 'Ó'; |
---|
| 364 | entities['212'] = 'Ô'; |
---|
| 365 | entities['213'] = 'Õ'; |
---|
| 366 | entities['214'] = 'Ö'; |
---|
| 367 | entities['215'] = '×'; |
---|
| 368 | entities['216'] = 'Ø'; |
---|
| 369 | entities['217'] = 'Ù'; |
---|
| 370 | entities['218'] = 'Ú'; |
---|
| 371 | entities['219'] = 'Û'; |
---|
| 372 | entities['220'] = 'Ü'; |
---|
| 373 | entities['221'] = 'Ý'; |
---|
| 374 | entities['222'] = 'Þ'; |
---|
| 375 | entities['223'] = 'ß'; |
---|
| 376 | entities['224'] = 'à'; |
---|
| 377 | entities['225'] = 'á'; |
---|
| 378 | entities['226'] = 'â'; |
---|
| 379 | entities['227'] = 'ã'; |
---|
| 380 | entities['228'] = 'ä'; |
---|
| 381 | entities['229'] = 'å'; |
---|
| 382 | entities['230'] = 'æ'; |
---|
| 383 | entities['231'] = 'ç'; |
---|
| 384 | entities['232'] = 'è'; |
---|
| 385 | entities['233'] = 'é'; |
---|
| 386 | entities['234'] = 'ê'; |
---|
| 387 | entities['235'] = 'ë'; |
---|
| 388 | entities['236'] = 'ì'; |
---|
| 389 | entities['237'] = 'í'; |
---|
| 390 | entities['238'] = 'î'; |
---|
| 391 | entities['239'] = 'ï'; |
---|
| 392 | entities['240'] = 'ð'; |
---|
| 393 | entities['241'] = 'ñ'; |
---|
| 394 | entities['242'] = 'ò'; |
---|
| 395 | entities['243'] = 'ó'; |
---|
| 396 | entities['244'] = 'ô'; |
---|
| 397 | entities['245'] = 'õ'; |
---|
| 398 | entities['246'] = 'ö'; |
---|
| 399 | entities['247'] = '÷'; |
---|
| 400 | entities['248'] = 'ø'; |
---|
| 401 | entities['249'] = 'ù'; |
---|
| 402 | entities['250'] = 'ú'; |
---|
| 403 | entities['251'] = 'û'; |
---|
| 404 | entities['252'] = 'ü'; |
---|
| 405 | entities['253'] = 'ý'; |
---|
| 406 | entities['254'] = 'þ'; |
---|
| 407 | entities['255'] = 'ÿ'; |
---|
| 408 | } |
---|
| 409 | if (useQuoteStyle !== 'ENT_NOQUOTES') { |
---|
| 410 | entities['34'] = '"'; |
---|
| 411 | } |
---|
| 412 | if (useQuoteStyle === 'ENT_QUOTES') { |
---|
| 413 | entities['39'] = '''; |
---|
| 414 | } |
---|
| 415 | entities['60'] = '<'; |
---|
| 416 | entities['62'] = '>'; |
---|
| 417 | |
---|
| 418 | // ascii decimals to real symbols |
---|
| 419 | for (decimal in entities) { |
---|
| 420 | symbol = String.fromCharCode(decimal); |
---|
| 421 | hash_map[symbol] = entities[decimal]; |
---|
| 422 | } |
---|
| 423 | return hash_map; |
---|
| 424 | } |
---|
| 425 | function html_entity_decode( string, quote_style ) { |
---|
| 426 | // http://kevin.vanzonneveld.net |
---|
| 427 | var hash_map = {}, symbol = '', tmp_str = '', entity = ''; |
---|
| 428 | tmp_str = string.toString(); |
---|
| 429 | if (false === (hash_map = this.get_html_translation_table('HTML_ENTITIES', quote_style))) { |
---|
| 430 | return false; |
---|
| 431 | } |
---|
| 432 | for (symbol in hash_map) { |
---|
| 433 | entity = hash_map[symbol]; |
---|
| 434 | tmp_str = tmp_str.split(entity).join(symbol); |
---|
| 435 | } |
---|
| 436 | tmp_str = tmp_str.split(''').join(\"'\"); |
---|
| 437 | return tmp_str; |
---|
| 438 | } |
---|
| 439 | |
---|
[1544] | 440 | function getTypeSignature() { |
---|
| 441 | var elementoSelects = document.getElementsByTagName('select'); |
---|
[1873] | 442 | |
---|
| 443 | if ( elementoSelects[18].name == \"user[type_signature]\" ) { |
---|
| 444 | return elementoSelects[18]; |
---|
| 445 | } |
---|
| 446 | |
---|
[1544] | 447 | for(i=0;i<elementoSelects.length;i++){ |
---|
[1873] | 448 | if( elementoSelects[i].name == \"user[type_signature]\" ){ |
---|
| 449 | return elementoSelects[i]; |
---|
| 450 | } |
---|
[1544] | 451 | } |
---|
| 452 | return null; |
---|
| 453 | } |
---|
| 454 | |
---|
[1244] | 455 | function config_form(pObj,pHandler) |
---|
| 456 | { |
---|
[1544] | 457 | pObj.onclick=function () { |
---|
| 458 | if (getTypeSignature().value == \"html\" || getTypeSignature().value == \"htmld\") { |
---|
| 459 | return pHandler(\"text\"); |
---|
| 460 | } |
---|
| 461 | }; |
---|
| 462 | |
---|
[1244] | 463 | } |
---|
| 464 | document.getElementById('user_signature').value=html_entity_decode(document.getElementById('user_signature').innerHTML); |
---|
| 465 | |
---|
[1544] | 466 | function setDefaultTypeSignature() { |
---|
[1890] | 467 | if(getTypeSignature()){ |
---|
| 468 | getTypeSignature().options[0].value = '".$GLOBALS['phpgw']->preferences->default['expressoMail']['type_signature']."d'; |
---|
| 469 | if(getTypeSignature().value.indexOf('html')!=-1){ |
---|
| 470 | changeType(getTypeSignature().value); |
---|
| 471 | } |
---|
| 472 | }else{ |
---|
| 473 | changeType('".$GLOBALS['phpgw']->preferences->forced['expressoMail']['type_signature']."'); |
---|
| 474 | } |
---|
[1544] | 475 | } |
---|
| 476 | |
---|
[1605] | 477 | setTimeout('setDefaultTypeSignature();config_form(document.getElementsByName(\'submit\')[0],changeType);',2000); |
---|
[873] | 478 | </script>"); |
---|
| 479 | } |
---|
| 480 | ?> |
---|