19 declare(strict_types=1);
41 protected ILIAS\
UI\Factory $ui_factory,
42 protected int $lso_ref_id,
43 protected int $usr_id,
44 protected $first_access,
52 return $this->
access->checkAccess(self::PERM_PARTICIPATE,
'', $this->lso_ref_id);
62 return $this->
access->checkAccess(self::PERM_UNPARTICIPATE,
'', $this->lso_ref_id);
67 return $this->roles->isMember($this->usr_id);
72 return $this->roles->isCompletedByUser($this->usr_id);
75 protected function getLink(
string $cmd): string
77 return $this->
ctrl->getLinkTargetByClass(
'ilObjLearningSequenceLearnerGUI', $cmd);
82 $cmd = $this->
ctrl->getCmd();
86 if (!$this->ls_items->hasItems()) {
90 $this->
lng->txt(
"lso_player_start"),
91 $this->
getLink(self::CMD_START),
96 if (!$this->
hasCompleted() && $this->ls_items->hasItems()) {
97 $label =
"lso_player_resume";
98 if ($this->first_access === -1) {
99 $label =
"lso_player_start";
102 $this->
lng->txt($label),
103 $this->
getLink(self::CMD_VIEW),
107 if ($this->ls_items->hasItems()) {
109 $this->
lng->txt(
"lso_player_review"),
110 $this->
getLink(self::CMD_VIEW),
115 if ($cmd === self::CMD_STANDARD) {
117 $this->
lng->txt(
"lso_player_extro"),
118 $this->
getLink(self::CMD_EXTRO),
122 if ($cmd === self::CMD_EXTRO) {
124 $this->
lng->txt(
"lso_player_abstract"),
125 $this->
getLink(self::CMD_STANDARD),
133 $this->
lng->txt(
"unparticipate"),
134 $this->
getLink(self::CMD_UNSUBSCRIBE),
145 foreach ($this->
getLinks() as $idx => $entry) {
146 list($label, $link, $primary) = $entry;
148 $buttons[] = $this->ui_factory->button()->primary($label, $link);
150 $buttons[] = $this->ui_factory->button()->standard($label, $link);
__construct(protected ilLanguage $lng, protected ilAccess $access, protected ilCtrl $ctrl, protected ILIAS\UI\Factory $ui_factory, protected int $lso_ref_id, protected int $usr_id, protected $first_access, protected ilLearningSequenceRoles $roles, protected ilLSLearnerItemsQueries $ls_items)
Interface Observer Contains several chained tasks and infos about them.
Builds the links to join/(re-)start the LearningSequence.
currentUserMayUnparticipate()
This combines calls to ProgressDB and StateDB to handle learner-items in the context of a specific LS...
getLaunchbuttonsComponent()