3declare(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        $roles = $this->obj->getLSRoles();
 
   58            (
int) $this->
user->getId(),
 
   59            $roles->getDefaultAdminRole()
 
   65        $old_ref_id = $this->data[
"object"][
"ref_id"];
 
   66        $new_ref_id = $mapping->
getMapping(
"Services/Container", 
"refs", $old_ref_id);
 
   68        $this->obj->setRefId($new_ref_id);
 
   74        foreach ($ls_data as 
$data) {
 
   75            $old_ref_id = 
$data[
"id"];
 
   76            $new_ref_id = $mapping->
getMapping(
"Services/Container", 
"refs", $old_ref_id);
 
   80                $data[
"ls_item_pc_condition_type"],
 
   81                $data[
"ls_item_pc_value"]
 
   85                $data[
"ls_item_type"] ?? 
"",
 
   86                $data[
"ls_item_title"] ?? 
"",
 
   87                $data[
"ls_item_description"] ?? 
"",
 
   88                $data[
"ls_item_icon_path"] ?? 
"",
 
   89                (
bool) 
$data[
"ls_item_is_online"],
 
   90                (
int) 
$data[
"ls_item_order_number"],
 
   96        $this->obj->storeLSItems($ls_items);
 
  101        $settings = $this->obj->getLSSettings();
 
  102        $settings = $settings
 
  103            ->withAbstract($ls_settings[
"abstract"])
 
  104            ->withExtro($ls_settings[
"extro"])
 
  105            ->withMembersGallery((
bool) $ls_settings[
"members_gallery"])
 
  108        if ($ls_settings[
"abstract_img"] != 
"") {
 
  110            $abstract_img_data = $this->
decodeImageData($ls_settings[
"abstract_img_data"]);
 
  112            $settings = $settings
 
  113                ->withAbstractImage($path)
 
  117        if ($ls_settings[
"extro_img"] != 
"") {
 
  119            $extro_img_data = $this->
decodeImageData($ls_settings[
"extro_img_data"]);
 
  121            $settings = $settings
 
  122                ->withExtroImage($path)
 
  126        $this->obj->updateSettings($settings);
 
  133        $new_ref_ids = array_map(
function ($old_ref_id) use ($mapping) {
 
  134            return $mapping->
getMapping(
"Services/Container", 
"refs", $old_ref_id);
 
  135        }, $lp_settings[
"lp_item_ref_ids"]);
 
  137        if (!is_null($collection)) {
 
  138            $collection->activateEntries($new_ref_ids);
 
  142        $settings->setMode((
int) $lp_settings[
"lp_mode"]);
 
  148        return base64_decode(
$data);
 
  153        $fs = $this->obj->getDI()[
'db.filesystem'];
 
  154        return $fs->getStoragePathFor(
 
  156            (
int) $this->obj->getId(),
 
  157            $fs->getSuffix($path)
 
  163        file_put_contents($path, 
$data);
 
An exception for terminatinating execution or to throw for unit testing.
Data holding class LSItem .
getMapping($a_comp, $a_entity, $a_old_id)
Get a mapping.
static getInstanceByMode($a_obj_id, $a_mode)
A PostCondition does restrict the progression of a user through the learning sequence.
updateRefId(ilImportMapping $mapping)
buildLSItems(array $ls_data, ilImportMapping $mapping)
decodeImageData(string $data)
finalProcessing($mapping)
Final processing.
buildLPSettings(array $lp_settings, ilImportMapping $mapping)
buildSettings(array $ls_settings)
importXmlRepresentation($entity, $id, $xml, $mapping)
Import xml representation.
writeToFileSystem($data, string $path)
getNewImagePath(string $type, string $path)
afterContainerImportProcessing(ilImportMapping $mapping)
Called after all container objects have been implemented.
Class ilObjLearningSequence.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id