예제 #1
0
function nodemoved()
{
    global $apx;
    if (!checkToken()) {
        return;
    }
    if (!$apx->user->has_right('teaser.edit')) {
        return;
    }
    $id = (int) $_REQUEST['id'];
    $beforeid = (int) $_REQUEST['before'];
    $afterid = (int) $_REQUEST['after'];
    if (!$id || !$beforeid && !$afterid) {
        return;
    }
    require_once BASEDIR . 'lib/class.orderedlist.php';
    $list = new OrderedList(PRE . '_teaser', 'id');
    //Vor einen Knoten verschieben
    if ($beforeid) {
        $list->moveBefore($id, $beforeid);
    } elseif ($afterid) {
        $list->moveAfter($id, $afterid);
    }
}
예제 #2
0
function listmoved()
{
    global $apx, $set;
    if (!checkToken()) {
        return;
    }
    if (!$apx->user->has_right('gallery.edit') || $set['gallery']['subgals'] || $set['gallery']['ordergal'] != 3) {
        return;
    }
    $id = (int) $_REQUEST['id'];
    $beforeid = (int) $_REQUEST['before'];
    $afterid = (int) $_REQUEST['after'];
    if (!$id || !$beforeid && !$afterid) {
        return;
    }
    require_once BASEDIR . 'lib/class.orderedlist.php';
    $list = new OrderedList(PRE . '_gallery', 'id');
    //Vor einen Knoten verschieben
    if ($beforeid) {
        $list->moveBefore($id, $beforeid);
    } elseif ($afterid) {
        $list->moveAfter($id, $afterid);
    }
}