Changeset 3888
- Timestamp:
- 03/22/11 18:15:51 (12 years ago)
- Location:
- branches/2.2/filemanager
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/filemanager/inc/class.uifilemanager.inc.php
r3885 r3888 32 32 'dir_ls' => True, 33 33 'search' => True, 34 'setFileMaxSize' => True, 34 35 'get_folders_list' => True, 35 36 'showUploadboxes' => True, … … 455 456 } 456 457 458 function setFileMaxSize() 459 { 460 $maxSize = $_POST['maxFileSize']; 461 $file = "setFileMaxSize.php"; 462 $writeFile = "<?php $"."SET_FILE_MAX_SIZE="."\"".base64_encode(serialize($maxSize))."\""." ?>"; 463 $filename = dirname(__FILE__).'/'.$file; 464 $content = $writeFile; 465 466 if ( !$handle = fopen($filename, 'w+') ) 467 return false; 468 469 if (fwrite($handle, $content) === FALSE) 470 return false; 471 472 fclose($handle); 473 474 return true; 475 } 476 457 477 function get_permissions() { 458 478 /* get permissions */ -
branches/2.2/filemanager/js/common_functions.js
r3879 r3888 29 29 { 30 30 element.firstChild.firstChild.checked = true; 31 } 32 33 function maxFileSize() 34 { 35 if( arguments.length > 0 ) 36 { 37 var _document = arguments[0]; 38 var _maxFileSize = ""; 39 40 for(var i = 0 ; i < _document.forms[0].elements.length ; i++ ) 41 { 42 if( _document.forms[0].elements[i].type == "text" ) 43 { 44 var _name = (_document.forms[0].elements[i].name).toLowerCase(); 45 46 if( _name.indexOf('filemanager_max_file_size') > - 1 ) 47 _maxFileSize = trim(_document.forms[0].elements[i].value); 48 } 49 } 50 51 var handlerSubmit = function(data) 52 { 53 _document.forms[0].submit.click(); 54 } 55 56 if( _maxFileSize != '' ) 57 { 58 cExecute_( './index.php?menuaction=filemanager.uifilemanager.setFileMaxSize', handlerSubmit,'maxFileSize=' + _maxFileSize ); 59 } 60 else 61 { 62 alert('É necessário informar um valor !'); 63 return false; 64 } 65 } 66 } 67 68 function trim(inputString) 69 { 70 if ( typeof inputString != "string" ) 71 return inputString; 72 73 var retValue = inputString; 74 var ch = retValue.substring(0, 1); 75 76 while (ch == " ") 77 { 78 retValue = retValue.substring(1, retValue.length); 79 ch = retValue.substring(0, 1); 80 } 81 82 ch = retValue.substring(retValue.length-1, retValue.length); 83 84 while (ch == " ") 85 { 86 retValue = retValue.substring(0, retValue.length-1); 87 ch = retValue.substring(retValue.length-1, retValue.length); 88 } 89 90 while (retValue.indexOf(" ") != -1) 91 { 92 retValue = retValue.substring(0, retValue.indexOf(" ")) + retValue.substring(retValue.indexOf(" ")+1, retValue.length); 93 } 94 95 return retValue; 31 96 } 32 97
Note: See TracChangeset
for help on using the changeset viewer.