- Timestamp:
- 12/20/10 17:42:25 (14 years ago)
- Location:
- branches/2.2/filemanager
- Files:
-
- 4 added
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/filemanager/inc/after_upload.php
r3386 r3610 41 41 } 42 42 43 echo "<script type='text/javascript'> 44 top.close_window(); 45 top.write_msg(top.get_lang('Uploaded files sucessfully')); 46 top.toolbar.control('reload'); 47 </script>"; 43 echo "<script type='text/javascript' src='../js/after_upload.js'></script>"; 48 44 49 45 ?> -
branches/2.2/filemanager/inc/class.uifilemanager.inc.php
r3591 r3610 831 831 { 832 832 $response = $_SESSION['response']; 833 $_SESSION['response'] = null; 833 834 unset($_SESSION['response']); 835 834 836 echo $response; 835 return;836 837 } 837 838 838 839 function showUploadboxes() 839 840 { 840 $GLOBALS['phpgw_info']['flags'] = array 841 ( 842 'currentapp' => 'filemanager', 843 'noheader' => True, 844 'nonavbar' => True, 845 'nofooter' => True, 846 'noappheader' => True 847 ); 848 $GLOBALS['phpgw']->common->phpgw_header(); 849 850 $this->t->set_file(array('upload' => 'upload.tpl')); 851 $this->t->set_block('upload','upload_header','upload_header'); 852 $this->t->set_block('upload','row','row'); 853 $this->t->set_block('upload','upload_footer','upload_footer'); 854 855 if($this->path != '/' && $this->path != $this->bo->fakebase) 856 { 857 $vars[max_size]=lang('Note: Uploaded is limited to %1MB',($this->current_config['filemanager_Max_file_size'])); 858 $vars[form_action]=$GLOBALS[phpgw]->link('/filemanager/inc/upload.php'); 859 //$vars[form_action]=$GLOBALS[phpgw]->link('/index.php','menuaction=filemanager.uifilemanager.index'); 860 $vars[path]=$this->path; 861 $vars[lang_file]=lang('File'); 862 $vars[lang_comment]=lang('Comment'); 863 $vars[lang_advanced_upload]=lang('Advanced Upload'); 864 $vars[num_upload_boxes]=1; 865 $this->t->set_var($vars); 866 $this->t->pparse('out','upload_header'); 867 868 $this->t->set_var('row_tr_color',$tr_color); 869 $this->t->parse('rows','row'); 870 $this->t->pparse('out','row'); 871 872 $vars[lang_upload]=lang('Upload files'); 873 $vars[change_upload_boxes].=lang('Show') . ' '; 874 $this->t->set_var($vars); 875 $this->t->pparse('out','upload_footer'); 876 } 841 $var = array( 842 'change_upload_boxes' => lang('Show'), 843 'form_action' => $GLOBALS[phpgw]->link('/filemanager/inc/upload.php'), 844 'lang_file' => lang('File'), 845 'lang_comment' => lang('Comment'), 846 'lang_advanced_upload' => lang('Advanced Upload'), 847 'lang_upload' => lang('Upload files'), 848 'max_size' => lang('Note: Uploaded is limited to %1MB',( $this->current_config['filemanager_Max_file_size'])), 849 'path' => $this->path 850 ); 851 852 print( serialize($var) ); 853 877 854 } 878 855 -
branches/2.2/filemanager/inc/upload.php
r3415 r3610 1 1 <?php 2 2 3 require_once '../../header.session.inc.php'; 4 3 5 /* This single file is used to increase upload_max_filesize and post_max_size using .htaccess*/ 4 6 if(!isset($GLOBALS['phpgw_info'])){ … … 19 21 $path = $_POST['path']; 20 22 $notifUser = $_POST['notifTo']; 21 $show_upload_boxes = count($_FILES['upload_file']['name'])-1; 22 23 function create_summaryImage($file){ 23 $show_upload_boxes = count($_FILES['upload_file']['name']); 24 $filesUpload = $_FILES['upload_file']; 25 26 function create_summaryImage($file) 27 { 24 28 list($width, $height,$image_type) = getimagesize($file); 29 25 30 switch($image_type) 26 31 { 27 case 1: 28 $image_big = imagecreatefromgif($file); 29 break; 30 case 2: 31 $image_big = imagecreatefromjpeg($file); 32 break; 33 case 3: 34 $image_big = imagecreatefrompng($file); 35 break; 36 default: 37 return false; 38 } 32 case 1: 33 $image_big = imagecreatefromgif($file); 34 break; 35 case 2: 36 $image_big = imagecreatefromjpeg($file); 37 break; 38 case 3: 39 $image_big = imagecreatefrompng($file); 40 break; 41 default: 42 return false; 43 } 44 39 45 $max_resolution = 48; 40 if ($width > $height){ 46 47 if ($width > $height) 48 { 41 49 $new_width = $max_resolution; 42 50 $new_height = $height*($new_width/$width); 43 51 } 44 else { 52 else 53 { 45 54 $new_height = $max_resolution; 46 55 $new_width = $width*($new_height/$height); 47 56 } 57 48 58 $image_new = imagecreatetruecolor($new_width, $new_height); 49 59 imagecopyresampled($image_new, $image_big, 0, 0, 0, 0, $new_width, $new_height, $width, $height); … … 59 69 $command = "nice -n19 ".$current_config['filemanager_antivirus_command']; 60 70 for($i = 0; $i != $show_upload_boxes; $i++) 71 { 61 72 $command .= " ".$_FILES['upload_file']['tmp_name'][$i]; 62 $return=0; 73 } 74 75 $return = 0; 76 63 77 exec("bash -c ".escapeshellcmd(escapeshellarg($command)),$output,$return); 78 64 79 if ($return == 1) 65 80 { … … 70 85 71 86 if($path != '/') 87 { 72 88 for($i = 0; $i != $show_upload_boxes; $i++) 73 89 { … … 184 200 } 185 201 } 186 187 if(count($notifUser) > 0) 202 } 203 204 if( count($notifUser) > 0 ) 188 205 { 189 206 define('PHPGW_INCLUDE_ROOT','../../'); … … 200 217 $mail->FromName = $GLOBALS['phpgw_info']['user']['fullname']; 201 218 $mail->IsHTML(true); 202 foreach ($notifUser as $userMail) 219 220 foreach( $notifUser as $userMail ) 203 221 { 204 222 $mail->AddAddress($userMail); 205 223 $mail->Subject = lang("Filemanager notification"); 206 $mail->Body = lang("The user %1, sent the file \"%2\" (type %3) and asked to notify you.",$GLOBALS['phpgw_info']['user']['fullname'],$_FILES['upload_file']['name'][0],$_FILES['upload_file']['type'][0])."<br>"; 207 $mail->Body .= lang("Comments by user: %1",$_POST['upload_comment'][0])."<br>"; 208 $mail->Body .= lang("The file can be accessed by: %1","<a href=\"".$GLOBALS['phpgw']->link("index.php").">link</a><br>"); 209 // $mail->Body .= lang("The file can be accessed by: %1","<a href=\"".$GLOBALS['phpgw']->link("../index.php","menuaction=filemanager.uifilemanager.view&file=" . urlencode(base64_encode($_FILES['upload_file']['name'][0]))."&path=".urlencode(base64_encode($path)))."\">link</a><br>"); 210 if(!$mail->Send()) { 224 225 $body = "<div style='font-size: 9pt !important;'>"; 226 $body .= lang("The user %1 sent the following files", "<span style='font-weight: bold;'>" . $GLOBALS['phpgw_info']['user']['fullname'] . "</span>") . "<br/><br/>"; 227 228 foreach( $filesUpload['name'] as $key => $name ) 229 $body .= "<div style='font-weight: bold;'> - " . $name ." ( " . $filesUpload['type'][$key] . " )</div>"; 230 231 $body .= "<div style='margin-top:25px;'>".lang("To view the files %1", "<a href='../filemanager/index.php'>".lang("Click here")."</a>")."</div>"; 232 $body .= "</div>"; 233 234 $mail->Body = $body; 235 236 if( !$mail->Send() ) 237 { 211 238 $return[] = $mail->ErrorInfo; 212 239 } 213 240 } 214 } 215 216 if (count($return) > 0){ 217 $_SESSION['response'] = serialize($return); 218 } 219 else 220 $_SESSION['response'] = serialize( array( 0 => 'Ok' ) ); 241 242 unset( $filesUpload ); 243 244 } 245 246 $_SESSION['response'] = ( count($return) > 0 ) ? serialize($return) : serialize( array( 0 => 'Ok' ) ); 247 221 248 ?> -
branches/2.2/filemanager/inc/uploadApp.php
r3386 r3610 14 14 } 15 15 $appletParameters = array( 16 17 16 'maxFileSize' => '5G', 17 'maxChunkSize' => '1600000', 18 18 'archive' => '../tp/juploader/wjhk.jupload.jar', 19 19 'afterUploadURL' => 'after_upload.php', -
branches/2.2/filemanager/js/common_functions.js
r3569 r3610 20 20 } 21 21 22 function loadXtools() 23 { 24 if( Xtools == null ) 25 Xtools = new xtools( path_filemanager + "tp/expressowindow/" ); 26 } 27 22 28 function check(element) 23 29 { … … 83 89 } 84 90 85 function newUpload(data) 86 { 87 if (data == null) 88 { 89 address = document.location.toString(); 90 address = address.split("?"); 91 var url = address[0]+"?menuaction=filemanager.uifilemanager.showUploadboxes&path="+base64_encode(currentPath); 92 cExecute_(url,newUpload); 93 } 94 else{ 95 draw_window(data); 96 } 91 function newUpload( ) 92 { 93 var _newUpload = function(data) 94 { 95 loadXtools(); 96 97 var pArgs = unserialize(data); 98 pArgs.lang_add_file = get_lang("Add file"); 99 pArgs.lang_click_here = get_lang("Click here"); 100 pArgs.lang_more_files = get_lang("More files"); 101 pArgs.height = 210; 102 pArgs.path_filemanager = path_filemanager; 103 pArgs.width = 450; 104 105 var _html = Xtools.parse( Xtools.xml("upload_files"), "upload.xsl", pArgs ); 106 107 draw_window( _html, 490, 350, get_lang("upload files") ); 108 } 109 110 address = document.location.toString(); 111 address = address.split("?"); 112 var url = address[0]+"?menuaction=filemanager.uifilemanager.showUploadboxes&path="+base64_encode(currentPath); 113 cExecute_( url, _newUpload ); 97 114 } 98 115 99 116 function newAdvancedUpload() 100 117 { 101 for ( i=0; i < navigator.plugins.length; i++)102 { 103 if ( navigator.plugins[i].name.match('Java'))118 for ( var i = 0 ; i < navigator.plugins.length; i++ ) 119 { 120 if ( navigator.plugins[i].name.match('Java') ) 104 121 { 105 122 close_window(); 106 draw_window("<iframe width=\"515\" height=\"320\" src='/filemanager/inc/uploadApp.php?id="+parseInt(Math.random()*Math.pow(10,15))+"'></iframe>",530,345); 123 124 loadXtools(); 125 126 var pArgs = 127 { 128 'iframe_width' : 515, 129 'iframe_height' : 320, 130 'iframe_src' : path_filemanager + "inc/uploadApp.php?id="+parseInt(Math.random()*Math.pow(10,15)) 131 }; 132 133 var _html = Xtools.parse( Xtools.xml("upload_files_advanced"), "uploadAdvanced.xsl", pArgs); 134 135 draw_window( _html, 530, 345, get_lang("Advanced Upload") ); 136 107 137 return; 108 138 } … … 243 273 else 244 274 { 245 if( Xtools == null ) 246 Xtools = new xtools( path_filemanager + "tp/expressowindow/" ); 247 275 loadXtools(); 276 248 277 var pTools = 249 278 { … … 316 345 317 346 } 318 function borkb(size){ 319 kbyte = 1024; 320 mbyte = kbyte*1024; 321 gbyte = mbyte*1024; 322 if (!size) 323 size = 0; 324 if (size < kbyte) 325 return size + 'B'; 326 else if (size < mbyte) 327 return parseInt(size/kbyte) + 'KB'; 328 else if (size < gbyte) 329 if (size/mbyte > 100) 330 return (size/mbyte).toFixed(0) + 'MB'; 331 else 332 return (size/mbyte).toFixed(1) + 'MB'; 333 else 334 return (size/gbyte).toFixed(1) + 'GB'; 335 } 336 function addNewInput(){ 337 var line = document.getElementById('uploadOption'); 338 var newElement = document.createElement('TR'); 339 var newElement2 = document.createElement('TD'); 340 var newElement3 = document.createElement('TD'); 341 newElement2.innerHTML = '<input onchange="javascript:addNewInput();" maxlength="255" name="upload_file[]" type="file">'; 342 newElement3.innerHTML = '<input name="upload_comment[]" type="text">'; 343 newElement.appendChild(newElement2); 344 newElement.appendChild(newElement3); 345 line.parentNode.appendChild(newElement); 346 document.getElementById('show_upload_boxes').value +=1; 347 } 348 349 function sendNotification(){ 350 var winEl = document.getElementById('uploadOption').parentNode; 351 var emailTo = document.createElement("INPUT"); 352 emailTo.name="notifTo[]"; 353 emailTo.type="text"; 354 emailTo.size="38"; 355 var labelTo = document.createElement("SPAN"); 356 labelTo.innerHTML = get_lang("Send Notification email to:"); 357 winEl.insertBefore(labelTo,document.getElementById('uploadOption')); 358 winEl.insertBefore(emailTo,document.getElementById('uploadOption')); 359 } 360 361 function sendFiles(){ 347 348 function borkb(size) 349 { 350 var kbyte = 1024; 351 var mbyte = kbyte*1024; 352 var gbyte = mbyte*1024; 353 354 if (!size) 355 { 356 size = 0; 357 } 358 359 if (size < kbyte) 360 { 361 return size + 'B'; 362 } 363 else if (size < mbyte) 364 { 365 return parseInt(size/kbyte) + 'KB'; 366 } 367 else if (size < gbyte) 368 { 369 if ( size/mbyte > 100) 370 return (size/mbyte).toFixed(0) + 'MB'; 371 else 372 return (size/mbyte).toFixed(1) + 'MB'; 373 } 374 else 375 { 376 return (size/gbyte).toFixed(1) + 'GB'; 377 } 378 } 379 380 function addNewInput() 381 { 382 var newElement = document.createElement('div'); 383 newElement.innerHTML = '<input maxlength="255" name="upload_file[]" type="file" style="margin-right:5px;" />' + 384 '<input name="upload_comment[]" type="text" style="margin-right:2px;" />' + 385 '<span style="color:red; cursor:pointer;" onclick="removeInput(this);">'+get_lang('delete')+'</span>'; 386 387 document.getElementById('uploadOption').parentNode.appendChild(newElement); 388 } 389 390 function removeInput() 391 { 392 if( arguments.length > 0 ) 393 { 394 var _parent = arguments[0].parentNode; 395 396 _parent.parentNode.removeChild(_parent); 397 } 398 } 399 400 function sendNotification() 401 { 402 var _div = document.getElementById('sendNotifcation'); 403 404 loadXtools(); 405 406 var pArgs = 407 { 408 'lang_delete' : get_lang('delete'), 409 'lang_send_notification_email_to' : get_lang("Send Notification email to:") 410 }; 411 412 _div.innerHTML += Xtools.parse( Xtools.xml("teste"), "send_notification.xsl", pArgs); 413 } 414 415 function sendFiles() 416 { 362 417 cExecuteForm_(document.getElementById('form_up'),handler.upload); 363 418 document.getElementById('button_up').style.visibility = "hidden"; -
branches/2.2/filemanager/js/draw_api.js
r3591 r3610 722 722 } 723 723 else 724 alert( "É necessário escolher uma pasta !");724 alert( get_lang("You must choose a folder !") ); 725 725 } 726 726 else -
branches/2.2/filemanager/setup/phpgw_pt-br.lang
r3591 r3610 1 1 %1 already exists as a file filemanager pt-br %1 já existe como um arquivo 2 2 application filemanager pt-br Aplicação 3 Add file filemanager pt-br Adicionar arquivo 3 4 back to file manager filemanager pt-br Voltar ao Gerenciador de Arquivos 4 5 cancel editing %1 without saving filemanager pt-br Cancelar edição %1 sem salvar … … 34 35 This property will change the visibility of all users that have access to this file, continue? filemanager pt-br Esta propriedade altera visibilidade dos usuários que estão compartilhados, deseja continuar? 35 36 Click to change comments filemanager pt-br Clique para alterar comentários 37 Click here filemanager pt-br Clique aqui 36 38 All files created sucessfuly filemanager pt-br Arquivos foram criados com sucesso 37 39 created by filemanager pt-br Criado por … … 94 96 move to filemanager pt-br Mover Para 95 97 move to: filemanager pt-br Mover para: 98 More files filemanager pt-br Mais arquivos 96 99 %1 files moved successfuly filemanager pt-br %1 arquivos movidos com sucesso 97 100 File moved successfuly filemanager pt-br Arquivo movido com sucesso … … 142 145 upload fields filemanager pt-br campos de envio de arquivos 143 146 upload files filemanager pt-br Enviar Arquivos 144 Advanced Upload filemanager pt-br Envio Avançado ...147 Advanced Upload filemanager pt-br Envio Avançado 145 148 Uploaded files sucessfully filemanager pt-br Arquivos enviados com sucesso 146 149 use new experimental filemanager? filemanager pt-br Usar o novo Gerenciador de Arquivos experimental? … … 181 184 you do not have access to %1 filemanager pt-br Você não tem acesso a %1 182 185 Your Home Dir did not exist, eGroupWare created a new one. filemanager pt-br Seu Diretório Home não existia, foi criado um novo. 186 You must choose a folder ! filemanager pt-br Você deve escolher uma pasta ! 183 187 Filemanager notification filemanager pt-br Gerenciador de arquivos notifica 184 188 The user %1, sent the file "%2" (type %3) and asked to notify you. filemanager pt-br O usuário %1, enviou o arquivo "%2" (tipo %3) e solicitou o notificar. 189 The user %1 sent the following files" filemanager pt-br O usuário %1 enviou os seguintes arquivos 190 To view the files %1" filemanager pt-br Para ver os arquivos %1 185 191 Comments by user: %1 filemanager pt-br Comentários do usuário: %1 186 192 The file can be accessed by: %1 filemanager pt-br O arquivo pode ser acessado pelo endereço: %1 187 Send Notification email to: filemanager pt-br Enviar email de notifica çãoa:193 Send Notification email to: filemanager pt-br Enviar email de notificação para:
Note: See TracChangeset
for help on using the changeset viewer.