diff --git a/components/ILIAS/LearningSequence/classes/GlobalScreen/class.ilLSViewLayoutProvider.php b/components/ILIAS/LearningSequence/classes/GlobalScreen/class.ilLSViewLayoutProvider.php index c4fcfb334864..0afcc87dd844 100755 --- a/components/ILIAS/LearningSequence/classes/GlobalScreen/class.ilLSViewLayoutProvider.php +++ b/components/ILIAS/LearningSequence/classes/GlobalScreen/class.ilLSViewLayoutProvider.php @@ -139,7 +139,9 @@ public function getPageBuilderDecorator(CalledContexts $screen_context_stack): ? } $exit = $this->data_collection->get(\ilLSPlayer::GS_DATA_LS_METABARCONTROLS)['exit']; - $label = $this->dic['lng']->txt('lso_player_viewmodelabel'); + + $label = $this->data_collection->get(\ilLSPlayer::GS_DATA_LS_TITLE) + ?? $this->dic['lng']->txt('lso_player_viewmodelabel'); $lnk = new URI($exit->getAction()); diff --git a/components/ILIAS/LearningSequence/classes/Player/LSControlBuilder.php b/components/ILIAS/LearningSequence/classes/Player/LSControlBuilder.php index 90e161e26adf..e71f37ee3d05 100755 --- a/components/ILIAS/LearningSequence/classes/Player/LSControlBuilder.php +++ b/components/ILIAS/LearningSequence/classes/Player/LSControlBuilder.php @@ -156,6 +156,9 @@ public function next(string $command, ?int $parameter = null): ControlBuilder throw new \LogicException("Only one next-control per view...", 1); } $label = $this->lng->txt('lso_player_next'); + if ($command === ilLSPlayer::LSO_CMD_FINISH) { + $label = $this->lng->txt('lso_player_finish'); + } $cmd = $this->url_builder->getHref($command, $parameter); $btn = $this->ui_factory->button()->standard($label, $cmd); if ($command === '') { diff --git a/components/ILIAS/LearningSequence/classes/Player/class.ilKioskPageRenderer.php b/components/ILIAS/LearningSequence/classes/Player/class.ilKioskPageRenderer.php index ab314a621b32..3b6ad9fbdc39 100755 --- a/components/ILIAS/LearningSequence/classes/Player/class.ilKioskPageRenderer.php +++ b/components/ILIAS/LearningSequence/classes/Player/class.ilKioskPageRenderer.php @@ -84,6 +84,7 @@ public function buildToCSlate(LSTOCBuilder $toc, Icon $icon): Slate public function render( LSControlBuilder $control_builder, string $obj_title, + string $obj_description, Component $icon, array $content ): string { @@ -92,6 +93,14 @@ public function render( $this->ui_renderer->render($icon) ); $this->tpl->setVariable("OBJECT_TITLE", $obj_title); + if (trim($obj_description) !== '') { + $this->tpl->setCurrentBlock('obj_desc'); + $this->tpl->setVariable( + 'OBJECT_DESCRIPTION', + nl2br($this->tpl->prepareForOutput($obj_description)) + ); + $this->tpl->parseCurrentBlock(); + } $this->tpl->setVariable( "PLAYER_NAVIGATION", diff --git a/components/ILIAS/LearningSequence/classes/Player/class.ilLSCurriculumBuilder.php b/components/ILIAS/LearningSequence/classes/Player/class.ilLSCurriculumBuilder.php index bd79f54a07e2..2ad1222489b9 100755 --- a/components/ILIAS/LearningSequence/classes/Player/class.ilLSCurriculumBuilder.php +++ b/components/ILIAS/LearningSequence/classes/Player/class.ilLSCurriculumBuilder.php @@ -45,8 +45,10 @@ public function __construct( $this->url_builder = $url_builder; } - public function getLearnerCurriculum(bool $with_action = false): ILIAS\UI\Component\Listing\Workflow\Linear - { + public function getLearnerCurriculum( + bool $with_action = false, + ?string $title = null + ): ILIAS\UI\Component\Listing\Workflow\Linear { $steps = []; $items = $this->ls_items->getItems(); foreach ($items as $item) { @@ -69,7 +71,7 @@ public function getLearnerCurriculum(bool $with_action = false): ILIAS\UI\Compon } $workflow = $this->ui_factory->listing()->workflow()->linear( - $this->lng->txt('curriculum'), + $title ?? $this->lng->txt('curriculum'), $steps ); diff --git a/components/ILIAS/LearningSequence/classes/Player/class.ilLSLearnerItemsQueries.php b/components/ILIAS/LearningSequence/classes/Player/class.ilLSLearnerItemsQueries.php index fd2a27a10c6f..b11e51cdf3fa 100755 --- a/components/ILIAS/LearningSequence/classes/Player/class.ilLSLearnerItemsQueries.php +++ b/components/ILIAS/LearningSequence/classes/Player/class.ilLSLearnerItemsQueries.php @@ -43,7 +43,7 @@ public function __construct( $this->usr_id = $usr_id; } - public function hasItems() : bool + public function hasItems(): bool { return count($this->getItems()) > 0; } @@ -56,6 +56,11 @@ public function getItems(): array return $this->progress_db->getLearnerItems($this->usr_id, $this->ls_ref_id); } + public function getLearningSequenceRefId(): int + { + return $this->ls_ref_id; + } + public function getCurrentItemRefId(): int { $current = $this->states_db->getCurrentItemsFor($this->ls_ref_id, [$this->usr_id]); //0 or greater diff --git a/components/ILIAS/LearningSequence/classes/Player/class.ilLSPlayer.php b/components/ILIAS/LearningSequence/classes/Player/class.ilLSPlayer.php index c2c5db27ab82..560e1b2c7bcb 100755 --- a/components/ILIAS/LearningSequence/classes/Player/class.ilLSPlayer.php +++ b/components/ILIAS/LearningSequence/classes/Player/class.ilLSPlayer.php @@ -41,6 +41,7 @@ class ilLSPlayer public const GS_DATA_LS_KIOSK_MODE = 'ls_kiosk_mode'; public const GS_DATA_LS_CONTENT = 'ls_content'; + public const GS_DATA_LS_TITLE = 'ls_title'; public const GS_DATA_LS_MAINBARCONTROLS = 'ls_mainbar_controls'; public const GS_DATA_LS_METABARCONTROLS = 'ls_metabar_controls'; @@ -115,6 +116,8 @@ public function play(RequestWrapper $get): ?string //content $obj_title = $next_item->getTitle(); + $obj_description = $next_item->getDescription(); + $ls_title = ilObject::_lookupTitle(ilObject::_lookupObjId($this->ls_items->getLearningSequenceRefId())); $icon = $this->ui_factory->symbol()->icon()->standard( $next_item->getType(), $next_item->getType(), @@ -144,6 +147,7 @@ public function play(RequestWrapper $get): ?string $rendered_body = $this->page_renderer->render( $control_builder, $obj_title, + $obj_description, $icon, $content ); @@ -154,7 +158,7 @@ public function play(RequestWrapper $get): ?string $curriculum_slate = $this->page_renderer->buildCurriculumSlate( $this->curriculum_builder - ->getLearnerCurriculum(true) + ->getLearnerCurriculum(true, $ls_title) ->withActive($item_position) ); $mainbar_controls = [ @@ -169,6 +173,7 @@ public function play(RequestWrapper $get): ?string $cc = $this->current_context; $cc->addAdditionalData(self::GS_DATA_LS_KIOSK_MODE, true); + $cc->addAdditionalData(self::GS_DATA_LS_TITLE, $ls_title); $cc->addAdditionalData(self::GS_DATA_LS_METABARCONTROLS, $metabar_controls); $cc->addAdditionalData(self::GS_DATA_LS_MAINBARCONTROLS, $mainbar_controls); $cc->addAdditionalData(self::GS_DATA_LS_CONTENT, $rendered_body); @@ -299,7 +304,10 @@ protected function buildDefaultControls( if (!$control_builder->getNextControl()) { $direction_next = 1; $cmd = ''; - if (!$is_last) { + if ($is_last) { + $cmd = self::LSO_CMD_FINISH; + $direction_next = null; + } else { $available = $this->getNextItem($items, $item, $direction_next) ->getAvailability() === Step::AVAILABLE; diff --git a/components/ILIAS/LearningSequence/templates/default/tpl.kioskpage.html b/components/ILIAS/LearningSequence/templates/default/tpl.kioskpage.html index b6acc4314309..2c4f953fdde2 100755 --- a/components/ILIAS/LearningSequence/templates/default/tpl.kioskpage.html +++ b/components/ILIAS/LearningSequence/templates/default/tpl.kioskpage.html @@ -8,6 +8,9 @@