Project

General

Profile

1 238 stefan
<?php
2
3
// $Id$
4
5
/*
6
7
 Website Baker Project <http://www.websitebaker.org/>
8 519 Ruebenwurz
 Copyright (C) 2004-2008, Ryan Djurovich
9 238 stefan
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
if(defined('WB_URL')) {
27
28
	// Set the filename of the actual editor file
29 341 stefan
	$editor_file = $module_directory.'/htmlarea.zip';
30 238 stefan
31
	if(file_exists($editor_file)) {
32
33
		// Setup the PclZip object
34
		$editor_archive = new PclZip($editor_file);
35
36
		// Unzip to module dir
37 341 stefan
		$list = $editor_archive->extract(PCLZIP_OPT_PATH, $module_directory);
38 238 stefan
		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 341 stefan
		chmod_directory_contents($module_directory.'/htmlarea', OCTAL_FILE_MODE);
46 238 stefan
47
	}
48
49
}
50
51 399 Ruebenwurz
?>