Project

General

Profile

1 560 Ruebenwurz
<?php
2 1375 FrankH
/**
3
 *
4
 * @category        module
5
 * @package         Form
6
 * @author          WebsiteBaker Project
7 1919 Luisehahne
 * @copyright       2009-2013, WebsiteBaker Org. e.V.
8
 * @link            http://www.websitebaker.org/
9 1375 FrankH
 * @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$
13 1919 Luisehahne
 * @filesource      $HeadURL$
14 1457 Luisehahne
 * @lastmodified    $Date$
15 1745 Luisehahne
 * @description
16 1375 FrankH
 */
17 560 Ruebenwurz
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 1375 FrankH
// Get id
25 1553 Luisehahne
$field_id = intval($admin->checkIDKEY('field_id', false, 'GET'));
26 1375 FrankH
if (!$field_id) {
27
 $admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id);
28
}
29
30 1919 Luisehahne
$sSectionIdPrefix = (defined( 'SEC_ANCHOR' ) && ( SEC_ANCHOR != '' )  ? SEC_ANCHOR : 'Sec' );
31 1553 Luisehahne
32 560 Ruebenwurz
// Delete row
33
$database->query("DELETE FROM ".TABLE_PREFIX."mod_form_fields WHERE field_id = '$field_id'");
34
35 1375 FrankH
// 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 1553 Luisehahne
if(!$order->clean($section_id)) {
42 1919 Luisehahne
	$admin->print_error($database->get_error(), ADMIN_URL.'/pages/modify.php?page_id='.$page_id.'#'.$sSectionIdPrefix.$section_id);
43 560 Ruebenwurz
} else {
44 1919 Luisehahne
	$admin->print_success($TEXT['SUCCESS'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id.'#'.$sSectionIdPrefix.$section_id);
45 560 Ruebenwurz
}
46
47
// Print admin footer
48
$admin->print_footer();