35 $this->
user = $DIC->user();
36 $this->
lng = $DIC->language();
37 $this->rbacsystem = $DIC->rbac()->system();
38 $this->
access = $DIC->access();
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 static $startfile = [];
79 if (isset($startfile[$a_id])) {
80 return $startfile[$a_id];
83 $ilDB = $DIC->database();
85 $q =
"SELECT startfile, rid FROM file_based_lm WHERE id = " .
$ilDB->quote($a_id,
"integer");
87 $rec =
$ilDB->fetchAssoc($set);
88 $start_file = $rec[
"startfile"] ??
'';
91 if (!empty($rec[
'rid'])) {
93 $rid = $DIC->resourceStorage()->manageContainer()->find($rec[
'rid']);
95 return $startfile[$a_id] =
"";
97 $zip = $DIC->resourceStorage()->consume()->containerZIP($rid)->getZIP();
98 foreach ($zip->getFiles() as $file) {
99 if ($file === $start_file) {
100 return $startfile[$a_id] = $start_file;
103 return $startfile[$a_id] =
"";
109 if (($start_file !==
"") && (is_file($dir .
"/" . $start_file))) {
110 return $startfile[$a_id] = str_replace(
111 realpath(__DIR__ .
'/../../../../public/'),
113 $dir .
"/" . $start_file
117 if (is_file($dir .
"/index.html")) {
118 return $startfile[$a_id] = str_replace(
119 realpath(__DIR__ .
'/../../../../public/'),
125 if (is_file($dir .
"/index.htm")) {
126 return $startfile[$a_id] = str_replace(realpath(__DIR__ .
'/../../../../public/'),
"", $dir .
"/index.htm");
129 return $startfile[$a_id] =
"";
136 $ilAccess = $DIC->access();
138 $t_arr = explode(
"_", $target);
140 if ($t_arr[0] !==
"htlm" || ((
int) $t_arr[1]) <= 0) {
144 if ($ilAccess->checkAccess(
"visible",
"", $t_arr[1]) ||
145 $ilAccess->checkAccess(
"read",
"", $t_arr[1])) {
158 $lm_dir = $lm_data_dir . DIRECTORY_SEPARATOR .
"lm_" . $a_id;
163 public static function _preloadData(array $obj_ids, array $ref_ids): void
167 $ilDB = $DIC->database();
169 $q =
"SELECT id, startfile FROM file_based_lm WHERE " .
170 $ilDB->in(
"id", $obj_ids,
false,
"integer");
174 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...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return 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 _lookupContainerSetting(int $a_id, string $a_keyword, ?string $a_default_value=null)
static _determineStartUrl(int $a_id)