Changeset 3913 for branches/2.2
- Timestamp:
- 03/25/11 12:36:46 (13 years ago)
- Location:
- branches/2.2/filemanager
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/filemanager/inc/class.uifilemanager.inc.php
r3897 r3913 394 394 395 395 396 if ( $_SESSION['phpgw_info']['user']['filemanager']['flush'] != 'flushed') {396 if ( $_SESSION['phpgw_info']['user']['filemanager']['flush'] != 'flushed' ) { 397 397 /* Flush journal-deleted */ 398 398 $this->bo->vfs->flush_journal(array( -
branches/2.2/filemanager/inc/class.vfs_functions.inc.php
r3019 r3913 66 66 // here local vars are created from the HTTP vars 67 67 @reset($GLOBALS['HTTP_POST_VARS']); 68 while( list($name,) = @each($GLOBALS['HTTP_POST_VARS']))69 { 70 $this->$name = $GLOBALS['HTTP_POST_VARS'][$name];68 while( list($name,) = @each($GLOBALS['HTTP_POST_VARS']) ) 69 { 70 $this->$name = base64_decode($GLOBALS['HTTP_POST_VARS'][$name]); 71 71 } 72 72 73 73 @reset($GLOBALS['HTTP_GET_VARS']); 74 while(list($name,) = @each($GLOBALS['HTTP_GET_VARS']) )74 while(list($name,) = @each($GLOBALS['HTTP_GET_VARS']) ) 75 75 { 76 76 $$name = $GLOBALS['HTTP_GET_VARS'][$name]; 77 77 $this->$name = $GLOBALS['HTTP_GET_VARS'][$name]; 78 79 78 } 80 79 81 80 $to_decode = array 82 81 ( 83 'op' => array('op' => ''),82 'op' => array('op' => ''), 84 83 'path' => array('path' => ''), 85 'file' => array('file' => ''),84 'file' => array('file' => ''), 86 85 'sortby' => array('sortby' => ''), 87 86 'messages' => array('messages' => ''), 88 87 'comment' => array('comment' => ''), 89 88 'from' => array('from' => ''), 90 'fileman' 89 'fileman' => array('fileman' => ''), 91 90 'to' => array('to' => '') 92 91 ); … … 122 121 } 123 122 } 124 123 125 124 // get appl. and user prefs 126 125 $pref = CreateObject('phpgwapi.preferences', $this->bo->userinfo['username']); … … 131 130 132 131 //always show name 133 134 132 $this->prefs[name] =1; 135 133 136 134 } 137 // String format is YYYY-MM-DD HH:MM 138 function dateString2timeStamp($string){ 135 136 // String format is YYYY-MM-DD HH:MM 137 function dateString2timeStamp($string) 138 { 139 139 return mktime($string[11].$string[12], 140 140 $string[14].$string[15], … … 145 145 $string[2].$string[3]); 146 146 } 147 147 148 function verifyLock($file,$relative){ 148 149 $ls_array = $this->bo->vfs->ls(array( … … 408 409 function rename() 409 410 { 410 if ($this->file) 411 { 412 if($badchar = $this->bo->bad_chars($this->to, True, True)) 413 { 414 echo "Error|badchar|".$badchar; 415 return false; 411 $_return = array(); 412 413 if ( $this->file ) 414 { 415 if( $badchar = $this->bo->bad_chars($this->to, True, True) ) 416 { 417 $_return[] = array( "error" => $badchar); 416 418 } 417 419 if(ereg("/", $this->to) || ereg("\\\\", $this->to)) 418 420 { 419 echo "Error|slashes"; 420 return false; 421 $_return[] = array( "error"=> "slashes"); 421 422 } 422 423 elseif(!$this->verifyLock($this->file,RELATIVE_CURRENT)) 423 echo "Error|editing"; 424 { 425 $_return[] = array( "error" => "editing" ); 426 } 424 427 elseif ($this->bo->vfs->mv(array( 425 'from' => $this->path.'/'.$this->file,426 'to' => $this->path.'/'.$this->to,427 'relatives' => array(RELATIVE_NONE,RELATIVE_NONE)428 'from' => $this->path.'/'.$this->file, 429 'to' => $this->path.'/'.$this->to, 430 'relatives' => array(RELATIVE_NONE,RELATIVE_NONE) 428 431 ))) 429 432 { 430 echo "True|".$this->file."|".$this->to;433 $_return[] = array( "true" => lang('renamed %1 to %2', $this->file ,$this->to ) ); 431 434 } 432 435 else 433 436 { 434 echo "Error|".$this->file."|".$this->to; 435 } 436 } 437 } 438 437 $_return[] = array("error" => $this->file . " " . $this->to ); 438 } 439 } 440 else 441 $_return[] = array("error" => "whitout file "); 442 443 echo serialize( $_return ); 444 } 439 445 } -
branches/2.2/filemanager/js/common_functions.js
r3888 r3913 31 31 } 32 32 33 function configEvents(pObj, pEvent, pHandler) 34 { 35 if ( typeof pObj == 'object' ) 36 { 37 if ( pEvent.substring(0, 2) == 'on' ) 38 pEvent = pEvent.substring(2, pEvent.length ); 39 40 if ( arguments.length == 3 ) 41 { 42 if ( pObj.addEventListener ) 43 pObj.addEventListener(pEvent, pHandler, false ); 44 else if ( pObj.attachEvent ) 45 pObj.attachEvent( 'on' + pEvent, pHandler ); 46 } 47 else if ( arguments.length == 4 ) 48 { 49 if ( pObj.removeEventListener ) 50 pObj.removeEventListener( pEvent, pHandler, false ); 51 else if ( pObj.detachEvent ) 52 pObj.detachEvent( 'on' + pEvent, pHandler ); 53 } 54 } 55 } 56 33 57 function maxFileSize() 34 58 { … … 172 196 var _html = Xtools.parse( Xtools.xml("upload_files"), "upload.xsl", pArgs ); 173 197 174 draw_window( _html, 490, 350, get_lang("upload files"), "newUpload" );198 draw_window( _html, 550, 350, get_lang("upload files"), "newUpload" ); 175 199 176 200 if( pArgs.emails_to != null ) -
branches/2.2/filemanager/js/draw_api.js
r3895 r3913 32 32 33 33 var _created = _xml.createElement('created'); 34 35 34 _created.appendChild( _xml.createTextNode(response[i]['created']) ); 35 _info.appendChild( _created ); 36 36 37 37 var _version = _xml.createElement('version'); 38 39 38 _version.appendChild( _xml.createTextNode(response[i]['version']) ); 39 _info.appendChild(_version); 40 40 41 41 var _who = _xml.createElement('who'); 42 43 42 _who.appendChild( _xml.createTextNode(response[i]['who']) ); 43 _info.appendChild( _who ); 44 44 45 45 var _operation = _xml.createElement('operation'); 46 47 46 _operation.appendChild( _xml.createTextNode( response[i]['operation']) ); 47 _info.appendChild( _operation ); 48 48 } 49 49 … … 69 69 70 70 cExecute_('./index.php?menuaction=filemanager.uifilemanager.history&file=' 71 71 + base64_encode(filename)+"&path="+base64_encode(currentPath), handlerLoadHistory ); 72 72 } 73 73 … … 151 151 152 152 var _optionsItens = document.createElement("div"); 153 _optionsItens.id = "fastMenuFileManager"; 154 _optionsItens.className = "x-menu"; 155 _optionsItens.style.zIndex = zIndex++; 156 _optionsItens.innerHTML = _itens; 157 _optionsItens.onclick = function(){ showHidden.hiddenObject(false); }; 158 _optionsItens.onmouseout = function(){ showHidden.hiddenObject(false); }; 159 _optionsItens.onmouseover = function(){ showHidden.hiddenObject(true); }; 153 _optionsItens.id = "fastMenuFileManager"; 154 _optionsItens.className = "x-menu"; 155 _optionsItens.style.zIndex = zIndex++; 156 _optionsItens.innerHTML = _itens; 157 _optionsItens.onclick = function(){ 158 showHidden.hiddenObject(false); 159 }; 160 _optionsItens.onmouseout = function(){ 161 showHidden.hiddenObject(false); 162 }; 163 _optionsItens.onmouseover = function(){ 164 showHidden.hiddenObject(true); 165 }; 160 166 161 162 163 167 showHidden.action('onmouseover', 'onmouseout', _optionsItens); 168 169 _parent.parentNode.appendChild( _optionsItens ); 164 170 } 165 171 … … 179 185 } 180 186 headerMsgLock = true; 181 182 183 184 187 headerDiv = document.getElementById("main_title"); 188 labelBefore = headerDiv.innerHTML; 189 headerDiv.innerHTML = '<table width=100% cellspacing="0" cellpadding="0" border="0"><tbody><tr><th width="40%"></th><th noWrap class="action_info_th">'+message+'</th><th width="40%"></th></tr></tbody></table>'; 190 setTimeout('headerMsgLock = false; document.getElementById("main_title").innerHTML = labelBefore;', 3000); 185 191 } 186 192 … … 276 282 newpage += fl.td+sp_hd+' id="name">'+get_lang('file name')+sp_tl; 277 283 newpage += fl.td+sp_hd+' id="folder">'+get_lang('folder')+sp_tl; 278 284 if (preferences.mime_type =='1') 279 285 newpage += fl.td+sp_hd+' id="mime_type">'+get_lang('mime type')+sp_tl; 280 286 if (preferences.size =='1') … … 314 320 } 315 321 folderList.prototype.createLine = function(file){ 316 var fl = folderList; 317 retBuff = '<tr id="line_'+file.name+'" onmouseout="clearTimeout(menuTimeout)" onmousedown="_dragArea.dragEl=this;_dragArea.operation=\'drag\'">'; 322 var fl = folderList; 323 retBuff = '<tr id="line_'+file.name+'" onmouseout="clearTimeout(menuTimeout)" onmousedown="_dragArea.dragEl=this;_dragArea.operation=\'drag\'">'; 324 retBuff += fl.td; 325 retBuff += '<input name="fileman" value="'+file.name+'" type="checkbox"></td>'; 326 if (permissions['private']) { 327 retBuff += '<td><div id="restrict_'+file.name+'" onclick="setRestricted(\''+file.name+'\')" '; 328 retBuff += 'style="background-image:url('+templatePath+'images/button_'+(file.pub == '1'?'lock':'unlock')+'.png);background-repeat: repeat-none;width:15px;height:12px;"></div></td>'; 329 } 330 else 331 retBuff += '<td></td>'; 332 333 switch (file.mime_type) 334 { 335 case 'text/html': 336 retBuff += '<td><a href="./index.php?menuaction=filemanager.uifilemanager.export&file='+base64_encode(file.name)+'&path='+base64_encode(currentPath)+'"><div class="exportButton" alt="'+get_lang('export')+'" title="'+get_lang('export')+'"></div></a></td>'; 337 break; 338 case 'application/zip': 339 retBuff += '<td><div class="exportButton" onclick="unarchive(\''+file.name+'\')" alt="'+get_lang('unarchive')+'" title="'+get_lang('unarchive')+'"></a></td>' 340 break; 341 default: 342 retBuff += '<td></td>'; 343 } 344 retBuff += fl.td+'<div style="background-image:url('+(file.icon)+'); background-repeat: no-repeat; height:16px; padding-left: 18px; overflow: hidden;">'; 345 if((file.mime_type).toUpperCase().indexOf('IMAGE') == 0) 346 var mousefunc = 'draw_card(\'preview\',\''+file.name+'\')' 347 else 348 var mousefunc = 'hide_card()'; 349 retBuff += '<span class="fileLink" onmouseover="'+mousefunc+'" id="name_'+file.name+'" onclick="window.open(\'./index.php?menuaction=filemanager.uifilemanager.view&file='+base64_encode(file.name)+'&path='+base64_encode(currentPath)+'\');">'+file.name+'</span></div></td>'; 350 if (preferences.mime_type =='1') retBuff += fl.td+file.mime_type+'</td>'; 351 if (preferences.size =='1') retBuff += fl.td+borkb(file.size)+'</td>'; 352 var now = new Date(); 353 var midnight = Date.parse(now.toDateString()); 354 var dtString = ""; 355 if (preferences.created =='1') { 356 var created = new Date(); 357 created.setTime(file.created*1000); 358 if (created.getTime() > midnight) 359 if (created.getMinutes() < 10 ) 360 dtString = created.getHours()+":0"+created.getMinutes(); 361 else 362 dtString = created.getHours()+":"+created.getMinutes(); 363 else { 364 dtString = (created.getDate() < 10) ? "0"+created.getDate()+"/" : created.getDate()+"/"; 365 dtString += (created.getMonth() < 9) ? "0" : ""; 366 dtString += (created.getMonth()+1)+"/"+created.getFullYear(); 367 } 368 retBuff += fl.td+dtString+'</td>'; 369 } 370 if (preferences.modified =='1'){ 371 var modified = new Date(); 372 modified.setTime(file.modified*1000); 373 if (file.modified != "") 374 if (modified.getTime() > midnight) 375 if (modified.getMinutes() < 10) 376 dtString = modified.getHours()+":0"+modified.getMinutes(); 377 else 378 dtString = modified.getHours()+":"+modified.getMinutes(); 379 else { 380 dtString = (modified.getDate() < 10) ? "0"+modified.getDate()+"/" : modified.getDate()+"/"; 381 dtString += (modified.getMonth() < 9) ? "0" : ""; 382 dtString += (modified.getMonth()+1)+"/"+modified.getFullYear(); 383 } 384 else 385 dtString = ""; 386 retBuff += fl.td+dtString+'</td>'; 387 } 388 if (preferences.owner =='1'){ 318 389 retBuff += fl.td; 319 retBuff += '<input name="fileman" value="'+file.name+'" type="checkbox"></td>'; 320 if (permissions['private']) { 321 retBuff += '<td><div id="restrict_'+file.name+'" onclick="setRestricted(\''+file.name+'\')" '; 322 retBuff += 'style="background-image:url('+templatePath+'images/button_'+(file.pub == '1'?'lock':'unlock')+'.png);background-repeat: repeat-none;width:15px;height:12px;"></div></td>'; 323 } 324 else 325 retBuff += '<td></td>'; 326 327 switch (file.mime_type) 328 { 329 case 'text/html': 330 retBuff += '<td><a href="./index.php?menuaction=filemanager.uifilemanager.export&file='+base64_encode(file.name)+'&path='+base64_encode(currentPath)+'"><div class="exportButton" alt="'+get_lang('export')+'" title="'+get_lang('export')+'"></div></a></td>'; 331 break; 332 case 'application/zip': 333 retBuff += '<td><div class="exportButton" onclick="unarchive(\''+file.name+'\')" alt="'+get_lang('unarchive')+'" title="'+get_lang('unarchive')+'"></a></td>' 334 break; 335 default: 336 retBuff += '<td></td>'; 337 } 338 retBuff += fl.td+'<div style="background-image:url('+(file.icon)+'); background-repeat: no-repeat; height:16px; padding-left: 18px; overflow: hidden;">'; 339 if((file.mime_type).toUpperCase().indexOf('IMAGE') == 0) 340 var mousefunc = 'draw_card(\'preview\',\''+file.name+'\')' 341 else 342 var mousefunc = 'hide_card()'; 343 retBuff += '<span class="fileLink" onmouseover="'+mousefunc+'" id="name_'+file.name+'" onclick="window.open(\'./index.php?menuaction=filemanager.uifilemanager.view&file='+base64_encode(file.name)+'&path='+base64_encode(currentPath)+'\');">'+file.name+'</span></div></td>'; 344 if (preferences.mime_type =='1') retBuff += fl.td+file.mime_type+'</td>'; 345 if (preferences.size =='1') retBuff += fl.td+borkb(file.size)+'</td>'; 346 var now = new Date(); 347 var midnight = Date.parse(now.toDateString()); 348 var dtString = ""; 349 if (preferences.created =='1') { 350 var created = new Date(); 351 created.setTime(file.created*1000); 352 if (created.getTime() > midnight) 353 if (created.getMinutes() < 10 ) 354 dtString = created.getHours()+":0"+created.getMinutes(); 355 else 356 dtString = created.getHours()+":"+created.getMinutes(); 357 else { 358 dtString = (created.getDate() < 10) ? "0"+created.getDate()+"/" : created.getDate()+"/"; 359 dtString += (created.getMonth() < 9) ? "0" : ""; 360 dtString += (created.getMonth()+1)+"/"+created.getFullYear(); 361 } 362 retBuff += fl.td+dtString+'</td>'; 363 } 364 if (preferences.modified =='1'){ 365 var modified = new Date(); 366 modified.setTime(file.modified*1000); 367 if (file.modified != "") 368 if (modified.getTime() > midnight) 369 if (modified.getMinutes() < 10) 370 dtString = modified.getHours()+":0"+modified.getMinutes(); 371 else 372 dtString = modified.getHours()+":"+modified.getMinutes(); 373 else { 374 dtString = (modified.getDate() < 10) ? "0"+modified.getDate()+"/" : modified.getDate()+"/"; 375 dtString += (modified.getMonth() < 9) ? "0" : ""; 376 dtString += (modified.getMonth()+1)+"/"+modified.getFullYear(); 377 } 378 else 379 dtString = ""; 380 retBuff += fl.td+dtString+'</td>'; 381 } 382 if (preferences.owner =='1'){ 383 retBuff += fl.td; 384 retBuff += '<div onmouseover="draw_card(\'user\',\''+file.owner+'\')">'+file.owner+'</div></td>'; 385 } 386 if (preferences.createdby_id =='1'){ 387 retBuff += fl.td; 388 retBuff += '<div onmouseover="draw_card(\'user\',\''+file.createdby_id+'\')">'+file.createdby_id+'</div></td>'; 389 } 390 if (preferences.modifiedby_id =='1'){ 391 retBuff += fl.td; 392 retBuff += '<div onmouseover="draw_card(\'user\',\''+file.modifiedby_id+'\')">'+file.modifiedby_id+'</div></td>'; 393 } 394 if (preferences.comment =='1') retBuff += fl.td+'<input id="'+file.name+'" class="inputComment" onkeydown="enterComments(event,this)" onclick="presetComments(this)" onblur="setComments(this)" value="'+(file.comment==null?'':file.comment)+'" alt="'+get_lang('Click to change comments')+'" title="'+get_lang('Click to change comments')+'"></input></td>'; 395 if (preferences.version =='1') retBuff += fl.td+'<span onclick="loadHistory(\''+file.name+'\')">'+file.version+'</span></td>'; 396 retBuff += "</tr>"; 397 return retBuff; 390 retBuff += '<div onmouseover="draw_card(\'user\',\''+file.owner+'\')">'+file.owner+'</div></td>'; 391 } 392 if (preferences.createdby_id =='1'){ 393 retBuff += fl.td; 394 retBuff += '<div onmouseover="draw_card(\'user\',\''+file.createdby_id+'\')">'+file.createdby_id+'</div></td>'; 395 } 396 if (preferences.modifiedby_id =='1'){ 397 retBuff += fl.td; 398 retBuff += '<div onmouseover="draw_card(\'user\',\''+file.modifiedby_id+'\')">'+file.modifiedby_id+'</div></td>'; 399 } 400 if (preferences.comment =='1') retBuff += fl.td+'<input id="'+file.name+'" class="inputComment" onkeydown="enterComments(event,this)" onclick="presetComments(this)" onblur="setComments(this)" value="'+(file.comment==null?'':file.comment)+'" alt="'+get_lang('Click to change comments')+'" title="'+get_lang('Click to change comments')+'"></input></td>'; 401 if (preferences.version =='1') retBuff += fl.td+'<span onclick="loadHistory(\''+file.name+'\')">'+file.version+'</span></td>'; 402 retBuff += "</tr>"; 403 return retBuff; 398 404 } 399 405 folderList.prototype.updateQuota = function(quotaSize,usedSpace){ … … 500 506 } 501 507 var pageContent = '<table><tbody><tr>'; 502 var createButton = function(name) { return '<td name="'+name+'" class="toolButton" onclick="toolbar.control(\''+name+'\');" title="'+name+'"><img src="'+templatePath+'images/button_'+name+'.png" alt="'+name+'"><small>'+get_lang(name.replace('_',' '))+'</small></td>'; } 508 var createButton = function(name) { 509 return '<td name="'+name+'" class="toolButton" onclick="toolbar.control(\''+name+'\');" title="'+name+'"><img src="'+templatePath+'images/button_'+name+'.png" alt="'+name+'"><small>'+get_lang(name.replace('_',' '))+'</small></td>'; 510 } 503 511 504 512 if (permissions['edit'] != 0){ … … 536 544 toolbar.prototype.control = function () 537 545 { 546 if( arguments.length == 0 ) 547 return; 548 538 549 var _arg = arguments[0]; 539 550 var _parent = ( arguments[1] ) ? arguments[1] : null ; 540 551 552 if( _arg == 'new' ) 553 { 554 var _address = ( document.location.toString() ).split("?"); 555 556 var itens = [ 557 [ get_lang('empty file'),'javascript:newEmptyFile()',templatePath+'images/group_close.gif', '' ], 558 [ get_lang('File from model'), _address[0]+"?menuaction=filemanager.uifilemanager.fileModels", templatePath+'images/group_close.gif', '' ], 559 [ get_lang('Upload'), 'javascript:newUpload()', templatePath+'images/group_close.gif', '' ], 560 [ get_lang('Advanced Upload'), 'javascript:newAdvancedUpload()', templatePath+'images/group_close.gif', '' ] 561 ]; 562 563 draw_menu( itens, _parent ); 564 } 565 566 if( _arg == 'rename' ) 567 { 568 var files = document.getElementsByName('fileman'); 569 var flagCheked = false; 570 571 for( var i = 0; i < files.length; i++ ) 572 { 573 if( files[i].checked ) 574 { 575 files[i].checked = false; 576 var _span = document.getElementById( 'name_' + files[i].value ); 577 var _parentNode = _span.parentNode; 578 _parentNode.style.height = (parseInt(_parentNode.style.height) + 4 ); 579 580 var _input = document.createElement("input"); 581 _input.id = 'input_'+files[i].value; 582 _input.size = "35"; 583 _input.zIndex = "99999"; 584 _input.value = _span.innerHTML; 585 _input.type = 'text'; 586 587 // OnkeyUp 588 configEvents( _input, "onkeyup", function(e) 589 { 590 if( e.keyCode == 13 ) 591 { 592 _parentNode.style.height = (parseInt(_parentNode.style.height) - 4 ); 593 594 handler.rename( _input, _span ); 595 } 596 }); 597 598 // Onblur 599 //configEvents( _input, "onblur", function() 600 //{ 601 //handler.rename( _input, _span ); 602 //}); 603 604 if( _parentNode != null ) 605 { 606 // Remove Span 607 if( _span != null ) 608 _parentNode.removeChild( _span ); 609 610 // Add Input 611 if( _input != null ) 612 _parentNode.appendChild( _input ); 613 } 614 615 _input.focus(); 616 } 617 } 618 } 619 541 620 switch ( _arg ) 542 621 { 543 case 'new': 544 545 address = document.location.toString(); 546 address = address.split("?"); 547 548 var itens = [ 549 [ get_lang('empty file'),'javascript:newEmptyFile()',templatePath+'images/group_close.gif', '' ], 550 [ get_lang('File from model'), address[0]+"?menuaction=filemanager.uifilemanager.fileModels", templatePath+'images/group_close.gif', '' ], 551 [ get_lang('Upload'), 'javascript:newUpload()', templatePath+'images/group_close.gif', '' ], 552 [ get_lang('Advanced Upload'), 'javascript:newAdvancedUpload()', templatePath+'images/group_close.gif', '' ] 553 ]; 554 555 draw_menu( itens, _parent ); 556 557 break; 558 559 case 'rename': 560 var one_checked = false; 561 files=document.getElementsByName('fileman'); 562 for (i = 0; i < files.length; i++) 563 if (files[i].checked){ 564 one_checked = true; 565 files[i].checked = false; 566 var nameLink = document.getElementById('name_'+files[i].value); 567 var inputName = document.createElement('INPUT'); 568 inputName.id = 'input_'+files[i].value; 569 var filename = nameLink.innerHTML; 570 inputName.value = filename; 571 inputName.onclick = function () { oldValue = inputName.value; } 572 inputName.onblur = function () { if (inputName.value == oldValue) handler.rename(); else cExecute_('./index.php?menuaction=filemanager.vfs_functions.rename&file='+base64_encode(this.id.substr(6))+'&to='+base64_encode(this.value)+"&path="+base64_encode(currentPath),handler.rename) }; 573 inputName.onkeydown=function (event) {if (event.keyCode == KEY_ENTER) this.blur(); }; 574 nameLink.parentNode.appendChild(inputName); 575 nameLink.parentNode.removeChild(nameLink); 576 } 577 if (!one_checked) 578 write_msg(get_lang('Please select a file')); 579 break; 622 580 623 case 'edit': 581 624 var one_checked = false; … … 600 643 var filesUrl = this.getCheckedFiles(); 601 644 cExecute_('./index.php?menuaction=filemanager.vfs_functions.delete&path='+ 602 645 base64_encode(currentPath)+filesUrl,handler.del); 603 646 break; 604 647 case 'archive': … … 618 661 var pswd = crypt.encode(password); 619 662 cExecute_('./index.php?menuaction=filemanager.vfs_functions.archive&pswd=' 620 663 + base64_encode(pswd.toString())+'&path='+base64_encode(currentPath)+filesUrl,handler.archive); 621 664 break; 622 665 case 'move_to': … … 640 683 { 641 684 var _lk = _xml.createElement('lk'); 642 643 644 685 _lk.setAttribute('function', "javascript:"+escape(_arg)+"('"+folders[i]+"','"+filesUrl+"'); close_window();" ); 686 _lk.appendChild( _xml.createTextNode( folders[i].replace( my_home_filemanager , get_lang("My folder") ) ) ); 687 _links.appendChild( _lk ); 645 688 } 646 689 … … 677 720 678 721 var itens = [ 679 680 681 682 683 684 722 [ get_lang('Preferences'), 'preferences/preferences.php?appname=filemanager', templatePath+'images/preferences.png', 'width="16px" height="16px"' ], 723 [ get_lang('Edit Folders'), 'javascript:editFolders()', templatePath+'images/button_createdir.png', 'width="16px" height="16px"'], 724 [ get_lang('Share Folders'), './index.php?menuaction=preferences.uiaclprefs.index&acl_app=filemanager', templatePath+'images/mime16_directory.png', 'width="16px" height="16px"'], 725 [ get_lang('View'), 'javascript:EditColumns()', templatePath+'images/editpaste.png', 'width="16px" height="16px"' ], 726 [ get_lang('Archive'), 'javascript:toolbar.control("archive")', templatePath+'images/button_zip.png', 'width="16px" height="16px"' ] 727 ]; 685 728 686 729 draw_menu( itens, _parent ); … … 701 744 { 702 745 cExecute_('./index.php?menuaction=filemanager.vfs_functions.unarchive&pswd=' 703 746 + base64_encode(password)+'&path='+base64_encode(currentPath)+'&file='+base64_encode(filename), handler.archive); 704 747 } 705 748 else … … 710 753 { 711 754 cExecute_( './index.php?menuaction=filemanager.vfs_functions.moveto&from=' 712 755 + base64_encode(currentPath)+'&to='+base64_encode(to)+filesUrl, handler.moveto ); 713 756 } 714 757 … … 716 759 { 717 760 cExecute_('./index.php?menuaction=filemanager.vfs_functions.copyto&from=' 718 761 + base64_encode(currentPath)+'&to='+base64_encode(to)+filesUrl, handler.copyto ); 719 762 } 720 763 … … 767 810 var parentDir_en = base64_encode( parentDir ); 768 811 cExecute_('./index.php?menuaction=filemanager.uifilemanager.createdir&path=' 769 812 + parentDir_en+'&filename='+base64_encode(name), handler.refreshDir); 770 813 771 814 currentPath = parentDir + '/' + name; … … 780 823 { 781 824 if ( confirm(get_lang('Do you really want to remove folder: %1?', 782 783 {825 Dfolder.replace(my_home_filemanager, get_lang("My folder"))), '') ) 826 { 784 827 var Dfolder_en = base64_encode( Dfolder ); 785 828 … … 806 849 { 807 850 var fd = _xml.createElement('name'); 808 809 810 851 fd.setAttribute('value', folders[i] ); 852 fd.appendChild( _xml.createTextNode(folders[i].replace(my_home_filemanager, get_lang("My folder"))) ); 853 _folders.appendChild(fd); 811 854 } 812 855 } … … 841 884 menu.style.top = (DocY+20)+"px"; 842 885 menu.width = "100%"; 843 menu.onmouseout = function () { menuTimeout = setTimeout("hide_card()",50);} 844 menu.onmouseover = function () { clearTimeout(menuTimeout); }; 886 menu.onmouseout = function () { 887 menuTimeout = setTimeout("hide_card()",50); 888 } 889 menu.onmouseover = function () { 890 clearTimeout(menuTimeout); 891 }; 845 892 menu.style.zIndex='1'; 846 893 document.getElementById('divAppbox').appendChild(menu); -
branches/2.2/filemanager/js/handler.js
r3897 r3913 4 4 { 5 5 var returnVal = data.split('|'); 6 6 7 7 if (returnVal[0] == 'False') 8 8 { … … 10 10 } 11 11 else 12 12 13 13 if (returnVal[0] == 'wpasswd') 14 15 16 17 18 19 20 21 14 { 15 write_error(get_lang('Wrong password')); 16 return; 17 } 18 else 19 write_msg(get_lang('Your operation was successfully executed')); 20 21 toolbar.control('reload'); 22 22 } 23 23 … … 25 25 { 26 26 var returnVal = data.split('|'); 27 27 28 28 if (returnVal[0] == 'NODIR') 29 29 write_error(get_lang('Could not copy file because no destination directory is given')); … … 149 149 } 150 150 151 function rename(data) 152 { 153 if ( data == null ) 154 { 155 var returnVal = new Array ("True",oldValue,oldValue); 156 } 157 else 158 var returnVal = data.split('|'); 159 160 if ( returnVal[0] == "True" ) 161 { 162 if ( returnVal[1] != returnVal[2] ) 163 write_msg(get_lang('Renamed %1 to %2',returnVal[1],returnVal[2])); 164 165 var nameLink = document.createElement('A'); 166 var inputName = document.getElementById('input_'+returnVal[1]); 167 var trFile = inputName.parentNode.parentNode.parentNode; 168 169 nameLink.innerHTML = returnVal[2]; 170 nameLink.href="./index.php?menuaction=filemanager.uifilemanager.view&file=" 171 + base64_encode(returnVal[2])+"&path="+base64_encode(currentPath); 172 nameLink.target = "_blank"; 173 nameLink.id = "name_"+returnVal[2]; 174 175 inputName.parentNode.appendChild(nameLink); 176 inputName.parentNode.removeChild(inputName); 177 trFile.innerHTML = trFile.innerHTML.replace(returnVal[1],returnVal[2]); 178 trFile.id = trFile.id.replace(returnVal[1],returnVal[2]); 179 toolbar.control('reload'); 180 } 181 else 182 { 183 if ( returnVal[1] == "badchar" ) 184 write_error(get_lang('File names cannot contain "%1"',returnVal[2])); 185 else if (returnVal[1] == "slashes") 186 write_error(get_lang('File names cannot contain \\ or /')); 187 else if (returnVal[1] == "editing") 188 write_error(get_lang('This file is being edited right now')); 189 else 190 write_error(get_lang('Could not rename %1 to %2', returnVal[1], returnVal[2])); 191 } 192 151 function rename() 152 { 153 var _handlerRename = function(data) 154 { 155 var _data = unserialize( data ); 156 157 for( var i = 0 ; i < _data.length; i++ ) 158 { 159 if( _data[i]['error'] ) 160 write_msg(_data[i]['error'] ); 161 162 if( _data[i]['true'] ) 163 write_msg(_data[i]['true'] ); 164 } 165 } 166 167 if( arguments.length > 1 ) 168 { 169 var _input = arguments[0]; 170 var _span = arguments[1] ; 171 var _parent = _input.parentNode; 172 173 _input.style.height = ( parseInt(_input.style.height) - 4 ); 174 175 _span.style.className = "fileLink"; 176 _span.innerHTML = _input.value; 177 178 if( _parent != null ) 179 { 180 // Remove Input 181 if( _input != null ) 182 _parent.removeChild( _input ); 183 184 // Add Span 185 if( _span != null ) 186 _parent.appendChild( _span ); 187 188 var url = './index.php?menuaction=filemanager.vfs_functions.rename'; 189 var params = 'file='+base64_encode(_input.id.substr(6))+'&to='+base64_encode(_input.value)+'&path='+base64_encode(currentPath); 190 191 cExecute_( url, _handlerRename , params ); 192 } 193 194 } 193 195 } 194 196 … … 197 199 if (data.indexOf("True") == 0) 198 200 { 199 200 201 returnVal = data.split('|'); 202 var img_lock = document.getElementById('restrict_'+returnVal[1]); 201 203 202 204 if (img_lock.style.backgroundImage.indexOf('button_unlock') > 0) … … 243 245 * response['max_postsize] = diretiva do PHP para POST_MAX_SIZE; 244 246 */ 245 247 246 248 write_msg( get_lang("ERROR: Use the advanced file sending!") ); 247 249 return false; … … 257 259 { 258 260 var _indexOf = response[i]['file'].toUpperCase().indexOf(_inputs[j].value.toUpperCase() ); 259 261 260 262 if( response[i]['file'].toUpperCase() === _inputs[j].value.toUpperCase() && _indexOf > -1 ) 261 263 { 262 264 _inputs[j].parentNode.setAttribute("erroUpload", "true"); 263 265 264 266 var _parent = _inputs[j].parentNode; 265 267 var _div = _parent.firstChild; … … 271 273 _div.style.cursor = "pointer"; 272 274 _div.onclick = function(){this.style.display = 'none';} ; 273 275 274 276 if( response[i]['size_max'] ) 275 277 { 276 278 _div.innerHTML = "<span style='font-weight:bold' >Erro </span>:: Tamanho do arquivo " 277 279 + borkb( response[i]['size'] ) + " - Permitido " + borkb( response[i]['size_max'] ); 278 280 } 279 281 else if( response[i]['badchar'] ) … … 291 293 else if( response[i]['undefined'] ) 292 294 { 293 _div.innerHTML = "<span style='font-weight:bold' > Arquivo Duplicado </span>:: " + response[i]['file'];295 _div.innerHTML = "<span style='font-weight:bold' >Erro </span>:: " + response[i]['undefined']; 294 296 } 295 297 else if( response[i]['filesize'] ) … … 298 300 } 299 301 } 302 else 303 { 304 write_msg( response[i]['undefined'] ); 305 _winBuild( "dwindownewUpload" , "remove" ); 306 } 300 307 } 301 308 } 302 309 } 303 310 304 311 for( var j = 0 ; j < _inputs.length ; j++ ) 305 312 { … … 335 342 336 343 window.handler = new handler; 337 344 338 345 })(); -
branches/2.2/filemanager/tp/expressowindow/xsl/upload.xsl
r3898 r3913 36 36 <span style="margin-right:{($width)-250}px;"> 37 37 <label style="margin-left:1px;"><xsl:value-of select="$lang_file"/></label> 38 <label style="margin-left:2 00px;"><xsl:value-of select="$lang_comment"/></label>38 <label style="margin-left:210px;"><xsl:value-of select="$lang_comment"/></label> 39 39 </span> 40 40 <br/>
Note: See TracChangeset
for help on using the changeset viewer.