29 return array(
"4.1.0");
32 protected function getXmlNamespace(
string $a_entity,
string $a_schema_version): string
34 return "https://www.ilias.de/xml/Modules/HTMLLearningModule/" . $a_entity;
37 protected function getTypes(
string $a_entity,
string $a_version): array
39 if ($a_entity ===
"htlm") {
45 "Description" =>
"text",
46 "StartFile" =>
"text",
47 "Dir" =>
"directory");
53 public function readData(
string $a_entity,
string $a_version, array $a_ids): void
57 if ($a_entity ===
"htlm") {
61 " startfile start_file " .
62 " FROM file_based_lm JOIN object_data ON (file_based_lm.id = object_data.obj_id) " .
64 $ilDB->in(
"id", $a_ids,
false,
"integer"));
70 public function getXmlRecord(
string $a_entity,
string $a_version, array $a_set): array
73 $dir = $lm->getDataDirectory();
79 public function importRecord(
string $a_entity, array $a_types, array $a_rec,
ilImportMapping $a_mapping,
string $a_schema_version):
void 85 if ($new_id = $a_mapping->
getMapping(
'components/ILIAS/Container',
'objs', $a_rec[
'Id'])) {
90 $newObj->setType(
"htlm");
91 $newObj->create(
true);
94 $newObj->setTitle($a_rec[
"Title"]);
95 $newObj->setDescription($a_rec[
"Description"]);
96 $newObj->setStartFile($a_rec[
"StartFile"],
true);
97 $newObj->update(
true);
98 $this->current_obj = $newObj;
100 $dir = str_replace(
"..",
"", $a_rec[
"Dir"]);
103 $target_dir = $newObj->getDataDirectory();
107 $a_mapping->
addMapping(
"components/ILIAS/HTMLLearningModule",
"htlm", $a_rec[
"Id"], $newObj->getId());
109 "components/ILIAS/MetaData",
111 $a_rec[
"Id"] .
":0:htlm",
112 $newObj->getId() .
":0:htlm" getXmlNamespace(string $a_entity, string $a_schema_version)
File Based Learning Module (HTML) object.
static rCopy(string $a_sdir, string $a_tdir, bool $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
addMapping(string $a_comp, string $a_entity, string $a_old_id, string $a_new_id)
readData(string $a_entity, string $a_version, array $a_ids)
ilObjFileBasedLM $current_obj
getMapping(string $a_comp, string $a_entity, string $a_old_id)
getXmlRecord(string $a_entity, string $a_version, array $a_set)
importRecord(string $a_entity, array $a_types, array $a_rec, ilImportMapping $a_mapping, string $a_schema_version)
Needs to be overwritten for import use case.
getTypes(string $a_entity, string $a_version)
getDirectDataFromQuery(string $a_query, bool $a_convert_to_leading_upper=true, bool $a_set=true)
Get data from query.This is a standard procedure, all db field names are directly mapped to abstract ...
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
stripTags(array $rec, array $omit_keys=[])