Project

General

Profile

« Previous | Next » 

Revision 1457

Added by Dietmar almost 13 years ago

Preparing 2.8.2 stable, last tests

View differences:

move_up.php
1
<?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
// Get id
25
$pid = $admin->checkIDKEY('post_id', false, 'GET');
26
$gid = $admin->checkIDKEY('group_id', false, 'GET');
27
if (!$pid) {
28
	if (!$gid) {
29
		$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], ADMIN_URL);
30
		exit();
31
	} else {
32
		$id = $gid;
33
		$id_field = 'group_id';
34
		$table = TABLE_PREFIX.'mod_news_groups';
35
	}
36
} else {
37
	$id = $pid;
38
	$id_field = 'post_id';
39
	$table = TABLE_PREFIX.'mod_news_posts';
40
}
41

  
42
// Include the ordering class
43
require(WB_PATH.'/framework/class.order.php');
44

  
45
// Create new order object an reorder
46
$order = new order($table, 'position', $id_field, 'section_id');
47
if($order->move_up($id)) {
48
	$admin->print_success($TEXT['SUCCESS'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id);
49
} else {
50
	$admin->print_error($TEXT['ERROR'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id);
51
}
52

  
53
// Print admin footer
54
$admin->print_footer();
55

  
56
?>
1
<?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
// Get id
25
$pid = $admin->checkIDKEY('post_id', false, 'GET');
26
$gid = $admin->checkIDKEY('group_id', false, 'GET');
27
if (!$pid) {
28
	if (!$gid) {
29
		$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], ADMIN_URL);
30
	} else {
31
		$id = $gid;
32
		$id_field = 'group_id';
33
		$table = TABLE_PREFIX.'mod_news_groups';
34
	}
35
} else {
36
	$id = $pid;
37
	$id_field = 'post_id';
38
	$table = TABLE_PREFIX.'mod_news_posts';
39
}
40

  
41
// Include the ordering class
42
require(WB_PATH.'/framework/class.order.php');
43

  
44
// Create new order object an reorder
45
$order = new order($table, 'position', $id_field, 'section_id');
46
if($order->move_up($id)) {
47
	$admin->print_success($TEXT['SUCCESS'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id);
48
} else {
49
	$admin->print_error($TEXT['ERROR'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id);
50
}
51

  
52
// Print admin footer
53
$admin->print_footer();
57 54

  

Also available in: Unified diff