Project

General

Profile

1
<?php
2
/**
3
 *
4
 * @category        module
5
 * @package         Form
6
 * @author          WebsiteBaker Project
7
 * @copyright       2009-2011, Website Baker Org. e.V.
8
 * @link			http://www.websitebaker2.org/
9
 * @license         http://www.gnu.org/licenses/gpl.html
10
 * @platform        WebsiteBaker 2.8.x
11
 * @requirements    PHP 5.2.2 and higher
12
 * @version         $Id: delete_field.php 1745 2012-09-08 13:06:55Z Luisehahne $
13
 * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/modules/form/delete_field.php $
14
 * @lastmodified    $Date: 2012-09-08 15:06:55 +0200 (Sat, 08 Sep 2012) $
15
 * @description
16
 */
17

    
18
require('../../config.php');
19

    
20
// Include WB admin wrapper script
21
$update_when_modified = true; // Tells script to update when this page was last updated
22
require(WB_PATH.'/modules/admin.php');
23

    
24
// Get id
25
$field_id = intval($admin->checkIDKEY('field_id', false, 'GET'));
26
if (!$field_id) {
27
 $admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id);
28
}
29

    
30
$sec_anchor = '#'.(defined( 'SEC_ANCHOR' ) && ( SEC_ANCHOR != '' )  ? SEC_ANCHOR.$section_id : 'section_'.$section_id );
31

    
32
// Delete row
33
$database->query("DELETE FROM ".TABLE_PREFIX."mod_form_fields WHERE field_id = '$field_id'");
34

    
35
// Include the ordering class
36
require(WB_PATH.'/framework/class.order.php');
37

    
38
// Create new order object an reorder
39
$order = new order(TABLE_PREFIX.'mod_form_fields', 'position', 'field_id', 'section_id');
40

    
41
if(!$order->clean($section_id)) {
42
	$admin->print_error($database->get_error(), ADMIN_URL.'/pages/modify.php?page_id='.$page_id.$sec_anchor);
43
} else {
44
	$admin->print_success($TEXT['SUCCESS'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id.$sec_anchor);
45
}
46

    
47
// Print admin footer
48
$admin->print_footer();
(7-7/25)