1 |
989
|
aldus
|
<?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¶meter2=value]]
|
9 |
|
|
*/
|
10 |
|
|
|
11 |
|
|
require('../../config.php');
|
12 |
|
|
|
13 |
|
|
// Get id
|
14 |
|
|
if(!isset($_GET['droplet_id']) OR !is_numeric($_GET['droplet_id'])) {
|
15 |
|
|
header("Location: ".ADMIN_URL."/pages/index.php");
|
16 |
|
|
} else {
|
17 |
|
|
$droplet_id = $_GET['droplet_id'];
|
18 |
|
|
}
|
19 |
|
|
|
20 |
|
|
// Include WB admin wrapper script
|
21 |
|
|
require_once(WB_PATH.'/framework/class.admin.php');
|
22 |
|
|
require_once(WB_PATH.'/framework/functions.php');
|
23 |
|
|
|
24 |
|
|
// check website baker platform (with WB 2.7, Admin-Tools were moved out of settings dialogue)
|
25 |
|
|
if(file_exists(ADMIN_PATH .'/admintools/tool.php')) {
|
26 |
|
|
$admintool_link = ADMIN_URL .'/admintools/index.php';
|
27 |
|
|
$module_edit_link = ADMIN_URL .'/admintools/tool.php?tool=droplets';
|
28 |
|
|
$admin = new admin('admintools', 'admintools');
|
29 |
|
|
} else {
|
30 |
|
|
$admintool_link = ADMIN_URL .'/settings/index.php?advanced=yes#administration_tools"';
|
31 |
|
|
$module_edit_link = ADMIN_URL .'/settings/tool.php?tool=droplets';
|
32 |
|
|
$admin = new admin('Settings', 'settings_advanced');
|
33 |
|
|
}
|
34 |
|
|
|
35 |
|
|
// Delete droplet
|
36 |
|
|
$database->query("DELETE FROM ".TABLE_PREFIX."mod_droplets WHERE id = '$droplet_id' LIMIT 1");
|
37 |
|
|
|
38 |
|
|
// Check if there is a db error, otherwise say successful
|
39 |
|
|
if($database->is_error()) {
|
40 |
|
|
$admin->print_error($database->get_error(), WB_URL.'/modules/droplets/modify_droplet.php?droplet_id='.$droplet_id);
|
41 |
|
|
} else {
|
42 |
|
|
$admin->print_success($TEXT['SUCCESS'], $module_edit_link);
|
43 |
|
|
}
|
44 |
|
|
|
45 |
|
|
// Print admin footer
|
46 |
|
|
$admin->print_footer();
|
47 |
|
|
|
48 |
|
|
?>
|