Changeset 1556 for sandbox/filemanager/inc/class.uifilemanager.inc.php
- Timestamp:
- 10/29/09 14:46:20 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/filemanager/inc/class.uifilemanager.inc.php
r1543 r1556 47 47 //originally post_vars 48 48 // var $goto; 49 var $current_config; 49 50 var $goto_x; 50 51 var $download_x; … … 96 97 97 98 $this->t = $GLOBALS['phpgw']->template; 99 $c = CreateObject('phpgwapi.config','filemanager'); 100 $c->read_repository(); 101 $this->current_config = $c->config_data; 102 98 103 99 104 // here local vars are created from the HTTP vars … … 277 282 } 278 283 284 echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/global.js'></script>"; 279 285 echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/main.js'></script>"; 280 286 echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/common_functions.js'></script>"; … … 450 456 } 451 457 452 /* Update if they request it, or one out of 20 page loads */ 453 srand((double) microtime() * 1000000);454 if ($update || rand(0, 19) == 4)458 459 /* Update the vfs */ 460 if ($_GET['update'] == 'True') 455 461 { 456 462 $this->bo->vfs->update_real(array( 457 463 'string' => $this->path, 458 'relatives' => array(RELATIVE_ NONE)464 'relatives' => array(RELATIVE_ALL) 459 465 )); 460 466 } … … 575 581 } 576 582 $columns++; 577 583 $vars[usedSpace]='<input type="hidden" id="usedSpace" value="'.round(($this->usedSpace()/1024)/1024).'">'; 584 $vars[quotaSize]='<input type="hidden" id="quotaSize" value="'.$this->current_config['filemanager_quota_size'].'">'; 585 $vars[javascript]='<script src="filemanager/js/draw_api.js"></script>'; 578 586 $vars[toolbar0]=$this->toolbar('location'); 579 587 $vars[toolbar1]=$this->toolbar('list_nav'); … … 863 871 } 864 872 865 if($files['mime_type'] == 'Directory') 866 { 867 $usedspace += $fileinfo[0]; 868 } 869 else 870 { 871 $usedspace += $files['size']; 872 } 873 $usedspace += $files['size']; 873 874 874 875 $this->t->set_var('row_tr_color',''); … … 1054 1055 if($this->path != '/' && $this->path != $this->bo->fakebase && $this->can_add) 1055 1056 { 1056 1057 // $toolbar.='<td><img alt="spacer" src="'.$GLOBALS['phpgw']->common->image('filemanager','spacer').'" height="27" width="1"></td>';1058 // $toolbar.='<td><img alt="spacer" src="'.$GLOBALS['phpgw']->common->image('phpgwapi','buttonseparator').'" height="27" width="8"></td>';1059 // $toolbar.='<td><img alt="spacer" src="'.$GLOBALS['phpgw']->common->image('filemanager','spacer').'" height="27" width="1"></td>';1060 // $toolbar.=$this->inputImage('download','download',lang('Download'));1061 1057 // upload button 1062 $toolbar.=$this->inputImage('upload','upload',lang('Upload')); 1058 if (($this->usedSpace()*1024*1024) > $this->current_config['filemanager_quota_size']) 1059 $toolbar.=$this->inputImage('upload','upload',lang('Upload')); 1063 1060 } 1064 1061 $toolbar.='</tr></table>'; … … 1154 1151 } 1155 1152 1153 1154 function usedSpace(){ 1155 for($i = 0; $i != $this->numoffiles; $i++) 1156 $usedspace += $this->files_array[$i]['size']; 1157 return $usedspace; 1158 } 1159 1156 1160 // move to bo 1157 1161 # Handle File Uploads 1158 1162 function fileUpload() 1159 1163 { 1164 if (($this->usedSpace()*1024*1024) > $this->current_config['filemanager_quota_size']) 1165 echo lang('You exceded the quota'); 1166 else 1160 1167 if($this->path != '/' && $this->path != $this->bo->fakebase) 1161 1168 { … … 1187 1194 } 1188 1195 } 1189 $c = CreateObject('phpgwapi.config','filemanager'); 1190 $c->read_repository(); 1191 $current_config = $c->config_data; 1192 $max_size = $current_config['filemanager_Max_file_size']; 1196 $max_size = $this->current_config['filemanager_Max_file_size']; 1193 1197 if (! $max_size) 1194 1198 $max_size = ini_get('upload_max_filesize');
Note: See TracChangeset
for help on using the changeset viewer.