$settings_fetch = $query_settings->fetchRow();
$sort_topics = $settings_fetch['sort_topics'];
// Include the ordering class
require WB_PATH . '/framework/class.order.php';
// Create new order object an reorder
$order = new order($table, 'position', $id_field, 'section_id');
$back_url = ADMIN_URL . '/pages/modify.php?page_id=' . $page_id . '&hl=' . $id . '#tpid' . $id;
if ($fredit == 1) {
    $back_url = WB_URL . '/modules/' . $mod_dir . '/modify_fe.php?page_id=' . $page_id . '&section_id=' . $section_id . '&fredit=1&hl=' . $id . '#tpid' . $id;
}
if ($sort_topics == 0) {
    if ($_GET['move'] == 'up') {
        $ok = $order->move_down($id);
    }
    if ($_GET['move'] == 'down') {
        $ok = $order->move_up($id);
    }
}
if ($sort_topics == -1) {
    if ($_GET['move'] == 'down') {
        $ok = $order->move_down($id);
    }
    if ($_GET['move'] == 'up') {
        $ok = $order->move_up($id);
    }
}
if ($ok) {
    $admin->print_success($TEXT['SUCCESS'], $back_url);
} else {
    $admin->print_error($TEXT['ERROR'], $back_url);
}
        $common_field = 'page_id';
        $table = TABLE_PREFIX . 'sections';
    } else {
        $id = $_GET['page_id'];
        $id_field = 'page_id';
        $common_field = 'parent';
        $table = TABLE_PREFIX . 'pages';
    }
} else {
    header("Location: index.php");
    exit(0);
}
// Create new admin object and print admin header
$admin = new admin('Pages', 'pages_settings');
// Create new order object an reorder
$order = new order($table, 'position', $id_field, $common_field);
if ($id_field == 'page_id') {
    if ($order->move_up($id)) {
        $admin->print_success($MESSAGE['PAGES_REORDERED']);
    } else {
        $admin->print_error($MESSAGE['PAGES_CANNOT_REORDER']);
    }
} else {
    if ($order->move_up($id)) {
        $admin->print_success($TEXT['SUCCESS'], ADMIN_URL . '/pages/sections.php?page_id=' . $page_id);
    } else {
        $admin->print_error($TEXT['ERROR'], ADMIN_URL . '/pages/sections.php?page_id=' . $page_id);
    }
}
// Print admin footer
$admin->print_footer();
예제 #3
0
 * @author          WebsiteBaker Project
 * @copyright       2004-2009, Ryan Djurovich
 * @copyright       2009-2011, Website Baker Org. e.V.
 * @link            http://www.websitebaker2.org/
 * @license         http://www.gnu.org/licenses/gpl.html
 * @platform        WebsiteBaker 2.8.x
 * @requirements    PHP 5.2.2 and higher
 * @version         $Id: move_up.php 1457 2011-06-25 17:18:50Z Luisehahne $
 * @filesource        $HeadURL: svn://isteam.dynxs.de/wb_svn/wb280/branches/2.8.x/wb/modules/form/move_up.php $
 * @lastmodified    $Date: 2011-06-25 19:18:50 +0200 (Sa, 25. Jun 2011) $
 * @description     
 */
require '../../config.php';
// Include WB admin wrapper script
require WB_PATH . '/modules/admin.php';
// Get id
$field_id = $admin->checkIDKEY('field_id', false, 'GET');
if (!$field_id) {
    $admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], ADMIN_URL . '/pages/modify.php?page_id=' . $page_id);
}
// Include the ordering class
require WB_PATH . '/framework/class.order.php';
// Create new order object an reorder
$order = new order(TABLE_PREFIX . 'mod_form_fields', 'position', 'field_id', 'section_id');
if ($order->move_up($field_id)) {
    $admin->print_success($TEXT['SUCCESS'], ADMIN_URL . '/pages/modify.php?page_id=' . $page_id);
} else {
    $admin->print_error($TEXT['ERROR'], ADMIN_URL . '/pages/modify.php?page_id=' . $page_id);
}
// Print admin footer
$admin->print_footer();