25 string $a_source_type,
35 $lang_where =
" AND source_lang = " .
$ilDB->quote($a_lang,
"text");
38 $q =
"DELETE FROM int_link WHERE source_type = " .
39 $ilDB->quote($a_source_type,
"text") .
" AND source_id=" .
40 $ilDB->quote($a_source_id,
"integer") .
42 $ilDB->manipulate($q);
49 string $a_target_type,
51 int $a_target_inst = 0
58 "DELETE FROM int_link WHERE target_type = %s " .
59 " AND target_id = %s AND target_inst = %s ",
60 array(
"text",
"integer",
"integer"),
61 array($a_target_type, $a_target_id, $a_target_inst)
69 string $a_source_type,
71 string $a_target_type,
73 int $a_target_inst = 0,
74 string $a_source_lang =
"-"
83 "source_type" => array(
"text", $a_source_type),
84 "source_id" => array(
"integer", $a_source_id),
85 "source_lang" => array(
"text", $a_source_lang),
86 "target_type" => array(
"text", $a_target_type),
87 "target_id" => array(
"integer", $a_target_id),
88 "target_inst" => array(
"integer", $a_target_inst)
102 string $a_target_type,
110 $q =
"SELECT * FROM int_link WHERE " .
111 "target_type = " .
$ilDB->quote($a_target_type,
"text") .
" AND " .
112 "target_id = " .
$ilDB->quote($a_target_id,
"integer") .
" AND " .
113 "target_inst = " .
$ilDB->quote($a_target_inst,
"integer");
114 $source_set =
$ilDB->query($q);
116 while ($source_rec =
$ilDB->fetchAssoc($source_set)) {
117 $sources[$source_rec[
"source_type"] .
":" . $source_rec[
"source_id"] .
":" . $source_rec[
"source_lang"]] =
118 array(
"type" => $source_rec[
"source_type"],
"id" => $source_rec[
"source_id"],
119 "lang" => $source_rec[
"source_lang"]);
133 string $a_source_type,
135 string $a_source_lang =
"-"
142 if ($a_source_lang !==
"") {
143 $lang_where =
" AND source_lang = " .
$ilDB->quote($a_source_lang,
"text");
146 $q =
"SELECT * FROM int_link WHERE " .
147 "source_type = " .
$ilDB->quote($a_source_type,
"text") .
" AND " .
148 "source_id = " .
$ilDB->quote($a_source_id,
"integer") .
151 $target_set =
$ilDB->query($q);
153 while ($target_rec =
$ilDB->fetchAssoc($target_set)) {
154 $targets[$target_rec[
"target_type"] .
":" . $target_rec[
"target_id"] .
":" . $target_rec[
"target_inst"]] =
155 array(
"type" => $target_rec[
"target_type"],
"id" => $target_rec[
"target_id"],
156 "inst" => $target_rec[
"target_inst"]);
174 $wiki_import_resolver =
$DIC->wiki()->internal()->domain()->page()->importResolver();
180 return "il__pg_" .
$id;
184 case "StructureObject":
187 return "il__st_" .
$id;
195 return "il__git_" .
$id;
200 $id = $wiki_import_resolver->getIdForImportId($a_target);
202 return "il__wpage_" .
$id;
209 return "il__mob_" .
$id;
213 case "RepositoryItem":
215 $tarr = explode(
"_", $a_target);
216 $import_id = $a_target;
221 if (($tarr[4] ??
"") !=
"") {
222 $import_id = $tarr[0] .
"_" . $tarr[1] .
"_" . $tarr[2] .
"_" . $tarr[3];
231 foreach ($refs as $ref) {
232 return "il__obj_" . $ref;
239 if (self::_extractInstOfTarget($a_target) ==
IL_INST_ID
242 if (($tarr[4] ??
"") !=
"") {
243 return "il__obj_" . $tarr[4];
265 $tree =
$DIC->repositoryTree();
269 case "StructureObject":
281 case "RepositoryItem":
282 if (is_int(strpos($a_target,
"_"))) {
283 $ref_id = self::_extractObjIdOfTarget($a_target);
284 return $tree->isInTree($ref_id);
298 if (!is_int(strpos($a_target,
"__"))) {
299 $target = explode(
"_", $a_target);
313 if (!is_int(strpos($a_target,
"__"))) {
314 $target = explode(
"_", $a_target);
328 $target = explode(
"_", $a_target);
338 $target = explode(
"_", $a_target);
351 $query_parser->setMinWordLength(3);
352 $query_parser->parse();
355 $user_search->enableActiveCheck(
true);
356 $user_search->setFields(array(
'login'));
357 $result_obj = $user_search->performSearch();
358 $result->mergeEntries($result_obj);
360 $user_search->setFields(array(
'firstname'));
361 $result_obj = $user_search->performSearch();
362 $result->mergeEntries($result_obj);
364 $user_search->setFields(array(
'lastname'));
365 $result_obj = $user_search->performSearch();
366 $result->mergeEntries($result_obj);
368 $result->setMaxHits(100000);
369 $result->preventOverwritingMaxhits(
true);
377 $users = array_intersect($users, $p[
"public"]);
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
static _exists(int $a_id)
checks whether a glossary term with specified id exists or not
static _getIdForImportId(string $a_import_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static searchUsers(string $a_search_str)
Search users.
static _deleteAllLinksOfSource(string $a_source_type, int $a_source_id, string $a_lang="-")
Delete all links of a given source.
static _exists(string $a_type, string $a_target)
Check if internal link refers to a valid target.
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 _removeInstFromTarget(string $a_target)
Removes installation id from target string.
static _getSourcesOfTarget(string $a_target_type, int $a_target_id, int $a_target_inst)
get all sources of a link target
static _extractInstOfTarget(string $a_target)
Extract installation id out of target.
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 _extractObjIdOfTarget(string $a_target)
Extract object id out of target.
static _extractTypeOfTarget(string $a_target)
Extract type out of target.
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 _exists(int $a_id)
checks wether a lm content object with specified id exists or not
static _getIdForImportId(string $a_import_id)
get current object id for import id (static)
static getProfileStatusOfUsers(array $a_user_ids)
static _getUserSearchInstance(ilQueryParser $query_parser)
static _getAllReferences(int $id)
get all reference ids for object ID
static _getIdForImportId(string $import_id)
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...