Changeset 1829
- Timestamp:
- 12/15/09 09:13:57 (14 years ago)
- Location:
- sandbox/filemanager
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/filemanager/inc/class.vfs_functions.inc.php
r1704 r1829 25 25 'editComment'=> True, 26 26 'rename'=>True, 27 'delete'=>True 27 'delete'=>True, 28 'summary' => True 28 29 ); 29 30 … … 214 215 215 216 } 216 function download()217 function summary() 217 218 { 218 219 if($this->file) 219 { 220 //$GLOBALS['phpgw']->browser->content_header($this->file);221 header ("Content-Type: application/octet-stream");222 header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");220 { 221 header('Content-Type: image/gif'); 222 $expires = 60*60*24*15; /* 15 days */ 223 header("Cache-Control: maxage=".$expires); 223 224 header("Pragma: public"); 224 header("Expires: 0"); 225 header ("Content-Disposition: attachment; filename=\"". addslashes($this->file)."\""); 226 echo $this->bo->vfs->read(array('string' => $this->file)); 225 header("Expires: ".gmdate('D, d M Y H:i:s', time()+$expires)); 226 echo $this->bo->vfs->summary(array('path' => $this->path, 227 'string' => $this->file 228 )); 227 229 $GLOBALS['phpgw']->common->phpgw_exit(); 228 230 } 229 231 } 232 230 233 function delete(){ 231 234 foreach($this->fileman as $filename) -
sandbox/filemanager/inc/upload.php
r1804 r1829 20 20 $path = base64_decode($_POST['path']); 21 21 $show_upload_boxes = count($_FILES['upload_file']['name'])-1; 22 23 24 function create_summaryImage($file){ 25 list($width, $height,$image_type) = getimagesize($file); 26 switch($image_type) 27 { 28 case 1: 29 $image_big = imagecreatefromgif($file); 30 break; 31 case 2: 32 $image_big = imagecreatefromjpeg($file); 33 break; 34 case 3: 35 $image_big = imagecreatefrompng($file); 36 break; 37 default: 38 return; 39 } 40 $max_resolution = 48; 41 if ($width > $height){ 42 $new_width = $max_resolution; 43 $new_height = $height*($new_width/$width); 44 } 45 else { 46 $new_height = $max_resolution; 47 $new_width = $width*($new_height/$height); 48 } 49 $image_new = imagecreatetruecolor($new_width, $new_height); 50 imagecopyresampled($image_new, $image_big, 0, 0, 0, 0, $new_width, $new_height, $width, $height); 51 ob_start(); 52 imagegif($image_new); 53 $content = ob_get_clean(); 54 return $content; 55 } 22 56 23 57 /* Its much faster test all files only one time */ … … 97 131 else 98 132 { 99 133 100 134 if ($bo->vfs->cp(array( 101 135 'from'=> $_FILES['upload_file']['tmp_name'][$i], … … 103 137 'relatives' => array(RELATIVE_NONE|VFS_REAL, RELATIVE_ALL) 104 138 ))) 139 { 105 140 $bo->vfs->set_attributes(array( 106 141 'string'=> $_FILES['upload_file']['name'][$i], … … 111 146 ) 112 147 )); 148 if (!(strpos(strtoupper($_FILES['upload_file']['type'][$i]),'IMAGE') === FALSE)) 149 { 150 $content = create_summaryImage($_FILES['upload_file']['tmp_name'][$i]); 151 $bo->vfs->set_summary(array( 152 'string'=> $_FILES['upload_file']['name'][$i], 153 'relatives' => array(RELATIVE_ALL), 154 'summary'=> $content 155 )); 156 } 157 } 113 158 else{ 114 159 $return[] = lang('Error:').lang('Your quota has exceeded the limit'); … … 129 174 'relatives' => array(RELATIVE_ALL), 130 175 'attributes'=> array( 131 132 176 'mime_type' => $_FILES['upload_file']['type'][$i], 177 'comment' => stripslashes($_POST['upload_comment'][$i]) 133 178 ) 134 179 )); -
sandbox/filemanager/js/draw_api.js
r1815 r1829 239 239 retBuff += '<td></td>'; 240 240 retBuff += fl.td+'<img src="'+(file.icon)+'">'; 241 retBuff += '<a id="name_'+file.name+'" href="./index.php?menuaction=filemanager.uifilemanager.view&file='+base64_encode(file.name)+'&path='+base64_encode(currentPath)+'" target="_blank">'+file.name+'</a> </td>'; 241 if((file.mime).toUpperCase().indexOf('IMAGE') == 0) 242 var mousefunc = 'draw_card(\''+file.name+'\')' 243 else 244 var mousefunc = 'document.getElementById(\'menu_newFilepreview\').style.visibility = \'hidden\''; 245 retBuff += '<a onmouseover="'+mousefunc+'" id="name_'+file.name+'" href="./index.php?menuaction=filemanager.uifilemanager.view&file='+base64_encode(file.name)+'&path='+base64_encode(currentPath)+'" target="_blank">'+file.name+'</a> </td>'; 242 246 if (preferences.mime_type =='1') retBuff += fl.td+file.mime+'</td>'; 243 247 if (preferences.size =='1') retBuff += fl.td+borkb(file.size)+'</td>'; … … 531 535 var toolbar = new toolbar(); 532 536 537 538 function draw_card(filename){ 539 draw_window_card('preview','./index.php?menuaction=filemanager.vfs_functions.summary&file='+base64_encode(filename)+"&path="+base64_encode(currentPath)); 540 } 541 542 function draw_window_card(id,url){ 543 var menu = document.getElementById('menu_newFile'+id); 544 if (menu == null){ 545 menu = document.createElement('DIV'); 546 menu.className = 'menubox'; 547 menu.id = "menu_newFile"+id; 548 menu.style.left = DocX; 549 menu.style.top = (DocY+20)+"px"; 550 menu.width = "100%"; 551 menu.innerHTML = '<img src="'+url+'">'; 552 menu.onmouseout = function () { menuTimeout = setTimeout("document.getElementById('menu_newFile"+id+"').style.visibility = 'hidden'",50);} 553 menu.onmouseover = function () { clearTimeout(menuTimeout); }; 554 menu.style.zIndex='1'; 555 document.getElementById('divAppboxHeader').appendChild(menu); 556 } 557 else 558 { 559 menu.style.left = DocX; 560 menu.style.top = (DocY+20)+"px"; 561 menu.innerHTML = '<img src="'+url+'">'; 562 } 563 menu.style.visibility = 'visible'; 564 clearTimeout(menuTimeout); 565 menuTimeout = setTimeout("document.getElementById('menu_newFile"+id+"').style.visibility = 'hidden'",5000); 566 } 567 -
sandbox/filemanager/templates/default/main.css
r1804 r1829 17 17 cursor: pointer; 18 18 position: absolute; 19 width: 160px;19 /* width: 160px;*/ 20 20 text-align: left; 21 21 line-height:150%;
Note: See TracChangeset
for help on using the changeset viewer.