| 1 | 70 | stefan | <?php
 | 
      
        | 2 |  |  | 
 | 
      
        | 3 | 137 | ryan | // $Id$
 | 
      
        | 4 |  |  | 
 | 
      
        | 5 |  |  | /*
 | 
      
        | 6 |  |  | 
 | 
      
        | 7 |  |  |  Website Baker Project <http://www.websitebaker.org/>
 | 
      
        | 8 |  |  |  Copyright (C) 2004-2005, Ryan Djurovich
 | 
      
        | 9 |  |  | 
 | 
      
        | 10 |  |  |  Website Baker is free software; you can redistribute it and/or modify
 | 
      
        | 11 |  |  |  it under the terms of the GNU General Public License as published by
 | 
      
        | 12 |  |  |  the Free Software Foundation; either version 2 of the License, or
 | 
      
        | 13 |  |  |  (at your option) any later version.
 | 
      
        | 14 |  |  | 
 | 
      
        | 15 |  |  |  Website Baker is distributed in the hope that it will be useful,
 | 
      
        | 16 |  |  |  but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
      
        | 17 |  |  |  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
      
        | 18 |  |  |  GNU General Public License for more details.
 | 
      
        | 19 |  |  | 
 | 
      
        | 20 |  |  |  You should have received a copy of the GNU General Public License
 | 
      
        | 21 |  |  |  along with Website Baker; if not, write to the Free Software
 | 
      
        | 22 |  |  |  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 | 
      
        | 23 |  |  | 
 | 
      
        | 24 |  |  | */
 | 
      
        | 25 |  |  | 
 | 
      
        | 26 | 70 | stefan | if(defined('WB_URL')) {
 | 
      
        | 27 |  |  | 
 | 
      
        | 28 |  |  | 	// Set the filename of the actual editor file
 | 
      
        | 29 |  |  | 	$editor_file = $module_dir.'/htmlarea.zip';
 | 
      
        | 30 |  |  | 
 | 
      
        | 31 |  |  | 	// Setup the PclZip object
 | 
      
        | 32 |  |  | 	$editor_archive = new PclZip($editor_file);
 | 
      
        | 33 |  |  | 
 | 
      
        | 34 | 114 | stefan | 	// Unzip to module dir
 | 
      
        | 35 | 70 | stefan | 	$list = $editor_archive->extract(PCLZIP_OPT_PATH, $module_dir);
 | 
      
        | 36 |  |  | 	if(!$list) {
 | 
      
        | 37 |  |  | 		$admin->print_error($MESSAGE['GENERIC']['CANNOT_UNZIP']);
 | 
      
        | 38 |  |  | 	}
 | 
      
        | 39 |  |  | 	// Delete the zip file
 | 
      
        | 40 |  |  | 	if(file_exists($editor_file)) { unlink($editor_file); }
 | 
      
        | 41 |  |  | 
 | 
      
        | 42 |  |  | 	// Chmod all the editors files
 | 
      
        | 43 |  |  | 	chmod_directory_contents($module_dir.'/htmlarea', OCTAL_FILE_MODE);
 | 
      
        | 44 |  |  | 
 | 
      
        | 45 |  |  | }
 | 
      
        | 46 |  |  | 
 | 
      
        | 47 |  |  | ?>
 |