Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 === '') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -144,6 +147,7 @@ public function play(RequestWrapper $get): ?string
$rendered_body = $this->page_renderer->render(
$control_builder,
$obj_title,
$obj_description,
$icon,
$content
);
Expand All @@ -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 = [
Expand All @@ -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);
Expand Down Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<h1 class="il-page-content-header media-heading ilHeader">
{OBJECT_TITLE}
</h1>
<!-- BEGIN obj_desc -->
<div class="il_Description">{OBJECT_DESCRIPTION}</div>
<!-- END obj_desc -->
</div>
</div>

Expand Down
Loading