Changeset 1654 for sandbox/filemanager/inc/class.vfs_functions.inc.php
- Timestamp:
- 11/17/09 09:02:41 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/filemanager/inc/class.vfs_functions.inc.php
r1648 r1654 23 23 'download'=>True, 24 24 'setRestricted'=>True, 25 'editComment'=> True 25 'editComment'=> True, 26 'rename'=>True, 27 'delete'=>True 26 28 ); 27 29 … … 79 81 'sortby' => array('sortby' => ''), 80 82 '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' => '') 83 85 ); 84 86 … … 227 229 } 228 230 } 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 } 229 245 function editComment() 230 246 { 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)) 234 248 { 235 249 echo "False:badchar:".$badchar; … … 237 251 } 238 252 239 $this->bo->vfs->set_attributes(array(240 'string' => $ file,253 if ($this->bo->vfs->set_attributes(array( 254 'string' => $this->file, 241 255 'relatives' => array(RELATIVE_ALL), 242 256 'attributes' => array( 243 'comment' => stripslashes($this->comment _files[$file])257 'comment' => stripslashes($this->comment) 244 258 ) 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 251 297 }
Note: See TracChangeset
for help on using the changeset viewer.