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