8 require_once
"./Services/Object/classes/class.ilObject.php";
32 public function __construct($a_id = 0, $a_call_by_reference =
true)
36 $this->db = $DIC->database();
39 parent::__construct($a_id, $a_call_by_reference);
49 public function update($a_skip_meta =
false)
58 $ilDB->manipulate($q =
"UPDATE file_based_lm SET " .
61 " WHERE id = " .
$ilDB->quote($this->
getId(),
"integer"));
74 $q =
"SELECT * FROM file_based_lm WHERE id = " .
$ilDB->quote($this->
getId(),
"integer");
86 public function create($a_skip_meta =
false)
93 $ilDB->manipulate(
"INSERT INTO file_based_lm (id, is_online, startfile) VALUES " .
94 " (" .
$ilDB->quote($this->getID(),
"integer") .
"," .
95 $ilDB->quote(
"n",
"text") .
"," .
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;
130 $this->online = $a_online;
145 $ilDB = $DIC->database();
147 $q =
"SELECT * FROM file_based_lm WHERE id = " .
$ilDB->quote($a_id,
"integer");
162 require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
178 public function delete()
183 if (!parent::delete()) {
191 $ilDB->manipulate(
"DELETE FROM file_based_lm WHERE id = " .
192 $ilDB->quote($this->getID(),
"integer"));
211 preg_match(
"/.*htlm_([0-9]*)\.zip/", $a_filename, $match);
212 if (is_dir($a_dir .
"/htlm_" . $match[1])) {
213 $a_dir = $a_dir .
"/htlm_" . $match[1];
225 public function cloneObject($a_target_id, $a_copy_id = 0, $a_omit_tree =
false)
227 $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
233 if (!$cp_options->isRootNode($this->getRefId())) {
237 $new_obj->setTitle($this->
getTitle());
getDataDirectory($mode="filesystem")
static tf2yn($a_tf)
convert true/false to "y"/"n"
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.
static _lookupOnline($a_id)
check wether content object is online
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
getTitle()
get object title public
getDescription()
get object description
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.
__construct($a_id=0, $a_call_by_reference=true)
Constructor public.
deleteMetaData()
delete meta data entry
static yn2tf($a_yn)
convert "y"/"n" to true/false
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.