Changeset 1785
- Timestamp:
- 12/07/09 16:31:45 (14 years ago)
- Location:
- sandbox/filemanager
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/filemanager/inc/class.uifilemanager.inc.php
r1781 r1785 30 30 'getReturnExecuteForm' => True, 31 31 'dir_ls' => True, 32 'get_permissions' => True,33 32 'search' => True, 34 33 'uploadModel'=>True … … 559 558 $rights = $acl->get_rights($user_id); 560 559 } 561 echo$rights;560 return $rights; 562 561 } 563 562 function dir_ls() … … 565 564 // change dir to this->path 566 565 $this->bo->vfs->cd(array('string' => $this->path, 'relatives' => array(RELATIVE_NONE), 'relative' => False)); 567 566 $return['permissions'] = $this->get_permissions(); 567 $return['quota']['usedSpace'] = $this->bo->vfs->get_size(array( 568 'string' => $this->path, 569 'relatives' => array(RELATIVE_NONE) 570 )); 571 $quota = $this->bo->vfs->get_quota(array( 572 'string' => $this->path 573 )); 568 574 reset($this->files_array); 569 575 $this->readFilesInfo(); … … 602 608 else 603 609 array_multisort($temp, SORT_DESC, $output); 604 605 echo serialize($output); 610 $return['files'] = $output; 611 $return['quota']['quotaSize'] = ($quota*1024*1024); 612 echo serialize($return); 606 613 } 607 614 … … 614 621 if($this->numoffiles || $this->cwd) 615 622 { 616 $usedSpace = $this->bo->vfs->get_size(array(617 'string' => $this->path,618 'relatives' => array(RELATIVE_NONE)619 ));620 $quota = $this->bo->vfs->get_quota(array(621 'string' => $this->path622 ));623 624 $vars[usedSpace]='<input type="hidden" id="usedSpace" value="'.$usedSpace.'">';625 $vars[quotaSize]='<input type="hidden" id="quotaSize" value="'.($quota*1024*1024).'">';626 623 $vars[path]='<input type="hidden" id="currentPath" value="'.$this->path.'">'; 627 624 $vars[css]='<link rel="stylesheet" type="text/css" href="filemanager/templates/default/main.css">'; -
sandbox/filemanager/js/common_functions.js
r1784 r1785 6 6 contentFolders.childNodes[i].className = "l"; 7 7 el.className = "sl"; 8 cExecute('./index.php?menuaction=filemanager.uifilemanager.get_permissions&path='+base64_encode(path),loadPermissions);8 toolbar.control('reload'); 9 9 } 10 10 … … 298 298 return parseInt(size/kbyte) + 'KB'; 299 299 else if (size < gbyte) 300 return (size/mbyte).toFixed(1) + 'MB'; 300 if (size/mbyte > 100) 301 return (size/mbyte).toFixed(0) + 'MB'; 302 else 303 return (size/mbyte).toFixed(1) + 'MB'; 301 304 else 302 305 return parseInt(size/gbyte).toFixed(1) + 'GB'; -
sandbox/filemanager/js/draw_api.js
r1784 r1785 30 30 toolbar.load(); 31 31 loadPreferences(); 32 toolbar.control('reload');33 32 } 34 33 function close_window(){ … … 146 145 function initDrawApi(){ 147 146 currentPath = document.getElementById('currentPath').value; 148 cExecute('./index.php?menuaction=filemanager.uifilemanager.get_permissions&path='+base64_encode(currentPath),loadPermissions); 149 quotaSize = document.getElementById('quotaSize').value; 150 usedSpace = document.getElementById('usedSpace').value; 151 147 toolbar.control('reload'); 152 148 document.getElementById('divAppboxHeader').innerHTML = title_app; 153 154 if (parseInt(quotaSize) != 0)155 document.getElementById('content_quota').innerHTML = '<table width="102" cellspacing="0" cellpadding="0" border="0" id="table_quota"><tbody><tr><td width="102" nowrap="true" height="15" background="../phpgwapi/templates/default/images/dsunused.gif"><table cellspacing="0" cellpadding="0" border="0" style="width: '+parseInt((usedSpace/quotaSize)*100)+'%;"><tbody><tr><td height="15" class="dsused"/></tr></tbody></table></td><td nowrap="true" align="center"><span class="boxHeaderText">'+parseInt(usedSpace/quotaSize*100)+'% ('+(usedSpace/1024/1024).toFixed(1)+'M/'+(quotaSize/1024/1024)+'M)</span></td></tr></tbody></table></td></tr></table>';156 149 displayMessages(); 157 150 resizeDiv(); … … 282 275 return retBuff; 283 276 } 277 folderList.prototype.updateQuota = function(quotaSize,usedSpace){ 278 if (parseInt(quotaSize) != 0) 279 document.getElementById('content_quota').innerHTML = '<table width="102" cellspacing="0" cellpadding="0" border="0" id="table_quota"><tbody><tr><td width="102" nowrap="true" height="15" background="../phpgwapi/templates/default/images/dsunused.gif"><table cellspacing="0" cellpadding="0" border="0" style="width: '+parseInt((usedSpace/quotaSize)*100)+'%;"><tbody><tr><td height="15" class="dsused"/></tr></tbody></table></td><td nowrap="true" align="center"><span class="boxHeaderText">'+parseInt(usedSpace/quotaSize*100)+'% ('+borkb(usedSpace)+'/'+borkb(quotaSize)+')</span></td></tr></tbody></table></td></tr></table>'; 280 } 284 281 folderList.prototype.drawFiles = function(data){ 285 282 var fl = folderList; 286 var files = unserialize(data); 283 var returnData = unserialize(data); 284 loadPermissions(returnData.permissions); 285 var files = returnData.files; 287 286 fl.init(); 288 287 fl.clear(); … … 334 333 } 335 334 fl.drawStripes(); 335 folderList.updateQuota(returnData.quota.quotaSize,returnData.quota.usedSpace); 336 336 } 337 337 folderList.prototype.drawStripes = function(){ -
sandbox/filemanager/js/global.js
r1748 r1785 7 7 8 8 var currentPath = ""; 9 var quotaSize;10 var usedSpace;11 9 12 10 var templatePath = './filemanager/templates/default/'; -
sandbox/filemanager/templates/default/main.tpl
r1737 r1785 1 1 <!-- BEGIN filemanager_header --> 2 2 {css} 3 {usedSpace}4 {quotaSize}5 3 {path} 6 4 <table id="main_table" width="100%" cellspacing="0" cellpadding="0" border="0">
Note: See TracChangeset
for help on using the changeset viewer.