33 $this->
user = $DIC->user();
34 $this->
lng = $DIC->language();
35 $this->rbacsystem =
$DIC->rbac()->system();
36 $this->
access = $DIC->access();
88 $ilUser =
$DIC->user();
90 if ($a_user_id == 0) {
91 $a_user_id = $ilUser->getId();
94 if (isset(self::$lo_access[$a_ref_id])) {
95 $acc_rec[
"obj_id"] = self::$lo_access[$a_ref_id];
97 $q =
"SELECT * FROM lo_access WHERE " .
98 "usr_id = " .
$ilDB->quote($a_user_id,
"integer") .
" AND " .
99 "lm_id = " .
$ilDB->quote($a_ref_id,
"integer");
102 $acc_rec =
$ilDB->fetchAssoc($acc_set);
105 if (($acc_rec[
"obj_id"] ?? 0) > 0) {
107 $mtree =
new ilTree($lm_id);
108 $mtree->setTableNames(
'lm_tree',
'lm_data');
109 $mtree->setTreeTablePK(
"lm_id");
110 if ($mtree->isInTree($acc_rec[
"obj_id"])) {
111 return $acc_rec[
"obj_id"];
122 $ilAccess =
$DIC->access();
124 $t_arr = explode(
"_", $target);
126 if (($t_arr[0] !=
"lm" && $t_arr[0] !=
"st"
127 && $t_arr[0] !=
"pg")
128 || ((
int) $t_arr[1]) <= 0) {
132 if ($t_arr[0] ==
"lm") {
133 if ($ilAccess->checkAccess(
"read",
"", $t_arr[1]) ||
134 $ilAccess->checkAccess(
"visible",
"", $t_arr[1])) {
138 if (($t_arr[2] ?? 0) > 0) {
139 $ref_ids = array($t_arr[2]);
146 foreach ($ref_ids as
$ref_id) {
148 if ($ilAccess->checkAccess(
"read",
"",
$ref_id)) {
156 public static function _preloadData(array $obj_ids, array $ref_ids): void
160 $reading_time_manager = new \ILIAS\LearningModule\ReadingTime\ReadingTimeManager();
161 $reading_time_manager->loadData($obj_ids);
164 $ilUser =
$DIC->user();
166 $q =
"SELECT obj_id, lm_id FROM lo_access WHERE " .
167 "usr_id = " .
$ilDB->quote($ilUser->getId(),
"integer") .
" AND " .
168 $ilDB->in(
"lm_id", $ref_ids,
false,
"integer");
170 foreach ($ref_ids as $r) {
171 self::$lo_access[$r] = 0;
173 while ($rec =
$ilDB->fetchAssoc($set)) {
174 self::$lo_access[$rec[
"lm_id"]] = $rec[
"obj_id"];
static _lookupContainerSetting(int $a_id, string $a_keyword, ?string $a_default_value=null)
static _lookupContObjID(int $a_id)
get learning module id for lm object
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static isInfoEnabled(int $obj_id)
static _checkGoto(string $target)
check whether goto script will succeed
_checkAccess(string $cmd, string $permission, int $ref_id, int $obj_id, ?int $user_id=null)
Checks whether a user may invoke a command or not (this method is called by ilAccessHandler::checkAcc...
static _getLastAccessedPage(int $a_ref_id, int $a_user_id=0)
static _preloadData(array $obj_ids, array $ref_ids)
Preload data.
const INFO_TAB_VISIBILITY
static _getAllReferences(int $id)
get all reference ids for object ID
static _lookupObjId(int $ref_id)
static lookupOfflineStatus(int $obj_id)
Lookup offline status using objectDataCache.
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
addInfoItem(string $a_type, string $a_text, string $a_data="")
add an info item to current info object