26 $q =
"DELETE FROM int_link WHERE source_type = ".
27 $ilDB->quote($a_source_type,
"text").
" AND source_id=".
28 $ilDB->quote((
int) $a_source_id,
"integer");
29 $ilDB->manipulate(
$q);
43 $ilDB->manipulateF(
"DELETE FROM int_link WHERE target_type = %s ".
44 " AND target_id = %s AND target_inst = %s ",
45 array(
"text",
"integer",
"integer"),
46 array($a_target_type, (
int) $a_target_id, (
int) $a_target_inst));
58 function _saveLink($a_source_type, $a_source_id, $a_target_type, $a_target_id, $a_target_inst = 0)
62 $ilDB->manipulate(
"DELETE FROM int_link WHERE ".
63 "source_type = ".$ilDB->quote($a_source_type,
"text").
" AND ".
64 "source_id = ".$ilDB->quote((
int) $a_source_id,
"integer").
" AND ".
65 "target_type = ".$ilDB->quote($a_target_type,
"text").
" AND ".
66 "target_id = ".$ilDB->quote((
int) $a_target_id,
"integer").
" AND ".
67 "target_inst = ".$ilDB->quote((
int) $a_target_inst,
"integer"));
68 $ilDB->manipulate(
"INSERT INTO int_link ".
69 "(source_type, source_id, target_type, target_id, target_inst) VALUES (".
70 $ilDB->quote($a_source_type,
"text").
",".
71 $ilDB->quote((
int) $a_source_id,
"integer").
",".
72 $ilDB->quote($a_target_type,
"text").
",".
73 $ilDB->quote((
int) $a_target_id,
"integer").
",".
74 $ilDB->quote((
int) $a_target_inst,
"integer").
")");
90 $q =
"SELECT * FROM int_link WHERE ".
91 "target_type = ".$ilDB->quote($a_target_type,
"text").
" AND ".
92 "target_id = ".$ilDB->quote((
int) $a_target_id,
"integer").
" AND ".
93 "target_inst = ".$ilDB->quote((
int) $a_target_inst,
"integer");
94 $source_set = $ilDB->query(
$q);
96 while ($source_rec = $ilDB->fetchAssoc($source_set))
98 $sources[$source_rec[
"source_type"].
":".$source_rec[
"source_id"]] =
99 array(
"type" => $source_rec[
"source_type"],
"id" => $source_rec[
"source_id"]);
117 $q =
"SELECT * FROM int_link WHERE ".
118 "source_type = ".$ilDB->quote($a_source_type,
"text").
" AND ".
119 "source_id = ".$ilDB->quote((
int) $a_source_id,
"integer");
121 $target_set = $ilDB->query(
$q);
123 while ($target_rec = $ilDB->fetchAssoc($target_set))
125 $targets[$target_rec[
"target_type"].
":".$target_rec[
"target_id"].
":".$target_rec[
"target_inst"]] =
126 array(
"type" => $target_rec[
"target_type"],
"id" => $target_rec[
"target_id"],
127 "inst" => $target_rec[
"target_inst"]);
150 return "il__pg_".$id;
154 case "StructureObject":
158 return "il__st_".$id;
166 return "il__git_".$id;
174 return "il__mob_".$id;
178 case "RepositoryItem":
187 foreach ($refs as $ref)
189 return "il__obj_".$ref;
214 case "StructureObject":
226 case "RepositoryItem":
227 if (is_int(strpos($a_target,
"_")))
230 return $tree->isInTree(
$ref_id);
245 if (!is_int(strpos($a_target,
"__")))
247 $target = explode(
"_", $a_target);
263 if (!is_int(strpos($a_target,
"__")))
265 $target = explode(
"_", $a_target);
268 return "il__".$target[2].
"_".$target[3];
281 $target = explode(
"_", $a_target);
282 return $target[count($target) - 1];
292 $target = explode(
"_", $a_target);
293 return $target[count($target) - 2];