Project

General

Profile

1
<?php
2
/*
3
*	@version	1.0
4
*	@author		Ruud Eisinga (Ruud) John (PCWacht)
5
*	@date		June 2009
6
*
7
*	droplets are small codeblocks that are called from anywhere in the template. 
8
* 	To call a droplet just use [[dropletname]]. optional parameters for a droplet can be used like [[dropletname?parameter=value&parameter2=value]]
9
*/
10

    
11
require('../../config.php');
12

    
13
require_once(WB_PATH.'/framework/class.admin.php');
14
require_once(WB_PATH.'/framework/functions.php');
15
$admin = new admin('admintools','admintools',false,false);
16
if($admin->get_permission('admintools') == true) {
17
	
18
	$admintool_link = ADMIN_URL .'/admintools/index.php';
19
	$module_edit_link = ADMIN_URL .'/admintools/tool.php?tool=droplets';
20
	$admin = new admin('admintools', 'admintools');
21

    
22
	$modified_when = mktime();
23
	$modified_by = $admin->get_user_id();
24

    
25
	// Insert new row into database
26
	$database->query("INSERT INTO ".TABLE_PREFIX."mod_droplets (active,modified_when,modified_by) VALUES ('1','$modified_when','$modified_by' )");
27

    
28
	// Get the id
29
	$droplet_id = $database->get_one("SELECT LAST_INSERT_ID()");
30

    
31
	// Say that a new record has been added, then redirect to modify page
32
	if($database->is_error()) {
33
		$admin->print_error($database->get_error(), $module_edit_link);
34
	} else {
35
		$admin->print_success($TEXT['SUCCESS'], WB_URL.'/modules/droplets/modify_droplet.php?droplet_id='.$droplet_id);
36
	}
37

    
38
	// Print admin footer
39
	$admin->print_footer();
40
} else {
41
	die(header('Location: ../../index.php'));
42
} 
43
?>
(1-1/13)