19 declare(strict_types=1);
29 public function init(): void
32 $this->
user = $DIC[
"ilUser"];
33 $this->rbac_admin = $DIC[
"rbacadmin"];
34 $this->log = $DIC[
"ilLoggerFactory"]->getRootLogger();
39 if ($new_id = $a_mapping->
getMapping(
"Services/Container",
"objs", $a_id)) {
47 $this->data = $parser->start();
49 $a_mapping->
addMapping(
"Modules/LearningSequence",
"lso", $a_id, (
string) $this->obj->getId());
53 LSOPageType::INTRO->value .
':' . $a_id,
54 LSOPageType::INTRO->value .
':' . (
string) $this->obj->getId()
72 foreach ($page_map as $old_pg_id => $new_pg_id) {
73 $parts = explode(
':', $old_pg_id);
76 $parts = explode(
':', $new_pg_id);
77 $new_pg_id = array_pop(
$parts);
78 $new_obj_id = $this->obj->getId();
89 $roles = $this->obj->getLSRoles();
92 $roles->getDefaultAdminRole()
98 $old_ref_id = $this->data[
"object"][
"ref_id"];
99 $new_ref_id = $mapping->
getMapping(
"Services/Container",
"refs", $old_ref_id);
101 $this->obj->setRefId((
int) $new_ref_id);
107 foreach ($ls_data as $data) {
108 $old_ref_id = $data[
"ref_id"];
109 $new_ref_id = $mapping->
getMapping(
"Services/Container",
"refs", $old_ref_id);
110 $mapped[$new_ref_id] =
$data;
113 $ls_items = $this->obj->getLSItems($this->obj->getRefId());
115 foreach ($ls_items as $item) {
116 $item_ref_id = $item->getRefId();
117 if(array_key_exists($item_ref_id, $mapped)) {
118 $item_data = $mapped[$item_ref_id];
121 $item_data[
"condition_type"],
122 $item_data[
"condition_value"]
124 $updated[] = $item->withPostCondition($post_condition);
137 ->withMembersGallery($ls_settings[
"members_gallery"] ===
'true' ?
true :
false)
146 $new_ref_ids = array_map(
function ($old_ref_id) use ($mapping) {
147 return $mapping->
getMapping(
"Services/Container",
"refs", $old_ref_id);
148 }, $lp_settings[
"lp_item_ref_ids"]);
150 if (!is_null($collection)) {
151 $collection->activateEntries($new_ref_ids);
155 $settings->setMode((
int) $lp_settings[
"lp_mode"]);
161 return base64_decode($data);
166 $fs = $this->obj->getDI()[
'db.filesystem'];
167 return $fs->getStoragePathFor(
170 $fs->getSuffix($path)
176 file_put_contents($path, $data);
getNewImagePath(string $type, string $path)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
buildSettings(array $ls_settings)
static _writeParentId(string $a_parent_type, int $a_pg_id, int $a_par_id)
finalProcessing(ilImportMapping $a_mapping)
addMapping(string $a_comp, string $a_entity, string $a_old_id, string $a_new_id)
buildLSItems(array $ls_data, ilImportMapping $mapping)
writeToFileSystem($data, string $path)
static getInstanceByMode(int $a_obj_id, int $a_mode)
getMapping(string $a_comp, string $a_entity, string $a_old_id)
updateRefId(ilImportMapping $mapping)
getMappingsOfEntity(string $a_comp, string $a_entity)
afterContainerImportProcessing(ilImportMapping $mapping)
decodeImageData(string $data)
A PostCondition does restrict the progression of a user through the learning sequence.
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
Class ilRbacAdmin Core functions for role based access control.
buildLPSettings(array $lp_settings, ilImportMapping $mapping)
importXmlRepresentation(string $a_entity, string $a_id, string $a_xml, ilImportMapping $a_mapping)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...