35 $this->
user = $DIC->user();
36 $this->
lng = $DIC->language();
37 $this->rbacsystem = $DIC->rbac()->system();
38 $this->
access = $DIC->access();
41 public function _checkAccess(
string $cmd,
string $permission,
int $ref_id,
int $obj_id, ?
int $user_id = null): bool
46 switch ($permission) {
49 if (self::_determineStartUrl($obj_id) ===
"") {
62 "permission" =>
"read",
"cmd" =>
"view",
"lang_var" =>
"show",
65 [
"permission" =>
"write",
"cmd" =>
"edit",
"lang_var" =>
"edit_content"],
66 [
"permission" =>
"write",
"cmd" =>
"properties",
"lang_var" =>
"settings"]
78 $ilDB = $DIC->database();
80 if (isset(self::$startfile[$a_id])) {
81 $start_file = self::$startfile[$a_id];
83 $q =
"SELECT startfile FROM file_based_lm WHERE id = " .
$ilDB->quote($a_id,
"integer");
84 $set =
$ilDB->query($q);
85 $rec =
$ilDB->fetchAssoc($set);
86 $start_file = $rec[
"startfile"];
87 self::$startfile[$a_id] = $start_file .
"";
92 if (($start_file !==
"") &&
93 (is_file($dir .
"/" . $start_file))) {
94 return "./" . $dir .
"/" . $start_file;
95 } elseif (is_file($dir .
"/index.html")) {
96 return "./" . $dir .
"/index.html";
97 } elseif (is_file($dir .
"/index.htm")) {
98 return "./" . $dir .
"/index.htm";
108 $ilAccess = $DIC->access();
110 $t_arr = explode(
"_", $target);
112 if ($t_arr[0] !==
"htlm" || ((
int) $t_arr[1]) <= 0) {
116 if ($ilAccess->checkAccess(
"visible",
"", $t_arr[1]) ||
117 $ilAccess->checkAccess(
"read",
"", $t_arr[1])) {
130 $lm_dir = $lm_data_dir . DIRECTORY_SEPARATOR .
"lm_" . $a_id;
135 public static function _preloadData(array $obj_ids, array $ref_ids): void
139 $ilDB = $DIC->database();
141 $q =
"SELECT id, startfile FROM file_based_lm WHERE " .
142 $ilDB->in(
"id", $obj_ids,
false,
"integer");
146 self::$startfile[$rec[
"id"]] = $rec[
"startfile"] .
"";
static getWebspaceDir(string $mode="filesystem")
get webspace directory
const IL_NO_OBJECT_ACCESS
addInfoItem(string $a_type, string $a_text, string $a_data="")
add an info item to current info 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...
static _preloadData(array $obj_ids, array $ref_ids)
static _checkGoto(string $target)
static isInfoEnabled(int $obj_id)
static _lookupDiskUsage(int $a_id)
Returns the number of bytes used on the harddisk by the learning module with the specified object id...
static _lookupContainerSetting(int $a_id, string $a_keyword, string $a_default_value=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static dirsize(string $directory)
get size of a directory or a file.
const INFO_TAB_VISIBILITY
_checkAccess(string $cmd, string $permission, int $ref_id, int $obj_id, ?int $user_id=null)
static _determineStartUrl(int $a_id)