Project

General

Profile

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 166 ryan
28 70 stefan
	// Set the filename of the actual editor file
29
	$editor_file = $module_dir.'/htmlarea.zip';
30
31 166 ryan
	if(file_exists($editor_file)) {
32
33
		// Setup the PclZip object
34
		$editor_archive = new PclZip($editor_file);
35 70 stefan
36 166 ryan
		// Unzip to module dir
37
		$list = $editor_archive->extract(PCLZIP_OPT_PATH, $module_dir);
38
		if(!$list) {
39
			$admin->print_error($MESSAGE['GENERIC']['CANNOT_UNZIP']);
40
		}
41
		// Delete the zip file
42
		if(file_exists($editor_file)) { unlink($editor_file); }
43
44
		// Chmod all the editors files
45
		chmod_directory_contents($module_dir.'/htmlarea', OCTAL_FILE_MODE);
46
47 70 stefan
	}
48
49
}
50
51
?>