Changeset 1726
- Timestamp:
- 12/01/09 10:54:27 (14 years ago)
- Files:
-
- 1 added
- 1 deleted
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/filemanager/inc/.htaccess
r1704 r1726 1 php_value post_max_size 1 G2 php_value upload_max_filesize 1 G1 php_value post_max_size 1300M 2 php_value upload_max_filesize 1300M -
sandbox/filemanager/inc/class.uiconfig.inc.php
r1678 r1726 32 32 33 33 $GLOBALS['phpgw']->common->phpgw_header(); 34 include('load_lang.php'); 34 35 echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/connector.js'></script>"; 35 36 echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/common_functions.js'></script>"; -
sandbox/filemanager/inc/class.uifilemanager.inc.php
r1719 r1726 31 31 'dir_ls' => True, 32 32 'get_permissions' => True, 33 'search' => True, 33 34 'uploadModel'=>True 34 35 ); … … 52 53 var $groups_applications; 53 54 54 //originally post_vars55 // var $goto;56 55 var $current_config; 57 var $ goto_x;56 var $dirs; 58 57 var $to; 59 58 var $changedir; // for switching dir. 60 59 var $cdtodir; // for switching dir. 61 // var $createdir;62 60 var $newfile_or_dir; 63 61 var $newdir_x; … … 65 63 var $createfile_var; 66 64 var $move_to_x; 67 // var $copy_to;68 65 var $copy_to_x; 69 66 var $edit_x; … … 252 249 253 250 } 254 255 251 } 256 252 function fileModels() … … 407 403 } 408 404 409 # Get their readable groups to be used throughout the script 410 $acl = array(); 411 $groups = array(); 412 $acl = $GLOBALS['phpgw']->acl->get_ids_for_location($GLOBALS['phpgw_info']['user']['account_id'],1,'filemanager'); 413 if (is_array($acl)) 414 foreach($acl as $key => $value){ 415 $info = array(); 416 $info = $GLOBALS['phpgw']->accounts->get_account_data($value); 417 $groups[$key]['account_id'] = $value; 418 $groups[$key]['account_lid'] = $info[$value]['lid']; 419 $groups[$key]['account_name'] = $info[$value]['firstname']; 420 $groups[$key]['account_lastname'] = $info[$value]['lastname']; 421 $groups[$key]['account_fullname'] = $info[$value]['fullname']; 422 } 423 $this->readable_groups = array(); 424 while(list($num, $account) = each($groups)) 425 { 426 if($this->bo->vfs->acl_check(array('owner_id' => $account['account_id'],'operation' => PHPGW_ACL_READ))) 427 { 428 $this->readable_groups[$account['account_lid']] = Array('account_id' => $account['account_id'], 'account_name' => $account['account_lid']); 429 } 430 } 431 405 $this->update_groups(); 432 406 $this->groups_applications = array(); 433 407 … … 692 666 693 667 // selectbox for change/move/and copy to 694 $ dirs=$this->all_other_directories_options();695 foreach($ dirs as $elem)668 $this->dirs=$this->all_other_directories(); 669 foreach($this->dirs as $elem) 696 670 $vars[folders].='<br><span onclick="load(\''.$elem['directory'].$elem['name'].'\')" class="l" onmouseover="this.style.border=\'1px solid black\'" onmouseout="this.style.border=\'1px solid transparent\'">'.$elem['name'].'</span>'; 697 671 698 672 699 // copy and move buttons 700 //if($this->path != '/' && $this->path != $this->bo->fakebase){} 701 702 $dirs=$this->all_other_directories_options(); 703 foreach($dirs as $dir) 673 $this->dirs=$this->all_other_directories(); 674 foreach($this->dirs as $dir) 704 675 if((($dir['directory'] . $dir['name']) != $this->path) && $this->bo->vfs->file_exists(array('string' => $dir['directory'] . $dir['name'],'relatives' => array(RELATIVE_NONE)))) 705 676 { … … 1054 1025 1055 1026 if(!in_array($mime_type,$editable)){ 1056 echo lang('Impossbile to edit this file'); 1057 return False; 1027 $this->messages[] = lang('Error:').lang('Impossible to edit this file'); 1028 $this->readFilesInfo(); 1029 $this->fileListing(); 1030 return; 1058 1031 } 1059 1032 } … … 1106 1079 else 1107 1080 { 1108 echo lang('Could not save %1', $this->path.'/'.$this->edit_file);1109 1081 $this->messages[]=lang('Could not save %1', $this->path.'/'.$this->edit_file); 1110 1082 } … … 1236 1208 ))) 1237 1209 { 1238 echo lang("You have no permission to access this file"); 1239 return false; 1210 $this->messages[] = lang("You have no permission to access this file"); 1211 header('Location:'.$this->encode_href('inc/index.php?menuaction=filemanager.uifilemanager.index','&path='.base64_encode($this->bo->homedir))); 1212 1213 return; 1240 1214 } 1241 1215 if($this->file) //FIXME … … 1247 1221 'nofiles' => True 1248 1222 )); 1249 if ($ls_array[0]['size'] > 4194304){1250 header('Location:'.$this->encode_href('inc/download.php','file='.base64_encode($this->file).'&path='.base64_encode($this->path)));1251 return;1252 }1253 1223 if($ls_array[0]['mime_type']) 1254 1224 { … … 1265 1235 /*Note: if you put application/octet-stream you force download */ 1266 1236 header('Content-type: ' . $mime_type); 1267 header('Content-disposition: filename="' . $this->file . '"');//FIXME1237 header('Content-disposition: filename="' . addslashes($this->file) . '"'); 1268 1238 Header("Pragma: public"); 1269 1239 } 1270 1240 else 1271 1241 { 1272 $GLOBALS['phpgw']->browser->content_header($this->file,$mime_type );//FIXME1273 } 1274 1275 1276 echo $this->bo->vfs->read(array(1277 'string' => $this->path.'/'.$this->file,//FIXME1278 'relatives' => array(RELATIVE_NONE)1279 )); 1242 $GLOBALS['phpgw']->browser->content_header($this->file,$mime_type,$ls_array[0]['size']); 1243 } 1244 $this->bo->vfs->print_content(array( 1245 'string' => $this->path.'/'.$this->file, 1246 'relatives' => array(RELATIVE_NONE) 1247 ) 1248 ); 1249 1280 1250 $GLOBALS['phpgw']->common->phpgw_exit(); 1281 1251 } … … 1299 1269 $formats = array('text/html'); 1300 1270 if(!in_array($mime_type,$formats)){ 1301 echo lang('Imposs bile to export this file');1271 echo lang('Impossible to export this file'); 1302 1272 return False; 1303 1273 } … … 1318 1288 1319 1289 //give back an array with all directories except current and dirs that are not accessable 1320 function all_other_directories _options()1290 function all_other_directories() 1321 1291 { 1322 1292 # First we get the directories in their home directory … … 1382 1352 } 1383 1353 1354 function update_groups() 1355 { 1356 # Get their readable groups to be used throughout the script 1357 $acl = array(); 1358 $groups = array(); 1359 $acl = $GLOBALS['phpgw']->acl->get_ids_for_location($GLOBALS['phpgw_info']['user']['account_id'],1,'filemanager'); 1360 if (is_array($acl)) 1361 foreach($acl as $key => $value){ 1362 $info = array(); 1363 $info = $GLOBALS['phpgw']->accounts->get_account_data($value); 1364 $groups[$key]['account_id'] = $value; 1365 $groups[$key]['account_lid'] = $info[$value]['lid']; 1366 $groups[$key]['account_name'] = $info[$value]['firstname']; 1367 $groups[$key]['account_lastname'] = $info[$value]['lastname']; 1368 $groups[$key]['account_fullname'] = $info[$value]['fullname']; 1369 } 1370 $this->readable_groups = array(); 1371 while(list($num, $account) = each($groups)) 1372 { 1373 if($this->bo->vfs->acl_check(array('owner_id' => $account['account_id'],'operation' => PHPGW_ACL_READ))) 1374 { 1375 $this->readable_groups[$account['account_lid']] = Array('account_id' => $account['account_id'], 'account_name' => $account['account_lid']); 1376 } 1377 } 1378 1379 } 1380 function search() 1381 { 1382 /* TODO this is a primitive search */ 1383 $this->update_groups(); 1384 $this->dirs = $this->all_other_directories(); 1385 $path = $this->path; 1386 if (strlen($this->text) > 3) 1387 { 1388 $this->text = strtoupper($this->text); 1389 foreach($this->dirs as $elem) 1390 { 1391 $this->path = $elem['directory'].$elem['name']; 1392 reset($this->files_array); 1393 $this->readFilesInfo(); 1394 for($i = 0; $i < count($this->files_array); $i++) 1395 { 1396 $comment = strtoupper($this->files_array[$i]['comment']); 1397 $name = strtoupper($this->files_array[$i]['name']); 1398 if (strstr($name,$this->text) || 1399 strstr($comment,$this->text) ) 1400 $return[$this->files_array[$i]['directory'].$name] = $this->files_array[$i]; 1401 } 1402 if (count($return) > 50) 1403 { 1404 $return = array_slice($return,0,50); 1405 break; 1406 } 1407 } 1408 } 1409 echo serialize(array_values($return)); 1410 } 1411 1384 1412 /* seek icon for mimetype else return an unknown icon */ 1385 1413 function mime_icon($mime_type, $size=16) -
sandbox/filemanager/js/common_functions.js
r1719 r1726 383 383 384 384 function EditColumns(param){ 385 if (param == 'close'){ 385 if (param == 'close') 386 { 386 387 var menu = document.getElementById('menu_col_pref'); 387 388 menu.parentNode.removeChild(menu); 388 389 return; 389 390 } 390 if(param == 'save'){ 391 if(param == 'save') 392 { 391 393 var checkBoxes = document.getElementsByName('prefView'); 392 394 var url=""; … … 424 426 document.getElementById('divAppboxHeader').appendChild(menu); 425 427 } 428 429 430 function searchFile(){ 431 var inputText = document.getElementById('em_message_search'); 432 if (inputText.value.length < 4) 433 { 434 alert(get_lang('Your search must have at least 4 characters')); 435 return; 436 } 437 cExecute('/index.php?menuaction=filemanager.uifilemanager.search&text='+inputText.value,drawSearch); 438 } -
sandbox/filemanager/js/draw_api.js
r1719 r1726 11 11 document.onmousemove = getPointer; 12 12 13 function close_window(){ 14 var menu = document.getElementById('dwindow'); 15 menu.style.visibility = 'hidden' 16 } 17 function draw_window(htmlData){ 18 var menu = document.getElementById('dwindow'); 19 buttonClose = '<input value="'+get_lang('close')+'" onclick="close_window()" type="button">'; 20 if (!menu){ 21 menu = document.createElement('DIV'); 22 menu.id = "dwindow"; 23 menu.style.left = DocX - 500; 24 menu.style.width = "auto"; 25 menu.style.top = DocY; 26 menu.className = 'menubox'; 27 menu.style.zIndex='1'; 28 menu.innerHTML = htmlData+buttonClose; 29 document.getElementById('divAppboxHeader').appendChild(menu); 30 } 31 else{ 32 menu.innerHTML = htmlData+buttonClose; 33 menu.style.visibility = 'visible'; 34 } 35 36 } 13 37 14 38 function draw_menu(id,elements){ … … 125 149 return parseInt(size/gbyte).toFixed(1) + 'GB'; 126 150 } 151 function drawSearch(data){ 152 var fmFileWindow = document.getElementById('fmFileWindow'); 153 var files = unserialize(data); 154 if (files == null) 155 { 156 alert(get_lang('No results found')); 157 return 158 } 159 var toolbar = document.getElementById('fmMenu'); 160 toolbar.innerHTML = ""; 161 fmFileWindow.innerHTML = ""; 162 var newpage; 163 var td_hd = '<td style="padding-left: 2px; padding-right: 2px;" valign="middle">'; 164 var sp_hd = '<span name="head" style="cursor: pointer; cursor: hand;"'; 165 var sp_tl = '</span></td>'; 166 newpage = '<table cellspacing="0" cellpadding="2"><tbody><tr class="message_header">'; 167 newpage += td_hd+'<input onclick="selectAll(this)" type="checkbox"></td><td></td><td></td>'; 168 newpage += td_hd+sp_hd+' id="name">'+get_lang('file name')+sp_tl; 169 newpage += td_hd+sp_hd+' id="folder">'+get_lang('folder')+sp_tl; 170 if (preferences.mime_type =='1') 171 newpage += td_hd+sp_hd+' id="mime">'+get_lang('mime type')+sp_tl; 172 if (preferences.size =='1') 173 newpage += td_hd+sp_hd+' id="size">'+get_lang('size')+'</a>'+sp_tl; 174 if (preferences.created =='1') 175 newpage += td_hd+sp_hd+' id="created">'+get_lang('created')+'</a>'+sp_tl; 176 if (preferences.modified =='1') 177 newpage += td_hd+sp_hd+' id="modified">'+get_lang('modified')+'</a>'+sp_tl; 178 if (preferences.createdby_id =='1') 179 newpage += td_hd+sp_hd+' id="creatdby">'+get_lang('created by')+'</a>'+sp_tl; 180 if (preferences.modifiedby_id =='1') 181 newpage += td_hd+sp_hd+' id="modifdby">'+get_lang('modified by')+'</a>'+sp_tl; 182 if (preferences.comment =='1') 183 newpage += td_hd+sp_hd+' id="comm">'+get_lang('comment')+'</a>'+sp_tl; 184 if (preferences.version =='1') newpage += td_hd+sp_hd+' id="vers">'+get_lang('version')+'</a>'+sp_tl+'</tr>'; 185 186 var classTr = "tr_msg_read"; 187 for (var i=0; i < files.length; i++) 188 { 189 newpage += '<tr class="'+classTr+'">'+td_hd; 190 newpage += '<input name="fileman" value="'+files[i].name+'" type="checkbox"></td>'; 191 newpage += '<td></td><td></td>'; 192 newpage += td_hd+'<img src="'+templatePath+'images/mime16_unknown.png">'; 193 newpage += '<a id="name_'+files[i].name+'" href="/index.php?menuaction=filemanager.uifilemanager.view&file='+base64_encode(files[i].name)+'&path='+base64_encode(files[i].directory)+'" target="_blank">'+files[i].name+'</a> </td>'; 194 newpage += td_hd+files[i].directory+'</td>'; 195 if (preferences.mime_type =='1') newpage += td_hd+files[i].mime_type+'</td>'; 196 if (preferences.size =='1') newpage += td_hd+borkb(files[i].size)+'</td>'; 197 if (preferences.created =='1') newpage += td_hd+files[i].created+'</td>'; 198 if (preferences.modified =='1') newpage += td_hd+files[i].modified+'</td>'; 199 if (preferences.createdby_id =='1') newpage += td_hd+files[i].createdby_id+'</td>'; 200 if (preferences.modifiedby_id =='1') newpage += td_hd+files[i].modifiedby_id+'</td>'; 201 if (files[i].comment == null || files[i].comment.length == 0) 202 files[i].comment = "<"+get_lang("no comments")+">"; 203 if (preferences.comment =='1') newpage += td_hd+'<span id="'+files[i].name+'">'+files[i].comment+'</span></td>'; 204 if (preferences.version =='1') newpage += td_hd+'<span>'+files[i].version+'</span></td></tr>'; 205 classTr = (classTr == "tr_msg_read"?"tr_msg_read2":"tr_msg_read"); 206 207 } 208 fmFileWindow.innerHTML = newpage; 209 } 210 127 211 128 212 function drawFiles(data){ … … 184 268 if (preferences.comment =='1') newpage += td_hd+'<span id="'+files[i].name+'" onclick="setComments(this)">'+files[i].comm+'</span></td>'; 185 269 if (preferences.version =='1') newpage += td_hd+'<span onclick="loadHistory(\''+files[i].name+'\')">'+files[i].vers+'</span></td></tr>'; 186 // /index.php?menuaction=filemanager.uifilemanager.history&file=MDAxMC5lbWw%253D&path=L2hvbWUvem9yZWlh187 270 classTr = (classTr == "tr_msg_read"?"tr_msg_read2":"tr_msg_read"); 188 271 … … 227 310 } 228 311 312 function loadHistory(filename){ 313 cExecute('/index.php?menuaction=filemanager.uifilemanager.history&file='+base64_encode(filename)+"&path="+base64_encode(currentPath),draw_window); 314 } 315 229 316 function loadPermissions(data){ 230 317 var permission = parseInt(data); -
sandbox/filemanager/setup/phpgw_pt-br.lang
r1719 r1726 25 25 create folder filemanager pt-br Criar Pasta 26 26 new filemanager pt-br novo 27 close filemanager pt-br Fechar 27 28 created filemanager pt-br Criado 28 29 created %1 filemanager pt-br Criado %1 … … 148 149 Cards filemanager pt-br Cartões 149 150 Resume filemanager pt-br Currículo 150 Imposs bile to edit this file filemanager pt-br Impossível editar o arquivo selecionado151 Impossible to edit this file filemanager pt-br Impossível editar o arquivo selecionado 151 152 Enter with the name of new file/directory filemanager pt-br Insira o nome do novo arquivo/diretório 152 153 File extension forbidden or invalid file filemanager pt-br Formato de arquivo inválido -
sandbox/filemanager/templates/default/main.css
r1719 r1726 60 60 .toolButton{ 61 61 padding:0 3px; 62 font-size: 13px; 63 font-weight: bold; 64 62 65 } 63 66 #fmFileWindow -
sandbox/filemanager/templates/default/main.tpl
r1719 r1726 14 14 <div id="search_div" align="left" style="white-space:nowrap"> 15 15 <input type="text" id="em_message_search" size="16" maxlength="22" /> 16 <img style="vertical-align: bottom;" src="./filemanager/templates/default/images/search.gif">16 <img style="vertical-align: bottom;" onclick="searchFile();" src="./filemanager/templates/default/images/search.gif"> 17 17 </div> 18 18 <table border="0" cellspacing="0" cellpadding="0" border="0" style="width:100%"> -
trunk/phpgwapi/inc/class.vfs_sql.inc.php
r1704 r1726 821 821 return False; 822 822 } 823 824 $conf = CreateObject('phpgwapi.config', 'phpgwapi');825 $conf->read_repository();826 if ($this->file_actions || $p->outside)827 {828 823 if ($fp = fopen ($p->real_full_path, 'rb')) 829 824 { … … 832 827 echo fread($fp, $i); 833 828 flush(); 829 ob_clean(); 834 830 } 835 831 fclose ($fp); … … 839 835 return False; 840 836 } 841 }842 837 return True; 843 838 }
Note: See TracChangeset
for help on using the changeset viewer.