function delete_link($parent_id, $child_id, $rel_type, $sort_order)
 {
     global $db;
     $q = "delete from relation where parent_id='" . $parent_id . "' and child_id='" . $child_id . "' and rel_type='" . $rel_type . "' and sort_order='" . $sort_order . "'";
     echo $q . "<br />";
     $set = $db->query($q);
     if (DB::isError($set)) {
         die($set->getMessage());
     }
     ADMIN_CHILDREN::resort_relation($parent_id, $rel_type);
 }
示例#2
0
 }
 switch ($_GET['action']) {
     case "add_child":
         ADMIN_CHILDREN::choose($_GET['node_id']);
         break;
     case "add_node":
         ADMIN_NODE::add_node(0, $_GET['node_type']);
         break;
     case "delete_node":
         ADMIN_NODE::delete_node($_GET['node_id']);
         break;
     case "delete_link":
         ADMIN_CHILDREN::delete_link($_GET['parent_id'], $_GET['node_id'], $_GET['rel_type'], $_GET['sort_order']);
         break;
     case "add_children_submit":
         ADMIN_CHILDREN::add_child($_GET['node_id']);
         break;
     case "edit_node":
         if (isset($_POST['data_edit']) && $_POST['data_edit'] == 'Odeslat') {
             $admin_data_write = new ADMIN_DATA_WRITE($_POST);
             $admin_data_write->write($_GET['edit_id']);
             echo $admin_data_write->saved;
         }
         if (isset($_GET['edit_id'])) {
             $admin_edit = new ADMIN_EDIT($_GET['edit_id']);
             $admin_edit->vypis();
         }
         break;
 }
 //vyrobi menu
 ADMIN_MENU::menu();