Project

General

Profile

1
<?php
2
/**
3
 *
4
 * @category        modules
5
 * @package         news
6
 * @author          WebsiteBaker Project
7
 * @copyright       Ryan Djurovich
8
 * @copyright       WebsiteBaker Org. e.V.
9
 * @link            http://websitebaker.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.3
12
 * @requirements    PHP 5.3.6 and higher
13
 * @version         $Id: move_up.php 2 2017-07-02 15:14:29Z Manuela $
14
 * @filesource      $HeadURL: svn://isteam.dynxs.de/wb/2.10.x/branches/main/modules/news/move_up.php $
15
 * @lastmodified    $Date: 2017-07-02 17:14:29 +0200 (Sun, 02 Jul 2017) $
16
 *
17
 */
18

    
19
if ( !defined( 'WB_PATH' ) ){ require( dirname(dirname((__DIR__))).'/config.php' ); }
20
// Include WB admin wrapper script
21
require(WB_PATH.'/modules/admin.php');
22
$backlink = ADMIN_URL.'/pages/modify.php?page_id='.(int)$page_id;
23
// Get id
24
$pid = isset($aRequestVars['post_id']) ?$admin->checkIDKEY('post_id', false, 'GET'):0;
25
$gid = isset($aRequestVars['group_id']) ?$admin->checkIDKEY('group_id', false, 'GET'):0;
26
if (!$pid) {
27
    if (!$gid) {
28
        $admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], $backlink);
29
        exit();
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
// Create new order object an reorder
44
$order = new order($table, 'position', $id_field, 'section_id');
45
if($order->move_up($id)) {
46
    $admin->print_success($TEXT['SUCCESS'], $backlink);
47
} else {
48
    $admin->print_error($TEXT['ERROR'], $backlink);
49
}
50

    
51
// Print admin footer
52
$admin->print_footer();
(25-25/36)