19declare(strict_types=1);
37 protected int $usr_id,
43 protected ILIAS\UI\Factory $ui_factory,
50 protected string $intro,
51 protected string $extro,
58 $cmd = $this->
ctrl->getCmd();
66 $this->
ctrl->redirect($this, self::CMD_VIEW);
72 if ($this->launchlinks_builder->currentUserMayUnparticipate()) {
73 $this->roles->leave($this->usr_id);
75 $this->
ctrl->redirect($this, self::CMD_STANDARD);
83 "ilObjLearningSequenceLearnerGUI: " .
84 "Command not supported: $cmd"
91 return $this->ui_factory->modal()->interruptive(
92 $this->
lng->txt(
'obj_lso'),
93 $this->lng->txt(
"unparticipate"),
94 $this->ctrl->getLinkTarget($this, self::CMD_UNSUBSCRIBE),
98 protected function view(
string $cmd): void
106 $this->tpl->setContent($content . $this->
renderer->render($modal));
109 if (!str_contains($content, $element)) {
114 if (!str_contains($content, $element)) {
115 $curriculum = $this->curriculum_builder->getLearnerCurriculum();
116 $this->tpl->setRightContent(
124 $admins = $this->roles->getLearningSequenceAdminIds();
125 if (!in_array($usr_id, $admins)) {
126 $this->roles->join($usr_id);
132 foreach ($this->launchlinks_builder->getLinks() as $entry) {
133 list($label, $link, $primary) = $entry;
136 $btn = $this->ui_factory->button()->primary($label, $link);
138 $btn = $this->ui_factory->button()->standard($label, $link);
141 if ($label === $this->
lng->txt(
"unparticipate")) {
142 $btn = $this->ui_factory->button()->standard($label, $link)->withOnClick($modal->
getShowSignal());
145 $this->
toolbar->addComponent($btn);
153 $this->ui_factory->legacy()->content(
'<div class="ilLSOLearnerView">')
155 $components[] = $this->ui_factory->legacy()->content(
'</div>');
157 return $this->
renderer->render($components);
165 if ($cmd === self::CMD_STANDARD) {
166 if ($this->intro ===
'') {
167 $contents[] = $this->ui_factory->legacy()->content($this->
settings->getAbstract());
168 $img = $this->
settings->getAbstractImage();
170 $contents[] = $this->ui_factory->image()->responsive($img,
'');
173 $contents[] = $this->ui_factory->legacy()->content($this->intro);
177 if ($cmd === self::CMD_EXTRO) {
178 if ($this->extro ===
'') {
179 $contents[] = $this->ui_factory->legacy()->content($this->
settings->getExtro());
180 $img = $this->
settings->getExtroImage();
182 $contents[] = $this->ui_factory->image()->responsive($img,
'');
185 $contents[] = $this->ui_factory->legacy()->content($this->extro);
191 protected function play(): void
193 $response = $this->player->play($this->
get);
198 $this->tpl->setContent($this->
lng->txt(
'lso_player_noitems'));
201 case 'EXIT::' . $this->player::LSO_CMD_FINISH:
205 case 'EXIT::' . $this->player::LSO_CMD_SUSPEND:
210 $href = $this->
ctrl->getLinkTarget($this, $cmd,
'',
false,
false);
Class ilAccessHandler Checks access for ILIAS objects.
Class ilCtrl provides processing control methods.
Base class for ILIAS Exception handling.
Builds the overview (curriculum) of a LearningSequence.
Builds the links to join/(re-)start the LearningSequence.
Implementation of KioskMode Player.
Settings for an LSO (like abstract, extro)
const PARAM_LSO_NEXT_ITEM
initToolbar(string $cmd, Interruptive $modal)
const CMD_UNSUBSCRIBE_CONFIRMATION
getMainContent(string $cmd)
unsubscribeConfirmationModal()
__construct(protected int $usr_id, protected ilAccess $access, protected ilCtrl $ctrl, protected ilLanguage $lng, protected ilGlobalTemplateInterface $tpl, protected ilToolbarGUI $toolbar, protected ILIAS\UI\Factory $ui_factory, protected ILIAS\UI\Renderer $renderer, protected ilLearningSequenceRoles $roles, protected ilLearningSequenceSettings $settings, protected ilLSCurriculumBuilder $curriculum_builder, protected ilLSLaunchlinksBuilder $launchlinks_builder, protected ilLSPlayer $player, protected string $intro, protected string $extro, protected RequestWrapper $get)
getWrappedHTML(array $components)
static redirect(string $a_script)
Interface RequestWrapper.
getShowSignal()
Get the signal to show this modal in the frontend.
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.