1
|
<?php
|
2
|
/**
|
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
|
* @copyright 2009-2011, Website Baker Org. e.V.
|
10
|
* @link http://www.websitebaker2.org/
|
11
|
* @license http://www.gnu.org/licenses/gpl.html
|
12
|
* @platform WebsiteBaker 2.8.x
|
13
|
* @requirements PHP 5.2.2 and higher
|
14
|
* @version $Id: delete_droplet.php 1473 2011-07-09 00:40:50Z Luisehahne $
|
15
|
* @filesource $HeadURL: svn://isteam.dynxs.de/wb-archiv/tags/2.8.2/wb/modules/droplets/delete_droplet.php $
|
16
|
* @lastmodified $Date: 2011-07-09 02:40:50 +0200 (Sat, 09 Jul 2011) $
|
17
|
*
|
18
|
*/
|
19
|
|
20
|
require('../../config.php');
|
21
|
|
22
|
// Include WB admin wrapper script
|
23
|
require_once(WB_PATH.'/framework/class.admin.php');
|
24
|
require_once(WB_PATH.'/framework/functions.php');
|
25
|
|
26
|
$module_edit_link = ADMIN_URL .'/admintools/tool.php?tool=droplets';
|
27
|
// check website baker platform (with WB 2.7, Admin-Tools were moved out of settings dialogue)
|
28
|
if(file_exists(ADMIN_PATH .'/admintools/tool.php')) {
|
29
|
$admintool_link = ADMIN_URL .'/admintools/index.php';
|
30
|
$admin = new admin('admintools', 'admintools');
|
31
|
} else {
|
32
|
$admintool_link = ADMIN_URL .'/settings/index.php?advanced=yes#administration_tools"';
|
33
|
$admin = new admin('Settings', 'settings_advanced');
|
34
|
}
|
35
|
|
36
|
// Get id
|
37
|
$droplet_id = $admin->checkIDKEY('droplet_id', false, 'GET');
|
38
|
if (!$droplet_id) {
|
39
|
$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], $module_edit_link);
|
40
|
exit();
|
41
|
}
|
42
|
|
43
|
// Delete droplet
|
44
|
$database->query("DELETE FROM ".TABLE_PREFIX."mod_droplets WHERE id = '$droplet_id' LIMIT 1");
|
45
|
|
46
|
// Check if there is a db error, otherwise say successful
|
47
|
if($database->is_error()) {
|
48
|
$admin->print_error($database->get_error(), WB_URL.'/modules/droplets/modify_droplet.php?droplet_id='.$droplet_id);
|
49
|
} else {
|
50
|
$admin->print_success($TEXT['SUCCESS'], $module_edit_link);
|
51
|
}
|
52
|
|
53
|
// Print admin footer
|
54
|
$admin->print_footer();
|