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"]);
159 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
166 return "il__pg_".$id;
170 case "StructureObject":
174 return "il__st_".$id;
182 return "il__git_".$id;
192 return "il__wpage_".$id;
200 return "il__mob_".$id;
204 case "RepositoryItem":
206 $tarr = explode(
"_", $a_target);
207 $import_id = $a_target;
213 $import_id = $tarr[0].
"_".$tarr[1].
"_".$tarr[2].
"_".$tarr[3];
221 return "il__obj_".$tarr[4];
233 foreach ($refs as $ref)
235 return "il__obj_".$ref;
260 case "StructureObject":
273 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
277 case "RepositoryItem":
278 if (is_int(strpos($a_target,
"_")))
281 return $tree->isInTree(
$ref_id);
296 if (!is_int(strpos($a_target,
"__")))
298 $target = explode(
"_", $a_target);
314 if (!is_int(strpos($a_target,
"__")))
316 $target = explode(
"_", $a_target);
319 return "il__".$target[2].
"_".$target[3];
332 $target = explode(
"_", $a_target);
333 return $target[count($target) - 1];
343 $target = explode(
"_", $a_target);
344 return $target[count($target) - 2];
_getTargetsOfSource($a_source_type, $a_source_id, $a_source_lang="-")
Get all targets of a source object (e.g., a page)
_exists($a_id)
checks wether a glossary term with specified id exists or not
_deleteAllLinksOfSource($a_source_type, $a_source_id, $a_lang="-")
Delete all links of a given source.
_exists($a_id)
checks wether a lm content object with specified id exists or not
_saveLink($a_source_type, $a_source_id, $a_target_type, $a_target_id, $a_target_inst=0, $a_source_lang="-")
save internal link information
_getIdForImportId($a_import_id)
get current object id for import id (static)
_getIdForImportId($a_type, $a_target)
Get current id for an import id.
_extractTypeOfTarget($a_target)
Extract type out of target.
_removeInstFromTarget($a_target)
Removes installation id from target string.
_getSourcesOfTarget($a_target_type, $a_target_id, $a_target_inst)
get all sources of a link target
_extractObjIdOfTarget($a_target)
Extract object id out of target.
static _getAllReferences($a_id)
get all reference ids of object
_getIdForImportId($a_import_id)
get current term id for import id (static)
static _exists($a_parent_type, $a_id, $a_lang="")
Checks whether page exists.
_extractInstOfTarget($a_target)
Extract installation id out of target.
_getIdForImportId($a_import_id)
get current object id for import id (static)
_deleteAllLinksToTarget($a_target_type, $a_target_id, $a_target_inst=0)
Delete all links to a given target.
_exists($a_type, $a_target)
Check if internal link refers to a valid target.