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-2010, 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 4.4.9 and higher
|
14
|
* @version $Id: delete_droplet.php 1296 2010-02-19 11:02:17Z Luisehahne $
|
15
|
* @filesource $HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/modules/droplets/delete_droplet.php $
|
16
|
* @lastmodified $Date: 2010-02-19 12:02:17 +0100 (Fri, 19 Feb 2010) $
|
17
|
*
|
18
|
*/
|
19
|
|
20
|
require('../../config.php');
|
21
|
|
22
|
// Get id
|
23
|
if(!isset($_GET['droplet_id']) OR !is_numeric($_GET['droplet_id'])) {
|
24
|
header("Location: ".ADMIN_URL."/pages/index.php");
|
25
|
} else {
|
26
|
$droplet_id = $_GET['droplet_id'];
|
27
|
}
|
28
|
|
29
|
// Include WB admin wrapper script
|
30
|
require_once(WB_PATH.'/framework/class.admin.php');
|
31
|
require_once(WB_PATH.'/framework/functions.php');
|
32
|
|
33
|
// check website baker platform (with WB 2.7, Admin-Tools were moved out of settings dialogue)
|
34
|
if(file_exists(ADMIN_PATH .'/admintools/tool.php')) {
|
35
|
$admintool_link = ADMIN_URL .'/admintools/index.php';
|
36
|
$module_edit_link = ADMIN_URL .'/admintools/tool.php?tool=droplets';
|
37
|
$admin = new admin('admintools', 'admintools');
|
38
|
} else {
|
39
|
$admintool_link = ADMIN_URL .'/settings/index.php?advanced=yes#administration_tools"';
|
40
|
$module_edit_link = ADMIN_URL .'/settings/tool.php?tool=droplets';
|
41
|
$admin = new admin('Settings', 'settings_advanced');
|
42
|
}
|
43
|
|
44
|
// Delete droplet
|
45
|
$database->query("DELETE FROM ".TABLE_PREFIX."mod_droplets WHERE id = '$droplet_id' LIMIT 1");
|
46
|
|
47
|
// Check if there is a db error, otherwise say successful
|
48
|
if($database->is_error()) {
|
49
|
$admin->print_error($database->get_error(), WB_URL.'/modules/droplets/modify_droplet.php?droplet_id='.$droplet_id);
|
50
|
} else {
|
51
|
$admin->print_success($TEXT['SUCCESS'], $module_edit_link);
|
52
|
}
|
53
|
|
54
|
// Print admin footer
|
55
|
$admin->print_footer();
|
56
|
|
57
|
?>
|