Project

General

Profile

1 989 aldus
<?php
2 1296 Luisehahne
/**
3
 *
4
 * @category        module
5
 * @package         droplet
6
 * @author          Ruud Eisinga (Ruud) John (PCWacht)
7
 * @author          WebsiteBaker Project
8
 * @copyright       2004-2009, Ryan Djurovich
9 1349 Luisehahne
 * @copyright       2009-2011, Website Baker Org. e.V.
10 1296 Luisehahne
 * @link			http://www.websitebaker2.org/
11
 * @license         http://www.gnu.org/licenses/gpl.html
12
 * @platform        WebsiteBaker 2.8.x
13 1349 Luisehahne
 * @requirements    PHP 5.2.2 and higher
14 1296 Luisehahne
 * @version         $Id$
15
 * @filesource		$HeadURL$
16
 * @lastmodified    $Date$
17
 *
18
 */
19 991 Ruebenwurz
20 995 aldus
if(!defined('WB_PATH')) die(header('Location: ../../index.php'));
21 989 aldus
22 995 aldus
$table = TABLE_PREFIX .'mod_droplets';
23
24
$info = $database->query("SELECT * from `$table` limit 0,1" );
25
$fields = $info->fetchRow();
26 997 aldus
if (!array_key_exists("admin_edit", $fields)) {
27 995 aldus
	/**
28
	 *	Call from the upgrade-script
29
	 */
30
31
	if (function_exists('db_add_field')) {
32 998 ruud
		db_add_field("admin_edit", 'mod_droplets', "INT NOT NULL default '0'");
33
		db_add_field("admin_view", 'mod_droplets', "INT NOT NULL default '0'");
34
		db_add_field("show_wysiwyg", 'mod_droplets', "INT NOT NULL default '0'");
35 995 aldus
	} else {
36
		/**
37
		 * Not call by the upgrade-script
38
		 */
39
		$database->query("ALTER TABLE `$table` (
40
			`admin_edit` INT NOT NULL default '0',
41
			`admin_view` INT NOT NULL default '0',
42
			`show_wysiwyg` INT NOT NULL default '0'
43 998 ruud
			)");
44 995 aldus
	}
45
}
46 989 aldus
?>