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 static 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;
179 include_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
184 return "il__git_".$id;
194 return "il__wpage_".$id;
202 return "il__mob_".$id;
206 case "RepositoryItem":
208 $tarr = explode(
"_", $a_target);
209 $import_id = $a_target;
216 $import_id = $tarr[0].
"_".$tarr[1].
"_".$tarr[2].
"_".$tarr[3];
226 foreach ($refs as $ref)
228 return "il__obj_".$ref;
241 return "il__obj_".$tarr[4];
267 case "StructureObject":
268 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
273 include_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
278 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
283 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
287 case "RepositoryItem":
288 if (is_int(strpos($a_target,
"_")))
291 return $tree->isInTree(
$ref_id);
306 if (!is_int(strpos($a_target,
"__")))
308 $target = explode(
"_", $a_target);
324 if (!is_int(strpos($a_target,
"__")))
326 $target = explode(
"_", $a_target);
329 return "il__".$target[2].
"_".
$target[3];
342 $target = explode(
"_", $a_target);
353 $target = explode(
"_", $a_target);
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
static _removeInstFromTarget($a_target)
Removes installation id from target string.
static _exists($a_id)
checks wether a lm content object with specified id exists or not
static _extractInstOfTarget($a_target)
Extract installation id out of target.
static _getIdForImportId($a_import_id)
get current object id for import id (static)
static _extractTypeOfTarget($a_target)
Extract type out of target.
static _extractObjIdOfTarget($a_target)
Extract object id out of target.
static _getIdForImportId($a_type, $a_target)
Get current id for an import id.
static _getIdForImportId($a_import_id)
get current term id for import id (static)
static _saveLink($a_source_type, $a_source_id, $a_target_type, $a_target_id, $a_target_inst=0, $a_source_lang="-")
save internal link information
static _getAllReferences($a_id)
get all reference ids of object
static _exists($a_id)
checks wether a glossary term with specified id exists or not
static _exists($a_type, $a_target)
Check if internal link refers to a valid target.
static _getSourcesOfTarget($a_target_type, $a_target_id, $a_target_inst)
get all sources of a link target
static _getTargetsOfSource($a_source_type, $a_source_id, $a_source_lang="-")
Get all targets of a source object (e.g., a page)
Create styles array
The data for the language used.
static _deleteAllLinksOfSource($a_source_type, $a_source_id, $a_lang="-")
Delete all links of a given source.
static _deleteAllLinksToTarget($a_target_type, $a_target_id, $a_target_inst=0)
Delete all links to a given target.
static _getIdForImportId($a_import_id)
get current object id for import id (static)