function movefield($direction) { checkPerm('mod'); $out =& $GLOBALS['page']; $id_common = importVar('id_common', true, 0); $re_field = sql_query("\r\n\tSELECT tf.type_file, tf.type_class, f.sequence\r\n\tFROM " . $GLOBALS['prefix_fw'] . "_field_type AS tf JOIN\r\n\t\t" . $GLOBALS['prefix_fw'] . "_field AS f\r\n\tWHERE tf.type_field = f.type_field AND\r\n\t\tid_common = '" . (int) $id_common . "'"); list($type_file_1, $type_class_1, $sequence) = sql_fetch_row($re_field); if ($direction == 'up') { $next_seq = $sequence - 1; } else { $next_seq = $sequence + 1; } $query_field_2 = "\r\n\tSELECT tf.type_file, tf.type_class, f.id_common\r\n\tFROM " . $GLOBALS['prefix_fw'] . "_field_type AS tf JOIN\r\n\t\t" . $GLOBALS['prefix_fw'] . "_field AS f\r\n\tWHERE tf.type_field = f.type_field AND\r\n\t\tf.sequence = '" . (int) $next_seq . "'"; $re_field_2 = sql_query($query_field_2); list($type_file_2, $type_class_2, $id_common_2) = sql_fetch_row($re_field_2); $back = urldecode(importVar('back')); if ($type_file_2 == '') { fixsequence(false); $re_field_2 = sql_query($query_field_2); list($type_file_2, $type_class_2, $id_common_2) = sql_fetch_row($re_field_2); if ($type_file_2 == '') { Util::jump_to($back); } } require_once $GLOBALS['where_framework'] . '/modules/field/' . $type_file_1; $first_instance = eval("return new {$type_class_1}( {$id_common} );"); $first_instance->movetoposition($next_seq); require_once $GLOBALS['where_framework'] . '/modules/field/' . $type_file_2; $second_instance = eval("return new {$type_class_2}( {$id_common_2} );"); $second_instance->movetoposition($sequence); Util::jump_to($back); }
case "modlinkcat": modlinkcat(); break; case "uplinkcat": uplinkcat(); break; //mod //mod case "movedown": movelink('down'); break; case "moveup": movelink('up'); break; case "fixsequence": fixsequence(); break; //add link //add link case "newlink": newlink(); break; case "inslink": inslink(); break; //mod link //mod link case "modlink": modlink(); break; case "uplink":