30 $lang_where =
" AND source_lang = ".$ilDB->quote($a_lang,
"text");
33 $q =
"DELETE FROM int_link WHERE source_type = ".
34 $ilDB->quote($a_source_type,
"text").
" AND source_id=".
35 $ilDB->quote((
int) $a_source_id,
"integer").
37 $ilDB->manipulate($q);
51 $ilDB->manipulateF(
"DELETE FROM int_link WHERE target_type = %s ".
52 " AND target_id = %s AND target_inst = %s ",
53 array(
"text",
"integer",
"integer"),
54 array($a_target_type, (
int) $a_target_id, (
int) $a_target_inst));
66 function _saveLink($a_source_type, $a_source_id, $a_target_type, $a_target_id, $a_target_inst = 0,
71 $ilDB->replace(
"int_link",
73 "source_type" => array(
"text", $a_source_type),
74 "source_id" => array(
"integer", (
int) $a_source_id),
75 "source_lang" => array(
"text", $a_source_lang),
76 "target_type" => array(
"text", $a_target_type),
77 "target_id" => array(
"integer", (
int) $a_target_id),
78 "target_inst" => array(
"integer", (
int) $a_target_inst)
97 $q =
"SELECT * FROM int_link WHERE ".
98 "target_type = ".$ilDB->quote($a_target_type,
"text").
" AND ".
99 "target_id = ".$ilDB->quote((
int) $a_target_id,
"integer").
" AND ".
100 "target_inst = ".$ilDB->quote((
int) $a_target_inst,
"integer");
101 $source_set = $ilDB->query($q);
103 while ($source_rec = $ilDB->fetchAssoc($source_set))
105 $sources[$source_rec[
"source_type"].
":".$source_rec[
"source_id"].
":".$source_rec[
"source_lang"]] =
106 array(
"type" => $source_rec[
"source_type"],
"id" => $source_rec[
"source_id"],
107 "lang" => $source_rec[
"source_lang"]);
126 if ($a_source_lang !=
"")
128 $lang_where =
" AND source_lang = ".$ilDB->quote($a_source_lang,
"text");
131 $q =
"SELECT * FROM int_link WHERE ".
132 "source_type = ".$ilDB->quote($a_source_type,
"text").
" AND ".
133 "source_id = ".$ilDB->quote((
int) $a_source_id,
"integer").
136 $target_set = $ilDB->query($q);
138 while ($target_rec = $ilDB->fetchAssoc($target_set))
140 $targets[$target_rec[
"target_type"].
":".$target_rec[
"target_id"].
":".$target_rec[
"target_inst"]] =
141 array(
"type" => $target_rec[
"target_type"],
"id" => $target_rec[
"target_id"],
142 "inst" => $target_rec[
"target_inst"]);
165 return "il__pg_".$id;
169 case "StructureObject":
173 return "il__st_".$id;
181 return "il__git_".$id;
191 return "il__wpage_".$id;
199 return "il__mob_".$id;
203 case "RepositoryItem":
205 $tarr = explode(
"_", $a_target);
206 $import_id = $a_target;
212 $import_id = $tarr[0].
"_".$tarr[1].
"_".$tarr[2].
"_".$tarr[3];
220 return "il__obj_".$tarr[4];
232 foreach ($refs as $ref)
234 return "il__obj_".$ref;
259 case "StructureObject":
272 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
276 case "RepositoryItem":
277 if (is_int(strpos($a_target,
"_")))
280 return $tree->isInTree(
$ref_id);
295 if (!is_int(strpos($a_target,
"__")))
297 $target = explode(
"_", $a_target);
313 if (!is_int(strpos($a_target,
"__")))
315 $target = explode(
"_", $a_target);
318 return "il__".$target[2].
"_".$target[3];
331 $target = explode(
"_", $a_target);
332 return $target[count($target) - 1];
342 $target = explode(
"_", $a_target);
343 return $target[count($target) - 2];