Ignore:
Timestamp:
11/17/09 09:02:41 (14 years ago)
Author:
amuller
Message:

Ticket #597 - melhoria no modulo gerenciador de arquivos

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/filemanager/inc/class.vfs_functions.inc.php

    r1648 r1654  
    2323                        'download'=>True, 
    2424                        'setRestricted'=>True, 
    25                         'editComment'=> True 
     25                        'editComment'=> True, 
     26                        'rename'=>True, 
     27                        'delete'=>True 
    2628                ); 
    2729 
     
    7981                                'sortby'        => array('sortby' => ''), 
    8082                                'messages'      => array('messages'     => ''), 
    81                                 'comment_files' => array('comment_files' => ''), 
    82                                 'show_upload_boxes'     => array('show_upload_boxes' => '') 
     83                                'comment'       => array('comment' => ''), 
     84                                'to'    => array('to' => '') 
    8385                        ); 
    8486 
     
    227229                        } 
    228230                } 
     231                function delete(){ 
     232                        foreach($this->fileman as $filename) 
     233                        { 
     234                                if($this->verifyLock($filename,RELATIVE_ALL) && $this->bo->vfs->delete(array('string' => $filename))) 
     235                                { 
     236                                        echo $filename.":"; 
     237                                } 
     238                                else 
     239                                { 
     240                                        echo "False:".$filename; 
     241                                        return False; 
     242                                } 
     243                        } 
     244                } 
    229245                function editComment() 
    230246                { 
    231                         while(list($file) = each($this->comment_files)) 
    232                         { 
    233                                 if($badchar = $this->bo->bad_chars($this->comment_files[$file], False, True)) 
     247                                if($badchar = $this->bo->bad_chars($this->comment, False, True)) 
    234248                                { 
    235249                                        echo "False:badchar:".$badchar; 
     
    237251                                } 
    238252 
    239                                 $this->bo->vfs->set_attributes(array( 
    240                                         'string'        => $file, 
     253                                if ($this->bo->vfs->set_attributes(array( 
     254                                        'string'        => $this->file, 
    241255                                        'relatives'     => array(RELATIVE_ALL), 
    242256                                        'attributes'    => array( 
    243                                         'comment' => stripslashes($this->comment_files[$file]) 
     257                                        'comment' => stripslashes($this->comment) 
    244258                                        ) 
    245                                 )); 
    246  
    247                                 echo "True:".$file; 
    248                                 return True; 
    249                         } 
    250                 } 
     259                                ))) 
     260                                { 
     261                                        echo "True:".$this->file; 
     262                                        return True; 
     263                                } 
     264                } 
     265                # Handle Renaming Files and Directories 
     266                function rename() 
     267                { 
     268                        if ($this->file) 
     269                        { 
     270                                if($badchar = $this->bo->bad_chars($this->to, True, True)) 
     271                                { 
     272                                        echo "Error:badchar:".$badchar; 
     273                                        return false; 
     274                                } 
     275                                if(ereg("/", $this->to) || ereg("\\\\", $this->to)) 
     276                                { 
     277                                        echo "Error:slashes"; 
     278                                        return false; 
     279                                } 
     280                                elseif(!$this->verifyLock($this->file,RELATIVE_CURRENT)) 
     281                                        echo "Error:editing"; 
     282                                elseif ($this->bo->vfs->mv(array( 
     283                                        'from'  => $this->path.'/'.$this->file, 
     284                                        'to'    => $this->path.'/'.$this->to, 
     285                                        'relatives' => array(RELATIVE_NONE,RELATIVE_NONE) 
     286                                ))) 
     287                                { 
     288                                        echo "True:".$this->file.":".$this->to; 
     289                                } 
     290                                else 
     291                                { 
     292                                        echo "Error:".$this->file.":".$this->to; 
     293                                } 
     294                        } 
     295                } 
     296 
    251297        } 
Note: See TracChangeset for help on using the changeset viewer.