| 1 | <?php
 | 
  
    | 2 | 
 | 
  
    | 3 | // $Id: delete_droplet.php 991 2009-06-15 15:55:20Z Ruebenwurzel $
 | 
  
    | 4 | 
 | 
  
    | 5 | /*
 | 
  
    | 6 | *	@version	1.0
 | 
  
    | 7 | *	@author		Ruud Eisinga (Ruud) John (PCWacht)
 | 
  
    | 8 | *	@date		June 2009
 | 
  
    | 9 | *
 | 
  
    | 10 | *	droplets are small codeblocks that are called from anywhere in the template. 
 | 
  
    | 11 | * 	To call a droplet just use [[dropletname]]. optional parameters for a droplet can be used like [[dropletname?parameter=value¶meter2=value]]
 | 
  
    | 12 | */
 | 
  
    | 13 | 
 | 
  
    | 14 | require('../../config.php');
 | 
  
    | 15 | 
 | 
  
    | 16 | // Get id
 | 
  
    | 17 | if(!isset($_GET['droplet_id']) OR !is_numeric($_GET['droplet_id'])) {
 | 
  
    | 18 | 	header("Location: ".ADMIN_URL."/pages/index.php");
 | 
  
    | 19 | } else {
 | 
  
    | 20 | 	$droplet_id = $_GET['droplet_id'];
 | 
  
    | 21 | }
 | 
  
    | 22 | 
 | 
  
    | 23 | // Include WB admin wrapper script
 | 
  
    | 24 | require_once(WB_PATH.'/framework/class.admin.php');
 | 
  
    | 25 | require_once(WB_PATH.'/framework/functions.php');
 | 
  
    | 26 | 
 | 
  
    | 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 | 	$module_edit_link = ADMIN_URL .'/admintools/tool.php?tool=droplets';
 | 
  
    | 31 | 	$admin = new admin('admintools', 'admintools');
 | 
  
    | 32 | } else {
 | 
  
    | 33 | 	$admintool_link = ADMIN_URL .'/settings/index.php?advanced=yes#administration_tools"';
 | 
  
    | 34 | 	$module_edit_link = ADMIN_URL .'/settings/tool.php?tool=droplets';
 | 
  
    | 35 | 	$admin = new admin('Settings', 'settings_advanced');
 | 
  
    | 36 | }
 | 
  
    | 37 | 
 | 
  
    | 38 | // Delete droplet
 | 
  
    | 39 | $database->query("DELETE FROM ".TABLE_PREFIX."mod_droplets WHERE id = '$droplet_id' LIMIT 1");
 | 
  
    | 40 | 
 | 
  
    | 41 | // Check if there is a db error, otherwise say successful
 | 
  
    | 42 | if($database->is_error()) {
 | 
  
    | 43 | 	$admin->print_error($database->get_error(), WB_URL.'/modules/droplets/modify_droplet.php?droplet_id='.$droplet_id);
 | 
  
    | 44 | } else {
 | 
  
    | 45 |     $admin->print_success($TEXT['SUCCESS'], $module_edit_link);
 | 
  
    | 46 | }
 | 
  
    | 47 | 
 | 
  
    | 48 | // Print admin footer
 | 
  
    | 49 | $admin->print_footer();
 | 
  
    | 50 | 
 | 
  
    | 51 | ?>
 |