Changeset 1005
- Timestamp:
- 06/18/09 09:24:17 (15 years ago)
- Location:
- trunk/expressoMail1_2
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/inc/class.imap_functions.inc.php
r1000 r1005 1052 1052 if (($file_type == 'image/jpeg') || ($file_type == 'image/pjpeg') || ($file_type == 'image/gif') || ($file_type == 'image/png')) { 1053 1053 $img = "<IMG id='".$msg_folder.";;".$msg_number.";;".$i.";;".$msg->pid[$msg_number][$index].";;".$msg->encoding[$msg_number][$index]."' style='border:2px solid #fde7bc;padding:5px' title='".$this->functions->getLang("Click here do view (+)")."'src=./inc/show_thumbs.php?file_type=".$file_type."&msg_num=".$msg_number."&msg_folder=".$msg_folder."&msg_part=".$msg->pid[$msg_number][$index].">"; 1054 $href = "<a onMouseDown='save_image(event,this )' href='#".$msg_folder.";;".$msg_number.";;".$i.";;".$msg->pid[$msg_number][$index].";;".$msg->encoding[$msg_number][$index]."' onClick=\"window.open('./inc/show_img.php?msg_num=".$msg_number."&msg_folder=".$msg_folder."&msg_part=".$msg->pid[$msg_number][$index]."','mywindow','width=700,height=600,scrollbars=yes');\">". $img ."</a>";1054 $href = "<a onMouseDown='save_image(event,this,\"".$file_type."\")' href='#".$msg_folder.";;".$msg_number.";;".$i.";;".$msg->pid[$msg_number][$index].";;".$msg->encoding[$msg_number][$index]."' onClick=\"window.open('./inc/show_img.php?msg_num=".$msg_number."&msg_folder=".$msg_folder."&msg_part=".$msg->pid[$msg_number][$index]."','mywindow','width=700,height=600,scrollbars=yes');\">". $img ."</a>"; 1055 1055 $thumbs_array[] = $href; 1056 1056 } … … 2032 2032 2033 2033 // Build Uploading Attachments!!! 2034 if (count($attachments)) 2035 foreach ($attachments as $attach) 2036 $mail->AddAttachment($attach['tmp_name'], $attach['name'], "base64", $this->get_file_type($attach['name'])); // optional name 2034 $sizeof_attachments = count($attachments); 2035 if ($sizeof_attachments) 2036 foreach ($attachments as $numb => $attach){ 2037 if ($numb == ($sizeof_attachments-1) && $params['insertImg'] == 'true'){ // Auto-resize image 2038 list($width, $height,$image_type) = getimagesize($attach['tmp_name']); 2039 switch ($image_type) 2040 { 2041 case 1: $image_big = imagecreatefromgif($attach['tmp_name']); break; 2042 case 2: $image_big = imagecreatefromjpeg($attach['tmp_name']); break; 2043 case 3: $image_big = imagecreatefrompng($attach['tmp_name']); break; 2044 case 6: 2045 include_once("gd_functions.php"); 2046 $image_big = imagecreatefrombmp($attach['tmp_name']); break; 2047 default: 2048 $mail->AddAttachment($attach['tmp_name'], $attach['name'], "base64", $this->get_file_type($attach['name'])); 2049 break; 2050 } 2051 header('Content-type: image/jpeg'); 2052 $max_resolution = $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['image_size']; 2053 $max_resolution = ($max_resolution==""?'65536':$max_resolution); 2054 if ($width < $max_resolution && $height < $max_resolution){ 2055 $new_width = $width; 2056 $new_height = $height; 2057 } 2058 else if ($width > $max_resolution){ 2059 $new_width = $max_resolution; 2060 $new_height = $height*($new_width/$width); 2061 } 2062 else { 2063 $new_height = $max_resolution; 2064 $new_width = $width*($new_height/$height); 2065 } 2066 $image_new = imagecreatetruecolor($new_width, $new_height); 2067 imagecopyresampled($image_new, $image_big, 0, 0, 0, 0, $new_width, $new_height, $width, $height); 2068 $tmpDir = ini_get("session.save_path"); 2069 $_file = "cid_image_".base_convert(microtime(), 10, 36).".dat"; 2070 imagejpeg($image_new,$tmpDir.$_file, 85); 2071 $mail->AddAttachment($tmpDir.$_file, $attach['name'], "base64", $this->get_file_type($tmpDir.$_file)); 2072 } 2073 else 2074 $mail->AddAttachment($attach['tmp_name'], $attach['name'], "base64", $this->get_file_type($attach['name'])); 2075 // optional name 2076 } 2077 2037 2078 2038 2079 -
trunk/expressoMail1_2/inc/gotodownload.php
r178 r1005 1 1 <? 2 if (! array_key_exists('phpgw_info', $_SESSION)) 3 exit; 4 2 5 $msg_number = $_GET['msg_number']; 3 6 $idx_file = $_GET['idx_file']; … … 25 28 $mbox_stream = imap_open("{".$imap_server.":".$imap_port.$imap_options."}".$msg_folder, $username, $password); 26 29 $fileContent = imap_fetchbody($mbox_stream, $msg_number, $msg_part, FT_UID); 27 include("class.imap_attachment.inc.php"); 28 $imap_attachment = new imap_attachment(); 29 $a = $imap_attachment->download_attachment($mbox_stream, $msg_number); 30 31 $filename = $a[$idx_file]['name']; 30 /* 31 *Removed by Bug #546 32 *include("class.imap_attachment.inc.php"); 33 *$imap_attachment = new imap_attachment(); 34 *$a = $imap_attachment->download_attachment($mbox_stream, $msg_number); 35 *$filename = $a[$idx_file]['name']; 36 */ 37 $filename = $newfilename; 32 38 } 33 39 else -
trunk/expressoMail1_2/inc/hook_settings.inc.php
r1002 r1005 67 67 create_check_box(lang('Use shortcuts?'),'use_shotcuts',''); 68 68 create_check_box(lang('Auto save draft'),'auto_save_draft',''); 69 $default = array( 70 '65536' => lang('unlimited'), 71 '640' => '640', 72 '768' => '768', 73 '800' => '800', 74 '1024' => '1024', 75 '1080' => '1080' 76 ); 77 78 create_select_box(lang('What is the maximum size of embedded images')."?",'image_size',$default,''); 69 79 70 80 $default = array( -
trunk/expressoMail1_2/js/common_functions.js
r1000 r1005 557 557 function preferences_mail(){ 558 558 if(preferences.type_signature && preferences.type_signature == 'html') { 559 location.href="../preferences/preferences.php?appname=expressoMail ";559 location.href="../preferences/preferences.php?appname=expressoMail1_2"; 560 560 } 561 561 else { -
trunk/expressoMail1_2/js/main.js
r1000 r1005 1437 1437 } 1438 1438 1439 function save_msg(border_id){ 1439 function save_msg(border_id,withImage){ 1440 if (typeof(withImage) == 'undefined') 1441 withImage = false; 1442 1440 1443 var rt_checkbox = Element('viewsource_rt_checkbox'); 1441 1444 if (rt_checkbox == null) … … 1451 1454 var folder_id = openTab.imapBox[border_id]; 1452 1455 else 1453 var 1456 var folder_id = "INBOX/"+draftsfolder; 1454 1457 1455 1458 if (folder_id == 'INBOX') // and folder name from border … … 1482 1485 input_msgid.name = "msg_id"; 1483 1486 input_msgid.value = message_id; 1487 var input_insertImg = document.createElement("INPUT"); 1488 input_insertImg.style.display='none'; 1489 input_insertImg.name = "insertImg"; 1490 input_insertImg.value = withImage; 1491 1484 1492 1485 1493 if (is_ie){ … … 1493 1501 form.appendChild(input_folder); 1494 1502 form.appendChild(input_msgid); 1503 form.appendChild(input_insertImg); 1495 1504 1496 1505 cExecuteForm ("$this.imap_functions.save_msg", form, handler_save_msg,border_id); … … 1795 1804 1796 1805 // Save image file. 1797 function save_image(e,thumb){ 1806 function save_image(e,thumb,file_type){ 1807 file_type = file_type.replace("/","."); 1798 1808 thumb.oncontextmenu = function(e) { 1799 1809 return false; … … 1804 1814 if(_button == 2 || _button == 3) { 1805 1815 var _params = _target.id.split(";;"); 1806 download_attachments(_params[0],_params[1],_params[2],_params[3],_params[4] );1816 download_attachments(_params[0],_params[1],_params[2],_params[3],_params[4],file_type); 1807 1817 } 1808 1818 } -
trunk/expressoMail1_2/js/messages_proxy.js
r1000 r1005 51 51 } 52 52 else { 53 return "javascript:download_attachments('"+info_msg.msg_folder+"','"+info_msg.msg_number+"',"+numero_ordem_anexo+",'"+info_msg.attachments[numero_ordem_anexo].pid+"','"+info_msg.attachments[numero_ordem_anexo].encoding+"' )";53 return "javascript:download_attachments('"+info_msg.msg_folder+"','"+info_msg.msg_number+"',"+numero_ordem_anexo+",'"+info_msg.attachments[numero_ordem_anexo].pid+"','"+info_msg.attachments[numero_ordem_anexo].encoding+"','"+info_msg.attachments[numero_ordem_anexo].name+"')"; 54 54 } 55 55 } -
trunk/expressoMail1_2/js/rich_text_editor.js
r811 r1005 306 306 var save_link = document.getElementById("save_message_options_"+id); 307 307 //save_link.onclick = function () {}; 308 save_msg(id );308 save_msg(id,true); 309 309 setTimeout("RichTextEditor.insertImgHtml("+id+")",1000); 310 310 }
Note: See TracChangeset
for help on using the changeset viewer.