30 bool $a_call_by_reference =
true
37 $this->db =
$DIC->database();
43 public function update(
bool $a_skip_meta =
false): bool
52 $ilDB->manipulate($q =
"UPDATE file_based_lm SET " .
53 " startfile = " .
$ilDB->quote($this->getStartFile(),
"text") .
" " .
54 " WHERE id = " .
$ilDB->quote($this->getId(),
"integer"));
58 public function read(): void
64 $q =
"SELECT * FROM file_based_lm WHERE id = " .
$ilDB->quote($this->
getId(),
"integer");
70 public function create(
bool $a_skip_meta =
false):
int
74 $id = parent::create();
77 $ilDB->manipulate(
"INSERT INTO file_based_lm (id, startfile) VALUES " .
78 " (" .
$ilDB->quote($this->getId(),
"integer") .
"," .
79 $ilDB->quote($this->getStartFile(),
"text") .
")");
89 $lm_dir = $lm_data_dir .
"/lm_" . $this->
getId();
106 bool $a_omit_file_check =
false
109 (file_exists($this->
getDataDirectory() .
"/" . $a_file) || $a_omit_file_check)) {
110 $this->start_file = $a_file;
115 public function delete():
bool
120 if (!parent::delete()) {
125 $this->deleteMetaData();
128 $ilDB->manipulate(
"DELETE FROM file_based_lm WHERE id = " .
129 $ilDB->quote($this->getId(),
"integer"));
145 string $a_filename =
""
147 preg_match(
"/.*htlm_([0-9]*)\.zip/", $a_filename, $match);
148 if (is_dir($a_dir .
"/htlm_" . ($match[1] ??
""))) {
149 $a_dir .=
"/htlm_" . ($match[1] ??
"");
155 public function cloneObject(
int $target_id,
int $copy_id = 0,
bool $omit_tree =
false): ?
ilObject
158 $new_obj = parent::cloneObject(
$target_id, $copy_id, $omit_tree);
159 $this->cloneMetaData($new_obj);
164 if (!$cp_options->isRootNode($this->getRefId())) {
165 $new_obj->setOfflineStatus($this->getOfflineStatus());
167 $new_obj->setOfflineStatus(
true);
171 $new_obj->populateByDirectoy($this->getDataDirectory());
173 $new_obj->setStartFile((
string) $this->getStartFile());
static _getInstance(int $a_copy_id)
static getWebspaceDir(string $mode="filesystem")
get webspace directory
static makeDir(string $a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static renameExecutables(string $a_dir)
static rCopy(string $a_sdir, string $a_tdir, bool $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
static isInfoEnabled(int $obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setStartFile(string $a_file, bool $a_omit_file_check=false)
__construct(int $a_id=0, bool $a_call_by_reference=true)
getDataDirectory(string $mode="filesystem")
create(bool $a_skip_meta=false)
update(bool $a_skip_meta=false)
populateByDirectoy(string $a_dir, string $a_filename="")
Populate by directory.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setOfflineStatus(bool $status)
if(!file_exists(getcwd() . '/ilias.ini.php'))
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc