8 require_once
"./Services/Object/classes/class.ilObject.php";
32 public function __construct($a_id = 0, $a_call_by_reference =
true)
39 $this->db = $DIC->database();
42 parent::__construct($a_id, $a_call_by_reference);
52 public function update($a_skip_meta =
false)
61 $ilDB->manipulate($q =
"UPDATE file_based_lm SET " .
62 " startfile = " .
$ilDB->quote($this->getStartFile(),
"text") .
" " .
63 " WHERE id = " .
$ilDB->quote($this->getId(),
"integer"));
76 $q =
"SELECT * FROM file_based_lm WHERE id = " .
$ilDB->quote($this->
getId(),
"integer");
87 public function create($a_skip_meta =
false)
94 $ilDB->manipulate(
"INSERT INTO file_based_lm (id, startfile) VALUES " .
95 " (" .
$ilDB->quote($this->getID(),
"integer") .
"," .
96 $ilDB->quote($this->getStartfile(),
"text") .
")");
105 $lm_dir = $lm_data_dir .
"/lm_" . $this->
getId();
117 return $this->start_file;
123 (file_exists($this->
getDataDirectory() .
"/" . $a_file) || $a_omit_file_check)) {
124 $this->start_file = $a_file;
136 require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
152 public function delete()
157 if (!parent::delete()) {
165 $ilDB->manipulate(
"DELETE FROM file_based_lm WHERE id = " .
166 $ilDB->quote($this->getID(),
"integer"));
185 preg_match(
"/.*htlm_([0-9]*)\.zip/", $a_filename, $match);
186 if (is_dir($a_dir .
"/htlm_" . $match[1])) {
187 $a_dir = $a_dir .
"/htlm_" . $match[1];
199 public function cloneObject($a_target_id, $a_copy_id = 0, $a_omit_tree =
false)
201 $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
207 if (!$cp_options->isRootNode($this->getRefId())) {
getDataDirectory($mode="filesystem")
create($a_skip_meta=false)
create file based lm
static _lookupDiskUsage($a_id)
Returns the number of bytes used on the harddisk by the learning module with the specified object id...
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
updateMetaData()
update meta data entry
File Based Learning Module (HTML) object.
getOfflineStatus()
Get offline status.
createMetaData()
create meta data entry
cloneObject($a_target_id, $a_copy_id=0, $a_omit_tree=false)
Clone HTML learning module.
setStartFile($a_file, $a_omit_file_check=false)
static _getInstance($a_copy_id)
Get instance of copy wizard options.
getId()
get object id public
cloneMetaData($target_obj)
Copy meta data.
getDiskUsage()
Gets the disk usage of the object in bytes.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
update($pash, $contents, Config $config)
update($a_skip_meta=false)
update object data
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.
setOfflineStatus($a_status)
Set offline status.
__construct($a_id=0, $a_call_by_reference=true)
Constructor public.
deleteMetaData()
delete meta data entry
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static getWebspaceDir($mode="filesystem")
get webspace directory
populateByDirectoy($a_dir, $a_filename="")
Populate by directory.