46 $q =
"DELETE FROM int_link WHERE source_type=".$ilDB->quote($a_source_type).
47 " AND source_id=".$ilDB->quote($a_source_id);
48 $ilias->db->query($q);
62 $st = $ilDB->prepareManip(
"DELETE FROM int_link WHERE target_type = ? ".
63 " AND target_id = ? AND target_inst = ? ",
64 array(
"text",
"integer",
"integer"));
65 $ilDB->execute($st, array($a_target_type, $a_target_id, $a_target_inst));
77 function _saveLink($a_source_type, $a_source_id, $a_target_type, $a_target_id, $a_target_inst = 0)
81 $q =
"REPLACE INTO int_link (source_type, source_id, target_type, target_id, target_inst) VALUES".
82 " (".$ilDB->quote($a_source_type).
83 ",".$ilDB->quote($a_source_id).
84 ",".$ilDB->quote($a_target_type).
85 ",".$ilDB->quote($a_target_id).
86 ",".$ilDB->quote($a_target_inst).
")";
87 $ilias->db->query($q);
101 global $ilias, $ilDB;
103 $q =
"SELECT * FROM int_link WHERE ".
104 "target_type = ".$ilDB->quote($a_target_type).
" AND ".
105 "target_id = ".$ilDB->quote($a_target_id).
" AND ".
106 "target_inst = ".$ilDB->quote($a_target_inst);
107 $source_set = $ilias->db->query($q);
111 $sources[$source_rec[
"source_type"].
":".$source_rec[
"source_id"]] =
112 array(
"type" => $source_rec[
"source_type"],
"id" => $source_rec[
"source_id"]);
130 $q =
"SELECT * FROM int_link WHERE ".
131 "source_type = ".$ilDB->quote($a_source_type).
" AND ".
132 "source_id = ".$ilDB->quote($a_source_id);
134 $target_set = $ilDB->query($q);
138 $targets[$target_rec[
"target_type"].
":".$target_rec[
"target_id"].
":".$target_rec[
"target_inst"]] =
139 array(
"type" => $target_rec[
"target_type"],
"id" => $target_rec[
"target_id"],
140 "inst" => $target_rec[
"target_inst"]);
163 return "il__pg_".$id;
167 case "StructureObject":
171 return "il__st_".$id;
179 return "il__git_".$id;
187 return "il__mob_".$id;
191 case "RepositoryItem":
200 foreach ($refs as $ref)
202 return "il__obj_".$ref;
227 case "StructureObject":
239 case "RepositoryItem":
240 if (is_int(strpos($a_target,
"_")))
243 return $tree->isInTree(
$ref_id);
258 if (!is_int(strpos($a_target,
"__")))
260 $target = explode(
"_", $a_target);
276 if (!is_int(strpos($a_target,
"__")))
278 $target = explode(
"_", $a_target);
281 return "il__".$target[2].
"_".$target[3];
294 $target = explode(
"_", $a_target);
295 return $target[count($target) - 1];
305 $target = explode(
"_", $a_target);
306 return $target[count($target) - 2];