Ignore:
Timestamp:
11/24/09 16:07:27 (15 years ago)
Author:
amuller
Message:

Ticket #597 - Melhorias na visualização do módulo fm com tema azul

Location:
sandbox/filemanager/inc
Files:
1 added
4 edited

Legend:

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

    r1693 r1704  
    11php_value post_max_size 1G 
    22php_value upload_max_filesize 1G 
    3 php_value memory_limit 200M 
    4  
  • sandbox/filemanager/inc/class.uifilemanager.inc.php

    r1694 r1704  
    585585                                $vars[quotaSize]='<input type="hidden" id="quotaSize" value="'.($quota*1024*1024).'">'; 
    586586                                $vars[path]='<input type="hidden" id="currentPath" value="'.$this->path.'">'; 
    587                                 $vars[css]='<script>initDrawApi();</script> 
    588                                         <link rel="stylesheet" type="text/css" href="filemanager/templates/default/main.css">'; 
    589                                 $vars[toolbar0]=$this->toolbar('location'); 
    590                                 $vars[toolbar1]=$this->toolbar('list_nav'); 
     587                                $vars[css]='<link rel="stylesheet" type="text/css" href="filemanager/templates/default/main.css">'; 
     588                                $vars[script]='<script>initDrawApi();</script>'; 
     589 
     590                                // create dir and file button 
     591                                if($this->can_add) 
     592                                { 
     593                                        //TODO : create folder with problems 
     594                                        //$toolbar3.=$this->toolButton('newdir','createdir',lang('Create Folder')); 
     595                                        $vars[new_button]=$this->toolButton('new','createfile',lang('New...')); 
     596                                        $vars[new_button].='<input type="hidden" id="newfile_or_dir" name="newfile_or_dir" value="" />'; 
     597                                } 
     598                                else 
     599                                        $vars[new_button]=''; 
     600 
     601                                // go up icon when we're not at the top, dont allow to go outside /home = fakebase 
     602                                if($this->path != '/' && $this->path != $this->bo->fakebase) 
     603                                { 
     604                                        $vars[tools_button] = $this->toolButton('tools','tools',lang('tools')); 
     605                                } 
     606                                else 
     607                                        $vars[tools_button] = ""; 
     608 
     609                                // go home icon when we're not home already 
     610                                /*if($this->path != $this->bo->homedir) 
     611                                { 
     612                                        $link=$this->encode_href('/index.php','menuaction=filemanager.uifilemanager.index','path='.$this->lesspath); 
     613 
     614                                $vars[up_button]=$this->toolButton($link,'up',lang('go up')); 
     615 
     616                                $link=$this->encode_href('/index.php','menuaction=filemanager.uifilemanager.index','path='.$this->bo->homedir); 
     617                                $toolbar.=$this->toolButton($link,'home',lang('go home')); 
     618                                }*/ 
     619 
     620                                // reload button with this url 
     621                                $vars[refresh_button]=$this->toolButton('reload','reload',lang('reload')); 
     622 
     623                                // selectbox for change/move/and copy to 
     624                                $dirs=$this->all_other_directories_options(); 
     625                                foreach($dirs as $elem) 
     626                                        $vars[folders].='<br><span onclick="load(\''.$elem['directory'].$elem['name'].'\')" class="l">'.$elem['name'].'</span>'; 
     627                                 
     628                                //$this->toolButton('goto','goto',lang('Quick jump to')); 
     629                                // selectbox for change/move/and copy to 
     630                                // submit buttons for 
     631                                // if($this->path != '/' && $this->path != $this->bo->fakebase) 
     632 
     633                                if($this->can_edit) 
     634                                { 
     635                                        // edit text file button 
     636                                        $toolbar.=$this->toolButton('edit','edit',lang('edit')); 
     637                                } 
     638 
     639                                if($this->can_edit) 
     640                                { 
     641                                        $toolbar.=$this->toolButton('rename','rename',lang('Rename')); 
     642                                } 
     643 
     644                                if($this->can_delete) 
     645                                { 
     646                                        $toolbar.=$this->toolButton('delete','delete',lang('Delete')); 
     647                                } 
     648 
     649 
     650 
     651                                // copy and move buttons 
     652                                //if($this->path != '/' && $this->path != $this->bo->fakebase){} 
     653 
     654                                $dirs=$this->all_other_directories_options(); 
     655                                foreach($dirs as $dir) 
     656                                        if((($dir['directory'] . $dir['name']) != $this->path) && $this->bo->vfs->file_exists(array('string' => $dir['directory'] . $dir['name'],'relatives' => array(RELATIVE_NONE)))) 
     657                                        { 
     658                                                //FIXME replace the html_form_option function 
     659                                                $dirs_options .= $this->html_form_option($dir['directory'] . $dir['name'], $dir['directory'] . $dir['name']); 
     660                                        } 
     661 
     662                                if (strlen($dirs_options) > 0){ 
     663                                         if ($this->can_read) 
     664                                                $toolbar.=$this->toolButton('copy_to','copy_to',lang('Copy to')); 
     665                                        if ($this->can_delete) 
     666                                                $toolbar.=$this->toolButton('move_to','move_to',lang('Move to')); 
     667                                } 
     668                                $toolbar.='<select name="todir" style="visibility:hidden">'.$dirs_options.'</select>'; 
     669 
     670 
     671 
     672                                $vars[toolbar1]=$toolbar; 
    591673 
    592674                                if(count($this->messages)>0)  
     
    629711                                        } 
    630712 
    631                                         $this->t->set_var('row_tr_color','#dedede'); 
     713                                        $this->t->set_var('row_tr_class','message_header'); 
    632714                                         
    633715                                        $this->t->parse('rows','row'); 
     
    661743                                        } 
    662744 
    663                                         $this->t->set_var('row_tr_color',$tr_color); 
     745                                        $this->t->set_var('row_tr_class',''); 
    664746                                        $this->t->parse('rows','row'); 
    665747                                        $this->t->pparse('out','row'); 
     
    9831065                        // end file count 
    9841066                } 
    985  
    986                 function toolbar($type) 
    987                 { 
    988                         switch($type) 
    989                         { 
    990                                 case 'location': 
    991                                         $toolbar=' 
    992                                         <div id="fmLocation"> 
    993                                         <table cellspacing="10" cellpadding="0" border="0"> 
    994                                         <tr> 
    995                                         '; 
    996 //                                      $toolbar.='<td><img alt="spacer" src="'.$GLOBALS['phpgw']->common->image('phpgwapi','buttonseparator').'" height="27" width="8"></td>'; 
    997 //                                      $toolbar.='<td><img alt="spacer" src="'.$GLOBALS['phpgw']->common->image('filemanager','spacer').'" height="27" width="1"></td>'; 
    998  
    999                                         // go up icon when we're not at the top, dont allow to go outside /home = fakebase 
    1000                                         if($this->path != '/' && $this->path != $this->bo->fakebase) 
    1001                                         { 
    1002                                                 $link=$this->encode_href('/index.php','menuaction=filemanager.uifilemanager.index','path='.$this->lesspath); 
    1003                                                 $toolbar.=$this->linkButton($link,'up',lang('go up')); 
    1004                                         } 
    1005  
    1006                                         // go home icon when we're not home already 
    1007                                         if($this->path != $this->bo->homedir) 
    1008                                         { 
    1009                                                 $link=$this->encode_href('/index.php','menuaction=filemanager.uifilemanager.index','path='.$this->bo->homedir); 
    1010                                                 $toolbar.=$this->linkButton($link,'home',lang('go home')); 
    1011                                         } 
    1012  
    1013                                         // reload button with this url 
    1014                                         $link=$this->encode_href('/index.php','menuaction=filemanager.uifilemanager.index','path='.$this->path); 
    1015                                         $toolbar.=$this->linkButton($link,'reload',lang('reload')); 
    1016  
    1017                                         $toolbar.='<td>'.lang('Location').':&nbsp;'; 
    1018                                         //$toolbar.='<input id="fmInputLocation" type="text" size="20" disabled="disabled" name="location" value="'.$this->disppath.'"/>&nbsp;'; 
    1019                                         $current_option='<option>'.$this->disppath.'</option>'; 
    1020                                         // selectbox for change/move/and copy to 
    1021                                         $dirs_options=$this->all_other_directories_options(); 
    1022                                         $toolbar.='<select id="cdtodir" name="cdtodir" onChange="document.formfm.changedir.value=\'true\';document.formfm.submit()">'.$current_option.$dirs_options.'</select> 
    1023                                         <input type="hidden" name="changedir" value="false"></td> 
    1024                                         '; 
    1025                                         //$toolbar.=$this->inputImage('goto','goto',lang('Quick jump to')); 
    1026                                         // upload button 
    1027                                         /*if($this->path != '/' && $this->path != $this->bo->fakebase && $this->can_add) 
    1028                                         { 
    1029                                                 // upload button 
    1030                                                 $toolbar.=$this->inputImage('upload','upload',lang('Upload')); 
    1031                                                  
    1032  
    1033                                         }*/ 
    1034                                         $toolbar.='</tr></table>'; 
    1035                                         $toolbar.='</div><br><br>'; 
    1036                                         break; 
    1037                                 case 'list_nav': 
    1038                                         $toolbar=' 
    1039                                         <table cellspacing="10" cellpadding="0" border="0"> 
    1040                                         <tr>'; 
    1041                                         // selectbox for change/move/and copy to 
    1042                                         // submit buttons for 
    1043                                         if($this->path != '/' && $this->path != $this->bo->fakebase) 
    1044                                         { 
    1045                                                 // create dir and file button 
    1046                                                 if($this->can_add) 
    1047                                                 { 
    1048                                                         $toolbar.='<td><input type="hidden" id="newfile_or_dir" name="newfile_or_dir" value="" /></td>'; 
    1049                                                         //TODO : create folder with problems 
    1050                                                         //$toolbar3.=$this->inputImage('newdir','createdir',lang('Create Folder')); 
    1051                                                         $toolbar.=$this->inputImage('new','createfile',lang('New...')); 
    1052                                                 } 
    1053  
    1054                                                 if($this->can_edit) 
    1055                                                 { 
    1056                                                         // edit text file button 
    1057                                                         $toolbar.=$this->inputImage('edit','edit',lang('edit')); 
    1058                                                 } 
    1059  
    1060                                                 if($this->can_edit) 
    1061                                                 { 
    1062                                                         $toolbar.=$this->inputImage('rename','rename',lang('Rename')); 
    1063                                                 } 
    1064  
    1065                                                 if($this->can_delete) 
    1066                                                 { 
    1067                                                         $toolbar.=$this->inputImage('delete','delete',lang('Delete')); 
    1068                                                 } 
    1069  
    1070                                         } 
    1071  
    1072                                                 // copy and move buttons 
    1073                                                 if($this->path != '/' && $this->path != $this->bo->fakebase) 
    1074                                                 { 
    1075                                                         $dirs_options=$this->all_other_directories_options(); 
    1076                                                         if (strlen($dirs_options) > 0){ 
    1077                                                                 $toolbar3.=$this->inputImage('copy_to','copy_to',lang('Copy to')); 
    1078                                                                 if ($this->can_delete) 
    1079                                                                         $toolbar3.=$this->inputImage('move_to','move_to',lang('Move to')); 
    1080                                                         } 
    1081                                                         $toolbar3.='<td><select name="todir" style="visibility:hidden">'.$dirs_options.'</select></td>'; 
    1082  
    1083                                                 } 
    1084  
    1085                                                 if($toolbar3) 
    1086                                                 { 
    1087                                                         $toolbar.=$toolbar3; 
    1088                                                 /*      $toolbar.=' 
    1089                                                         <table cellspacing="1" cellpadding="0" border="0"> 
    1090                                                         <tr>'.$toolbar3;*/ 
    1091                                                 } 
    1092                                         $toolbar.='</tr></table>'; 
    1093  
    1094                                         break; 
    1095                                 default:$x=''; 
    1096                         } 
    1097  
    1098                         if($toolbar) 
    1099                         { 
    1100                                 return $toolbar; 
    1101                         } 
    1102                 } 
    1103  
    11041067 
    11051068                # Handle Moving Files and Directories 
     
    16481611                                } 
    16491612                        } 
    1650  
    16511613                        reset($dirs); 
    16521614                        while(list($num, $dir) = each($dirs)) 
     
    16621624                                        $dir['directory'] .= '/'; 
    16631625                                } 
    1664  
    1665                                 # No point in displaying the current directory, or a directory that doesn't exist 
    1666                                 if((($dir['directory'] . $dir['name']) != $this->path) && $this->bo->vfs->file_exists(array('string' => $dir['directory'] . $dir['name'],'relatives' => array(RELATIVE_NONE)))) 
    1667                                 { 
    1668                                         //FIXME replace the html_form_option function 
    1669                                         $options .= $this->html_form_option($dir['directory'] . $dir['name'], $dir['directory'] . $dir['name']); 
    1670                                 } 
    1671                         } 
    1672  
    1673                         return $options; 
     1626                                $return[] = $dir; 
     1627                        } 
     1628                        return $return; 
    16741629                } 
    16751630 
     
    16881643                } 
    16891644 
    1690                 function linkButton($link,$img='',$description='') 
     1645                function toolButton($link,$img='',$description='') 
    16911646                { 
    16921647                        $image=$GLOBALS['phpgw']->common->image('filemanager','button_'.strtolower($img)); 
     
    16941649                        if($img) 
    16951650                        { 
    1696                                 return '<td class="" align="center" valign="middle" height="28" width="70"> 
    1697                                 <a href="'.$link.'" title="'.$description.'"><img src="'.$image.'" alt="'.$description.'"/></a><br><small>'.$description.'</small> 
    1698                                 </td>'; 
     1651                                return '<span name="'.$link.'" class="toolButton" onclick="toolbar_control(\''.$link.'\');" title="'.$description.'"><img src="'.$image.'" alt="'.$description.'"/></a><small>'.$description.'</small></span>'; 
    16991652                        } 
    17001653                } 
     
    17111664                        } 
    17121665                } 
    1713                 function inputImage($name,$img='',$description='') 
    1714                 { 
    1715                         $image=$GLOBALS['phpgw']->common->image('filemanager','button_'.strtolower($img)); 
    1716  
    1717                         if($img) 
    1718                         { 
    1719                                 return '<td class="" align="center" valign="middle" height="28" width="70"> 
    1720                                 <img onClick="toolbar_control(\''.$name.'\')" title="'.$description.'" name="'.$name.'" alt="'.$name.'" src="'.$image.'" /><br><small>'.$description.'</small> 
    1721                                 </td>'; 
    1722                         } 
    1723                 } 
    1724  
    17251666 
    17261667 
  • sandbox/filemanager/inc/class.vfs_functions.inc.php

    r1693 r1704  
    1515        \**************************************************************************/ 
    1616 
    17         /* $Id: class.uifilemanager.inc.php 17511 2004-12-12 06:35:24Z dawnlinux $ */ 
     17        /* $Id: class.vfs_functions.inc.php 2009-11-11 amuller $ */ 
    1818 
    1919        class vfs_functions 
  • sandbox/filemanager/inc/download.php

    r1693 r1704  
    2222        header("Expires: 0"); 
    2323        header ("Content-Disposition: attachment; filename=\"". addslashes($file)."\""); 
    24         echo $bo->vfs->read(array('string' => $file)); 
     24        $bo->vfs->print_content(array('string' => $file)); 
    2525        $GLOBALS['phpgw']->common->phpgw_exit(); 
    2626} 
Note: See TracChangeset for help on using the changeset viewer.