Ignore:
Timestamp:
12/01/09 10:54:27 (14 years ago)
Author:
amuller
Message:

Ticket #597 - Melhorias no módulos gerenciador de arquivos do expresso livre

Location:
sandbox/filemanager/inc
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • sandbox/filemanager/inc/.htaccess

    r1704 r1726  
    1 php_value post_max_size 1G 
    2 php_value upload_max_filesize 1G 
     1php_value post_max_size 1300M 
     2php_value upload_max_filesize 1300M 
  • sandbox/filemanager/inc/class.uiconfig.inc.php

    r1678 r1726  
    3232 
    3333                         $GLOBALS['phpgw']->common->phpgw_header(); 
     34                        include('load_lang.php'); 
    3435                        echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/connector.js'></script>"; 
    3536                        echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/common_functions.js'></script>"; 
  • sandbox/filemanager/inc/class.uifilemanager.inc.php

    r1719 r1726  
    3131                        'dir_ls' => True, 
    3232                        'get_permissions' => True, 
     33                        'search' => True, 
    3334                        'uploadModel'=>True 
    3435                ); 
     
    5253                var $groups_applications; 
    5354 
    54                 //originally post_vars 
    55                 //              var $goto; 
    5655                var $current_config; 
    57                 var $goto_x; 
     56                var $dirs; 
    5857                var $to; 
    5958                var $changedir; // for switching dir. 
    6059                var $cdtodir; // for switching dir. 
    61 //              var $createdir; 
    6260                var $newfile_or_dir; 
    6361                var $newdir_x; 
     
    6563                var $createfile_var; 
    6664                var $move_to_x; 
    67 //              var $copy_to; 
    6865                var $copy_to_x; 
    6966                var $edit_x; 
     
    252249 
    253250                        } 
    254                          
    255251                } 
    256252                function fileModels() 
     
    407403                        } 
    408404 
    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();  
    432406                        $this->groups_applications = array(); 
    433407 
     
    692666 
    693667                                // 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) 
    696670                                        $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>'; 
    697671                                 
    698672 
    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) 
    704675                                        if((($dir['directory'] . $dir['name']) != $this->path) && $this->bo->vfs->file_exists(array('string' => $dir['directory'] . $dir['name'],'relatives' => array(RELATIVE_NONE)))) 
    705676                                        { 
     
    10541025 
    10551026                                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; 
    10581031                                } 
    10591032                        } 
     
    11061079                                else 
    11071080                                { 
    1108                                         echo lang('Could not save %1', $this->path.'/'.$this->edit_file); 
    11091081                                        $this->messages[]=lang('Could not save %1', $this->path.'/'.$this->edit_file); 
    11101082                                } 
     
    12361208                        ))) 
    12371209                        { 
    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; 
    12401214                        } 
    12411215                        if($this->file) //FIXME 
     
    12471221                                        'nofiles'       => True 
    12481222                                )); 
    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                                 } 
    12531223                                if($ls_array[0]['mime_type']) 
    12541224                                { 
     
    12651235                                        /*Note: if you put application/octet-stream you force download */ 
    12661236                                        header('Content-type: ' . $mime_type); 
    1267                                         header('Content-disposition: filename="' . $this->file . '"');//FIXME 
     1237                                        header('Content-disposition: filename="' . addslashes($this->file) . '"'); 
    12681238                                        Header("Pragma: public"); 
    12691239                                } 
    12701240                                else 
    12711241                                { 
    1272                                         $GLOBALS['phpgw']->browser->content_header($this->file,$mime_type);//FIXME 
    1273                                 } 
    1274   
    1275  
    1276                                 echo $this->bo->vfs->read(array( 
    1277                                         'string'        => $this->path.'/'.$this->file,//FIXME 
    1278                                         '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 
    12801250                                $GLOBALS['phpgw']->common->phpgw_exit(); 
    12811251                        } 
     
    12991269                                $formats = array('text/html'); 
    13001270                                if(!in_array($mime_type,$formats)){ 
    1301                                         echo lang('Impossbile to export this file'); 
     1271                                        echo lang('Impossible to export this file'); 
    13021272                                        return False; 
    13031273                                } 
     
    13181288 
    13191289                //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() 
    13211291                { 
    13221292                        # First we get the directories in their home directory 
     
    13821352                } 
    13831353 
     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 
    13841412                /* seek icon for mimetype else return an unknown icon */ 
    13851413                function mime_icon($mime_type, $size=16) 
Note: See TracChangeset for help on using the changeset viewer.