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 'components/ILIAS/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()
156 foreach ($cp_types as
$type) {
162 if ($type === LSOPageType::INTRO) {
167 $source_page->copy($target_page_id,
$type->value, $target_page_id);
177 if (!$admin || !$new_admin || !$this->
getRefId() || !$new_obj->
getRefId()) {
178 $this->log->write(__METHOD__ .
' : Error cloning auto generated role: il_lso_admin');
181 $this->rbac_admin->copyRolePermissions($admin, $this->
getRefId(), $new_obj->
getRefId(), $new_admin,
true);
182 $this->log->write(__METHOD__ .
' : Finished copying of role lso_admin.');
187 if (!$member || !$new_member) {
188 $this->log->write(__METHOD__ .
' : Error cloning auto generated role: il_lso_member');
191 $this->rbac_admin->copyRolePermissions($member, $this->
getRefId(), $new_obj->
getRefId(), $new_member,
true);
192 $this->log->write(__METHOD__ .
' : Finished copying of role lso_member.');
202 foreach ($source->getUploads() as $key => $upload_info) {
203 $target = $target->withUpload($upload_info, $key);
206 foreach ($source->getDeletions() as $deletion) {
207 $target = $target->withDeletion($deletion);
211 ->withAbstract($source->getAbstract())
212 ->withExtro($source->getExtro())
213 ->withAbstractImage($source->getAbstractImage())
214 ->withExtroImage($source->getExtroImage())
223 $lp_settings->cloneSettings($obj_id);
230 if ($cwo->isRootNode($this->getRefId())) {
239 $new_status = ($new_obj->
getLSActivation()->getEffectiveOnlineStatus())
254 public function getDI(): ArrayAccess
256 if (is_null($this->di)) {
266 if (is_null($this->local_di)) {
271 new \
ILIAS\Data\Factory(),
274 $this->local_di =
$di;
281 if (!$this->settings_db) {
282 $this->settings_db = $this->
getDI()[
'db.settings'];
289 if (!$this->activation_db) {
290 $this->activation_db = $this->
getDI()[
'db.activation'];
297 if (!$this->ls_activation) {
307 $this->ls_activation = $settings;
312 if (!$this->ls_settings) {
322 $this->ls_settings = $settings;
327 if (!$this->items_db) {
328 $this->items_db = $this->
getLocalDI()[
'db.lsitems'];
335 if (!$this->conditions_db) {
336 $this->conditions_db = $this->
getDI()[
"db.postconditions"];
343 if (!$this->ls_participants) {
344 $this->ls_participants = $this->
getLocalDI()[
'participants'];
356 if (is_null($this->ls_access)) {
379 $db->storeItems($ls_items);
389 $rep_utils->deleteObjects($this->
getRefId(), $ref_ids);
391 $db->delete($ref_ids);
399 $condition_types = $this->il_condition_handler->getOperatorsByTriggerType(
$type);
403 foreach ($condition_types as $cond_type) {
404 $conditions[$cond_type] = $this->
lng->txt(
'condition_' . $cond_type);
411 if (!$this->learner_progress_db) {
412 $this->learner_progress_db = $this->
getLocalDI()[
'db.progress'];
419 if (!$this->state_db) {
420 $this->state_db = $this->
getDI()[
'db.states'];
431 return $db->getLearnerItems($usr_id, $this->
getRefId());
436 if (!$this->ls_roles) {
437 $this->ls_roles = $this->
getLocalDI()[
'roles'];
453 public static function _goto(
string $target,
string $add =
""): void
456 $main_tpl =
$DIC->ui()->mainTemplate();
458 $ilAccess =
$DIC[
'ilAccess'];
461 $ilUser =
$DIC[
'ilUser'];
465 if (substr($add, 0, 5) ==
'rcode') {
470 "login.php?target=" . $request_target .
"&cmd=force_login&lang=" .
471 $ilUser->getCurrentLanguage()
483 if ($add ==
"mem" && $ilAccess->checkAccess(
"manage_members",
"", $target)) {
487 if ($ilAccess->checkAccess(
"read",
"", $target)) {
491 if ($ilAccess->checkAccess(
"visible",
"", $target)) {
495 $main_tpl->setOnScreenMessage(
'failure', sprintf(
496 $lng->
txt(
"msg_no_perm_read_item"),
517 $item->setContentIsLangVar(
true);
518 $item->setContentTextIsLangVar(
true);
519 $item->setTitle(
"lso_news_online_title");
520 $item->setContent(
"lso_news_online_txt");
521 $ns->data()->save($item);
531 $act_db->setEffectiveOnlineStatus($this->
getRefId(), $status);
537 $curriculum =
$dic[
"player.curriculumbuilder"]->getLearnerCurriculum(
false);
538 return $dic[
'ui.renderer']->render($curriculum);
544 $buttons =
$dic[
"player.launchlinksbuilder"]->getLaunchbuttonsComponent();
545 return $dic[
'ui.renderer']->render($buttons);
557 return $this->
getLSRoles()->getLocalLearningSequenceRoles($translate);
562 return $this->
getLSRoles()->getDefaultMemberRole();
567 return $this->
getLSRoles()->getDefaultAdminRole();
575 return $this->
getLSRoles()->getDefaultLearningSequenceRoles($a_grp_id);
590 return $this->getLsRoles()->readMemberData($user_ids, $columns);
595 foreach ($this->tree->getPathFull(
$ref_id) as $hop) {
596 if (in_array($hop[
'type'], $search_types)) {
615 return $this->
getId();
626 throw new \LogicException(
'will not create content page - it already exists.');
630 $new_page_object->setParentId($this->
getId());
631 $new_page_object->createFromXML();
640 $gui = $page_type === LSOPageType::INTRO ?
644 $gui->setPresentationTitle(
"");
645 $gui->setTemplateOutput(
false);
647 $ret = $gui->showPage();
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
INTERNAL CLASS: Please do not use in consumer code.
static _getInstance(int $a_copy_id)
Class ilCtrl provides processing control methods.
const LP_STATUS_COMPLETED_NUM
Storage for ilLSPostConditions.
Persistence for View-States.
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...
Get LearningProgress and availability of items in sequence.
Persistence for online/activation period.
Activation-Settings for an LSO.
Persistence for Settings (like abstract, extro)
Settings for an LSO (like abstract, extro)
static handleCode(int $a_ref_id, string $a_type, string $a_code)
Class ilObjLearningSequenceEditExtroGUI @ilCtrl_Calls ilObjLearningSequenceEditExtroGUI: ilPageEditor...
Class ilObjLearningSequenceEditIntroGUI @ilCtrl_Calls ilObjLearningSequenceEditIntroGUI: ilPageEditor...
cloneLPSettings(int $obj_id)
create()
note: title, description and type should be set when this function is called
getMailToMembersType()
Get mail to members type.
getContentPageHTML(LSOPageType $page_type)
updateSettings(ilLearningSequenceSettings $settings)
ilLearningSequenceParticipants $ls_participants
ilLearningSequenceRoles $ls_roles
__construct(int $id=0, bool $call_by_reference=true)
getCurrentUserCurriculum()
createContentPage(LSOPageType $page_type)
ilLSPostConditionDB $conditions_db
deletePostConditionsForSubObjects(array $ref_ids)
Delete post conditions for ref ids.
setEffectiveOnlineStatus(bool $status)
ilLearningSequenceActivation $ls_activation
ilLearningSequenceSettings $ls_settings
ilConditionHandler $il_condition_handler
ilLearningSequenceSettingsDB $settings_db
static _goto(string $target, string $add="")
Goto target learning sequence.
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)
cloneActivation(ilObjLearningSequence $new_obj, int $a_copy_id)
readMemberData(array $user_ids, ?array $columns=null)
getLSLearnerItems(int $usr_id)
ILIAS News Service $il_news
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)
hasContentPage(LSOPageType $page_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="")
Class ilObject Basic functions for all objects.
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
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.