3 declare(strict_types=1);
23 $this->
user = $DIC[
"ilUser"];
24 $this->rbac_admin = $DIC[
"rbacadmin"];
25 $this->log = $DIC[
"ilLoggerFactory"]->getRootLogger();
30 if ($new_id = $mapping->getMapping(
"Services/Container",
"objs",
$id)) {
40 $mapping->addMapping(
"Modules/LearningSequence",
"lso",
$id, $this->obj->getId());
56 $this->obj->addMember((
int) $this->
user->getId(), $this->obj->getDefaultAdminRole());
61 $old_ref_id = $this->
data[
"object"][
"ref_id"];
62 $new_ref_id = $mapping->
getMapping(
"Services/Container",
"refs", $old_ref_id);
64 $this->obj->setRefId($new_ref_id);
70 foreach ($ls_data as
$data) {
71 $old_ref_id = $data[
"id"];
72 $new_ref_id = $mapping->
getMapping(
"Services/Container",
"refs", $old_ref_id);
76 $data[
"ls_item_pc_condition_type"],
77 $data[
"ls_item_pc_value"]
81 $data[
"ls_item_type"] ??
"",
82 $data[
"ls_item_title"] ??
"",
83 $data[
"ls_item_description"] ??
"",
84 $data[
"ls_item_icon_path"] ??
"",
85 (
bool) $data[
"ls_item_is_online"],
86 (
int) $data[
"ls_item_order_number"],
92 $this->obj->storeLSItems($ls_items);
97 $settings = $this->obj->getLSSettings();
99 ->withAbstract($ls_settings[
"abstract"])
100 ->withExtro($ls_settings[
"extro"])
101 ->withMembersGallery((
bool) $ls_settings[
"members_gallery"])
104 if ($ls_settings[
"abstract_img"] !=
"") {
106 $abstract_img_data = $this->
decodeImageData($ls_settings[
"abstract_img_data"]);
108 $settings = $settings
109 ->withAbstractImage(
$path)
113 if ($ls_settings[
"extro_img"] !=
"") {
115 $extro_img_data = $this->
decodeImageData($ls_settings[
"extro_img_data"]);
117 $settings = $settings
118 ->withExtroImage(
$path)
122 $this->obj->updateSettings($settings);
129 $new_ref_ids = array_map(
function ($old_ref_id) use ($mapping) {
130 return $mapping->
getMapping(
"Services/Container",
"refs", $old_ref_id);
131 }, $lp_settings[
"lp_item_ref_ids"]);
133 if (!is_null($collection)) {
134 $collection->activateEntries($new_ref_ids);
138 $settings->
setMode((
int) $lp_settings[
"lp_mode"]);
144 return base64_decode($data);
149 $fs = $this->obj->getLSFileSystem();
150 return $fs->getStoragePathFor(
152 (
int) $this->obj->getId(),
153 $fs->getSuffix($path)
159 file_put_contents($path,
$data);
getMapping($a_comp, $a_entity, $a_old_id)
Get a mapping.
finalProcessing($mapping)
getNewImagePath(string $type, string $path)
buildSettings(array $ls_settings)
Class ilObjLearningSequence.
if(!array_key_exists('StateId', $_REQUEST)) $id
static getInstanceByMode($a_obj_id, $a_mode)
buildLSItems(array $ls_data, ilImportMapping $mapping)
writeToFileSystem($data, string $path)
Data holding class LSItem .
updateRefId(ilImportMapping $mapping)
importXmlRepresentation($entity, $id, $xml, $mapping)
afterContainerImportProcessing(ilImportMapping $mapping)
decodeImageData(string $data)
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
A PostCondition does restrict the progression of a user through the learning sequence.
buildLPSettings(array $lp_settings, ilImportMapping $mapping)