19declare(strict_types=1);
39 protected ?ArrayAccess
$di =
null;
42 protected ArrayAccess
$dic;
54 $this->
lng = $DIC[
'lng'];
55 $this->
ctrl = $DIC[
'ilCtrl'];
56 $this->
user = $DIC[
'ilUser'];
57 $this->tree =
$DIC[
'tree'];
58 $this->log =
$DIC[
"ilLoggerFactory"]->getRootLogger();
59 $this->app_event_handler =
$DIC[
'ilAppEventHandler'];
60 $this->il_news =
$DIC->news();
65 $this->
lng->loadLanguageModule(
'rbac');
73 public function read(): void
84 $id = parent::create();
90 return $this->
getId();
95 if (!parent::update()) {
103 public function delete():
bool
105 if (!parent::delete()) {
121 $this->app_event_handler->raise(
122 'Modules/LearningSequence',
125 'obj_id' => $this->
getId(),
126 'appointments' =>
null
131 public function cloneObject(
int $target_id,
int $copy_id = 0,
bool $omit_tree =
false): ?
ilObject
134 $new_obj = parent::cloneObject(
$target_id, $copy_id, $omit_tree);
143 $roles = $new_obj->getLSRoles();
145 $this->
user->getId(),
146 $roles->getDefaultAdminRole()
153 foreach ($cp_types as
$type) {
161 $original_page = new \ilContainerPage($old_intro_page_id);
162 $original_page->copy($new_copg_id,
"cont", $new_copg_id);
172 if (!$admin || !$new_admin || !$this->
getRefId() || !$new_obj->
getRefId()) {
173 $this->log->write(__METHOD__ .
' : Error cloning auto generated role: il_lso_admin');
176 $this->rbac_admin->copyRolePermissions($admin, $this->
getRefId(), $new_obj->
getRefId(), $new_admin,
true);
177 $this->log->write(__METHOD__ .
' : Finished copying of role lso_admin.');
182 if (!$member || !$new_member) {
183 $this->log->write(__METHOD__ .
' : Error cloning auto generated role: il_lso_member');
186 $this->rbac_admin->copyRolePermissions($member, $this->
getRefId(), $new_obj->
getRefId(), $new_member,
true);
187 $this->log->write(__METHOD__ .
' : Finished copying of role lso_member.');
197 foreach (
$source->getUploads() as
$key => $upload_info) {
198 $target = $target->withUpload($upload_info,
$key);
201 foreach (
$source->getDeletions() as $deletion) {
202 $target = $target->withDeletion($deletion);
206 ->withAbstract(
$source->getAbstract())
207 ->withExtro(
$source->getExtro())
208 ->withAbstractImage(
$source->getAbstractImage())
209 ->withExtroImage(
$source->getExtroImage())
218 $lp_settings->cloneSettings($obj_id);
225 if ($cwo->isRootNode($this->getRefId())) {
244 public function getDI(): ArrayAccess
246 if (is_null($this->di)) {
256 if (is_null($this->local_di)) {
261 new \
ILIAS\Data\Factory(),
264 $this->local_di =
$di;
271 if (!$this->settings_db) {
272 $this->settings_db = $this->
getDI()[
'db.settings'];
279 if (!$this->activation_db) {
280 $this->activation_db = $this->
getDI()[
'db.activation'];
287 if (!$this->ls_activation) {
302 if (!$this->ls_settings) {
317 if (!$this->items_db) {
318 $this->items_db = $this->
getLocalDI()[
'db.lsitems'];
325 if (!$this->conditions_db) {
326 $this->conditions_db = $this->
getDI()[
"db.postconditions"];
333 if (!$this->ls_participants) {
334 $this->ls_participants = $this->
getLocalDI()[
'participants'];
346 if (is_null($this->ls_access)) {
369 $db->storeItems($ls_items);
379 $rep_utils->deleteObjects($this->
getRefId(), $ref_ids);
381 $db->delete($ref_ids);
389 $condition_types = $this->il_condition_handler->getOperatorsByTriggerType(
$type);
393 foreach ($condition_types as $cond_type) {
394 $conditions[$cond_type] = $this->
lng->txt(
'condition_' . $cond_type);
401 if (!$this->learner_progress_db) {
402 $this->learner_progress_db = $this->
getLocalDI()[
'db.progress'];
409 if (!$this->state_db) {
410 $this->state_db = $this->
getDI()[
'db.states'];
421 return $db->getLearnerItems($usr_id, $this->
getRefId());
426 if (!$this->ls_roles) {
427 $this->ls_roles = $this->
getLocalDI()[
'roles'];
443 public static function _goto(
int $target,
string $add =
""): void
446 $main_tpl =
$DIC->ui()->mainTemplate();
448 $ilAccess =
$DIC[
'ilAccess'];
455 if (substr($add, 0, 5) ==
'rcode') {
460 "login.php?target=" . $request_target .
"&cmd=force_login&lang=" .
473 if ($add ==
"mem" && $ilAccess->checkAccess(
"manage_members",
"", $target)) {
477 if ($ilAccess->checkAccess(
"read",
"", $target)) {
481 if ($ilAccess->checkAccess(
"visible",
"", $target)) {
485 $main_tpl->setOnScreenMessage(
'failure', sprintf(
486 $lng->
txt(
"msg_no_perm_read_item"),
507 $item->setContentIsLangVar(
true);
508 $item->setContentTextIsLangVar(
true);
509 $item->setTitle(
"lso_news_online_title");
510 $item->setContent(
"lso_news_online_txt");
511 $ns->data()->save($item);
521 $act_db->setEffectiveOnlineStatus($this->
getRefId(), $status);
527 $curriculum =
$dic[
"player.curriculumbuilder"]->getLearnerCurriculum(
false);
528 return $dic[
'ui.renderer']->render($curriculum);
534 $buttons =
$dic[
"player.launchlinksbuilder"]->getLaunchbuttonsComponent();
535 return $dic[
'ui.renderer']->render($buttons);
547 return $this->
getLSRoles()->getLocalLearningSequenceRoles($translate);
552 return $this->
getLSRoles()->getDefaultMemberRole();
557 return $this->
getLSRoles()->getDefaultAdminRole();
565 return $this->
getLSRoles()->getDefaultLearningSequenceRoles($a_grp_id);
580 return $this->getLsRoles()->readMemberData($user_ids, $columns);
585 foreach ($this->tree->getPathFull(
$ref_id) as $hop) {
586 if (in_array($hop[
'type'], $search_types)) {
609 if (!in_array($factor, [self::CP_INTRO, self::CP_EXTRO])) {
610 throw new \InvalidArgumentException(
"not a valid modifier for page id: '$factor'");
612 return $this->
getId() * $factor;
624 throw new \LogicException(
'will not create content page - it already exists.');
627 $new_page_object = new \ilContainerPage();
628 $new_page_object->setId($page_id);
629 $new_page_object->setParentId($this->
getId());
630 $new_page_object->createFromXML();
644 $gui->setPresentationTitle(
"");
645 $gui->setTemplateOutput(
false);
647 $ret = $gui->showPage();
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getInstance(int $a_copy_id)
Class ilCtrl provides processing control methods.
const LP_STATUS_COMPLETED_NUM
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static handleCode(int $a_ref_id, string $a_type, string $a_code)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
cloneLPSettings(int $obj_id)
create()
note: title, description and type should be set when this function is called
getMailToMembersType()
Get mail to members type.
updateSettings(ilLearningSequenceSettings $settings)
ilLearningSequenceParticipants $ls_participants
ilLearningSequenceRoles $ls_roles
__construct(int $id=0, bool $call_by_reference=true)
getCurrentUserCurriculum()
ilLSPostConditionDB $conditions_db
deletePostConditionsForSubObjects(array $ref_ids)
Delete post conditions for ref ids.
readMemberData(array $user_ids, array $columns=null)
setEffectiveOnlineStatus(bool $status)
getContentPageHTML(int $factor)
hasContentPage(int $factor)
ilLearningSequenceActivation $ls_activation
ilLearningSequenceSettings $ls_settings
ilConditionHandler $il_condition_handler
ilLearningSequenceSettingsDB $settings_db
getContentPageId(int $factor)
raiseEvent(string $event_type)
getCurrentUserLaunchButtons()
cloneSettings(ilObjLearningSequence $new_obj)
cloneAutoGeneratedRoles(ilObjLearningSequence $new_obj)
ilLearnerProgressDB $learner_progress_db
getDefaultLearningSequenceRoles(string $a_grp_id="")
updateActivation(ilLearningSequenceActivation $settings)
static _goto(int $target, string $add="")
Goto target learning sequence.
createContentPage(int $factor)
cloneActivation(ilObjLearningSequence $new_obj, int $a_copy_id)
getLSLearnerItems(int $usr_id)
getParentObjectInfo(int $ref_id, array $search_types)
ilObjLearningSequenceAccess $ls_access
ilLearningSequenceActivationDB $activation_db
cloneIntroAndExtroContentPages(ilObjLearningSequence $new_obj, array $cp_types)
static getInstanceByRefId(int $ref_id)
initDefaultRoles()
init default roles settings Purpose of this function is to create a local role folder and local roles...
getPossiblePostConditionsForType(string $type)
storeLSItems(array $ls_items)
Update LSItems.
getLocalLearningSequenceRoles(bool $translate=false)
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
static _gotoRepositoryNode(int $ref_id, string $cmd="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupType(int $id, bool $reference=false)
cloneMetaData(ilObject $target_obj)
Copy meta data.
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
static _deleteAllEntries(int $a_obj_id)
Delete all entries Normally called in case of object deletion.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static redirect(string $a_script)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Refinery Factory $refinery
Class ChatMainBarProvider \MainMenu\Provider.