31 string $a_source_type,
37 $ilDB = $DIC->database();
41 $lang_where =
" AND source_lang = " .
$ilDB->quote($a_lang,
"text");
44 $q =
"DELETE FROM int_link WHERE source_type = " .
45 $ilDB->quote($a_source_type,
"text") .
" AND source_id=" .
46 $ilDB->quote($a_source_id,
"integer") .
55 string $a_target_type,
57 int $a_target_inst = 0
61 $ilDB = $DIC->database();
64 "DELETE FROM int_link WHERE target_type = %s " .
65 " AND target_id = %s AND target_inst = %s ",
66 array(
"text",
"integer",
"integer"),
67 array($a_target_type, $a_target_id, $a_target_inst)
75 string $a_source_type,
77 string $a_target_type,
79 int $a_target_inst = 0,
80 string $a_source_lang =
"-" 84 $ilDB = $DIC->database();
89 "source_type" => array(
"text", $a_source_type),
90 "source_id" => array(
"integer", $a_source_id),
91 "source_lang" => array(
"text", $a_source_lang),
92 "target_type" => array(
"text", $a_target_type),
93 "target_id" => array(
"integer", $a_target_id),
94 "target_inst" => array(
"integer", $a_target_inst)
108 string $a_target_type,
114 $ilDB = $DIC->database();
116 $q =
"SELECT * FROM int_link WHERE " .
117 "target_type = " .
$ilDB->quote($a_target_type,
"text") .
" AND " .
118 "target_id = " .
$ilDB->quote($a_target_id,
"integer") .
" AND " .
119 "target_inst = " .
$ilDB->quote($a_target_inst,
"integer");
120 $source_set =
$ilDB->query(
$q);
122 while ($source_rec =
$ilDB->fetchAssoc($source_set)) {
123 $sources[$source_rec[
"source_type"] .
":" . $source_rec[
"source_id"] .
":" . $source_rec[
"source_lang"]] =
124 array(
"type" => $source_rec[
"source_type"],
"id" => $source_rec[
"source_id"],
125 "lang" => $source_rec[
"source_lang"]);
139 string $a_source_type,
141 string $a_source_lang =
"-" 145 $ilDB = $DIC->database();
148 if ($a_source_lang !==
"") {
149 $lang_where =
" AND source_lang = " .
$ilDB->quote($a_source_lang,
"text");
152 $q =
"SELECT * FROM int_link WHERE " .
153 "source_type = " .
$ilDB->quote($a_source_type,
"text") .
" AND " .
154 "source_id = " .
$ilDB->quote($a_source_id,
"integer") .
157 $target_set =
$ilDB->query(
$q);
159 while ($target_rec =
$ilDB->fetchAssoc($target_set)) {
160 $targets[$target_rec[
"target_type"] .
":" . $target_rec[
"target_id"] .
":" . $target_rec[
"target_inst"]] =
161 array(
"type" => $target_rec[
"target_type"],
"id" => $target_rec[
"target_id"],
162 "inst" => $target_rec[
"target_inst"]);
183 return "il__pg_" .
$id;
187 case "StructureObject":
190 return "il__st_" .
$id;
198 return "il__git_" .
$id;
215 return "il__mob_" .
$id;
219 case "RepositoryItem":
221 $tarr = explode(
"_", $a_target);
222 $import_id = $a_target;
227 if (($tarr[4] ??
"") !=
"") {
228 $import_id = $tarr[0] .
"_" . $tarr[1] .
"_" . $tarr[2] .
"_" . $tarr[3];
237 foreach ($refs as $ref) {
238 return "il__obj_" . $ref;
245 if (self::_extractInstOfTarget($a_target) ==
IL_INST_ID 248 if (($tarr[4] ??
"") !=
"") {
249 return "il__obj_" . $tarr[4];
271 $tree = $DIC->repositoryTree();
275 case "StructureObject":
287 case "RepositoryItem":
288 if (is_int(strpos($a_target,
"_"))) {
289 $ref_id = self::_extractObjIdOfTarget($a_target);
290 return $tree->isInTree(
$ref_id);
304 if (!is_int(strpos($a_target,
"__"))) {
305 $target = explode(
"_", $a_target);
306 if (isset($target[1]) && $target[1] > 0) {
307 return (
int) $target[1];
319 if (!is_int(strpos($a_target,
"__"))) {
320 $target = explode(
"_", $a_target);
321 if ($target[1] > 0) {
322 return "il__" . $target[2] .
"_" . $target[3];
334 $target = explode(
"_", $a_target);
335 return (
int) $target[count($target) - 1];
344 $target = explode(
"_", $a_target);
345 return (
string) ($target[count($target) - 2] ??
"");
357 $query_parser->setMinWordLength(3);
358 $query_parser->parse();
361 $user_search->enableActiveCheck(
true);
362 $user_search->setFields(array(
'login'));
363 $result_obj = $user_search->performSearch();
364 $result->mergeEntries($result_obj);
366 $user_search->setFields(array(
'firstname'));
367 $result_obj = $user_search->performSearch();
368 $result->mergeEntries($result_obj);
370 $user_search->setFields(array(
'lastname'));
371 $result_obj = $user_search->performSearch();
372 $result->mergeEntries($result_obj);
374 $result->setMaxHits(100000);
375 $result->preventOverwritingMaxhits(
true);
383 $users = array_intersect($users, $p[
"public"]);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getTargetsOfSource(string $a_source_type, int $a_source_id, string $a_source_lang="-")
Get all targets of a source object (e.g., a page)
static _getSourcesOfTarget(string $a_target_type, int $a_target_id, int $a_target_inst)
get all sources of a link target
static _removeInstFromTarget(string $a_target)
Removes installation id from target string.
static _extractObjIdOfTarget(string $a_target)
Extract object id out of target.
static getProfileStatusOfUsers(array $a_user_ids)
Get profile status.
static _exists(int $a_id)
checks whether a glossary term with specified id exists or not
static _getIdForImportId(string $a_import_id)
static _getAllReferences(int $id)
get all reference ids for object ID
static _getUserSearchInstance(ilQueryParser $query_parser)
static _getIdForImportId(string $import_id)
static _saveLink(string $a_source_type, int $a_source_id, string $a_target_type, int $a_target_id, int $a_target_inst=0, string $a_source_lang="-")
save internal link information
static _extractInstOfTarget(string $a_target)
Extract installation id out of target.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
static _deleteAllLinksOfSource(string $a_source_type, int $a_source_id, string $a_lang="-")
Delete all links of a given source.
static _getIdForImportId(string $a_import_id)
get current object id for import id (static)
static _getIdForImportId(string $a_type, string $a_target)
Get current id for an import id.
static _deleteAllLinksToTarget(string $a_target_type, int $a_target_id, int $a_target_inst=0)
Delete all links to a given target.
static searchUsers(string $a_search_str)
Search users.
static _exists(int $a_id)
checks wether a lm content object with specified id exists or not
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _extractTypeOfTarget(string $a_target)
Extract type out of target.
static _exists(string $a_type, string $a_target)
Check if internal link refers to a valid target.