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->manipulate(
"DELETE FROM int_link WHERE ".
72 "source_type = ".$ilDB->quote($a_source_type,
"text").
" AND ".
73 "source_id = ".$ilDB->quote((
int) $a_source_id,
"integer").
" AND ".
74 "target_type = ".$ilDB->quote($a_target_type,
"text").
" AND ".
75 "target_id = ".$ilDB->quote((
int) $a_target_id,
"integer").
" AND ".
76 "target_inst = ".$ilDB->quote((
int) $a_target_inst,
"integer").
" AND ".
77 "source_lang = ".$ilDB->quote($a_source_lang,
"text"));
78 $ilDB->manipulate(
"INSERT INTO int_link ".
79 "(source_type, source_id, target_type, target_id, target_inst, source_lang) VALUES (".
80 $ilDB->quote($a_source_type,
"text").
",".
81 $ilDB->quote((
int) $a_source_id,
"integer").
",".
82 $ilDB->quote($a_target_type,
"text").
",".
83 $ilDB->quote((
int) $a_target_id,
"integer").
",".
84 $ilDB->quote((
int) $a_target_inst,
"integer").
",".
85 $ilDB->quote($a_source_lang,
"text").
")");
101 $q =
"SELECT * FROM int_link WHERE ".
102 "target_type = ".$ilDB->quote($a_target_type,
"text").
" AND ".
103 "target_id = ".$ilDB->quote((
int) $a_target_id,
"integer").
" AND ".
104 "target_inst = ".$ilDB->quote((
int) $a_target_inst,
"integer");
105 $source_set = $ilDB->query($q);
107 while ($source_rec = $ilDB->fetchAssoc($source_set))
109 $sources[$source_rec[
"source_type"].
":".$source_rec[
"source_id"].
":".$source_rec[
"source_lang"]] =
110 array(
"type" => $source_rec[
"source_type"],
"id" => $source_rec[
"source_id"],
111 "lang" => $source_rec[
"source_lang"]);
130 if ($a_source_lang !=
"")
132 $lang_where =
" AND source_lang = ".$ilDB->quote($a_source_lang,
"text");
135 $q =
"SELECT * FROM int_link WHERE ".
136 "source_type = ".$ilDB->quote($a_source_type,
"text").
" AND ".
137 "source_id = ".$ilDB->quote((
int) $a_source_id,
"integer").
140 $target_set = $ilDB->query($q);
142 while ($target_rec = $ilDB->fetchAssoc($target_set))
144 $targets[$target_rec[
"target_type"].
":".$target_rec[
"target_id"].
":".$target_rec[
"target_inst"]] =
145 array(
"type" => $target_rec[
"target_type"],
"id" => $target_rec[
"target_id"],
146 "inst" => $target_rec[
"target_inst"]);
169 return "il__pg_".$id;
173 case "StructureObject":
177 return "il__st_".$id;
185 return "il__git_".$id;
195 return "il__wpage_".$id;
203 return "il__mob_".$id;
207 case "RepositoryItem":
209 $tarr = explode(
"_", $a_target);
210 $import_id = $a_target;
216 $import_id = $tarr[0].
"_".$tarr[1].
"_".$tarr[2].
"_".$tarr[3];
224 return "il__obj_".$tarr[4];
236 foreach ($refs as $ref)
238 return "il__obj_".$ref;
263 case "StructureObject":
276 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
280 case "RepositoryItem":
281 if (is_int(strpos($a_target,
"_")))
284 return $tree->isInTree(
$ref_id);
299 if (!is_int(strpos($a_target,
"__")))
301 $target = explode(
"_", $a_target);
317 if (!is_int(strpos($a_target,
"__")))
319 $target = explode(
"_", $a_target);
322 return "il__".$target[2].
"_".$target[3];
335 $target = explode(
"_", $a_target);
336 return $target[count($target) - 1];
346 $target = explode(
"_", $a_target);
347 return $target[count($target) - 2];