Project

General

Profile

1 1457 Luisehahne
<?php
2
/**
3
 *
4
 * @category        modules
5
 * @package         news
6
 * @author          WebsiteBaker Project
7
 * @copyright       2004-2009, Ryan Djurovich
8
 * @copyright       2009-2011, Website Baker Org. e.V.
9
 * @link			http://www.websitebaker2.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.x
12
 * @requirements    PHP 5.2.2 and higher
13
 * @version         $Id$
14
 * @filesource		$HeadURL$
15
 * @lastmodified    $Date$
16
 *
17
 */
18
19
require('../../config.php');
20
21
// Include WB admin wrapper script
22
require(WB_PATH.'/modules/admin.php');
23
24 1473 Luisehahne
$backlink = ADMIN_URL.'/pages/modify.php?page_id='.(int)$page_id;
25 1457 Luisehahne
// Get id
26
$pid = $admin->checkIDKEY('post_id', false, 'GET');
27
$gid = $admin->checkIDKEY('group_id', false, 'GET');
28
if (!$pid) {
29
	if (!$gid) {
30 1473 Luisehahne
		$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], $backlink);
31 1457 Luisehahne
		exit();
32
	} else {
33
		$id = $gid;
34
		$id_field = 'group_id';
35
		$table = TABLE_PREFIX.'mod_news_groups';
36
	}
37
} else {
38
	$id = $pid;
39
	$id_field = 'post_id';
40
	$table = TABLE_PREFIX.'mod_news_posts';
41
}
42
43
// Include the ordering class
44
require(WB_PATH.'/framework/class.order.php');
45
46
// Create new order object an reorder
47
$order = new order($table, 'position', $id_field, 'section_id');
48
if($order->move_down($id)) {
49 1473 Luisehahne
	$admin->print_success($TEXT['SUCCESS'], $backlink);
50 1457 Luisehahne
} else {
51 1473 Luisehahne
	$admin->print_error($TEXT['ERROR'], $backlink);
52 1457 Luisehahne
}
53
54
// Print admin footer
55
$admin->print_footer();