54 return \ilObjLearningModule::class;
63 $this->
ctrl = $DIC->ctrl();
65 $this->uiFactory = $DIC->ui()->factory();
66 $this->uiRenderer = $DIC->ui()->renderer();
67 $this->httpRequest = $DIC->http()->request();
68 $this->
tabs = $DIC->tabs();
69 $this->
user = $DIC->user();
75 ?
int $parameter =
null 80 $this->current_page_id = $parameter;
81 $state = $state->
withValueFor(
"current_page", (
string) $this->current_page_id);
84 case self::CMD_TOGGLE_LEARNING_PROGRESS:
97 if (is_object($this->lm_pres)) {
105 [
"ref_id" => $this->lm->getRefId(),
106 "obj_id" => (
int) $current_page],
110 $this->lm_pres_service = $this->lm_pres->getService();
115 return $this->
access->checkAccess(
'read',
'', $this->lm->getRefId());
129 $main_tpl = $DIC->ui()->mainTemplate();
135 $nav_stat = $this->lm_pres_service->getNavigationStatus();
138 $succ_id = $nav_stat->getSuccessorPageId();
140 $builder->
next(
"layout", $succ_id);
144 $prev_id = $nav_stat->getPredecessorPageId();
146 $builder->
previous(
"layout", $prev_id);
149 $toc = $builder->
tableOfContent($this->lm->getTitle(),
'layout', 0);
151 $lm_toc_renderer->renderLSToc($toc);
158 if (is_object($entry[
"signal"])) {
164 if ($entry[
"on_load"] !=
"") {
165 $main_tpl->addOnLoadCode($entry[
"on_load"]);
176 if (is_null($this->menu_entries)) {
177 $menu = new \ILIAS\LearningModule\Menu\ilLMMenuGUI($this->lm_pres_service);
178 $this->menu_entries = $menu->getEntries();
190 $this->
lng->loadLanguageModule(
'lm');
191 $learningProgressToggleCtrlLabel = $this->
lng->txt(
'lm_btn_lp_toggle_state_completed');
193 $learningProgressToggleCtrlLabel = $this->
lng->txt(
'lm_btn_lp_toggle_state_not_completed');
196 $learningProgressToggleCtrlLabel,
197 self::CMD_TOGGLE_LEARNING_PROGRESS,
207 if (self::CMD_TOGGLE_LEARNING_PROGRESS === $command) {
210 $marks = new \ilLPMarks($this->lm->getId(), $this->
user->getId());
211 $marks->setCompleted(!$marks->getCompleted());
216 $this->
lng->loadLanguageModule(
'trac');
217 $this->messages[] = $this->uiFactory->messageBox()->success(
218 $this->
lng->txt(
'trac_updated_status')
240 $additional_content = [];
242 if (is_object($entry[
"modal"])) {
243 $additional_content[] = $entry[
"modal"];
247 $this->
ctrl->setParameterByClass(
"illmpresentationgui",
'ref_id', $this->lm->getRefId());
248 $content = $this->uiRenderer->render($this->messages);
249 $content .= $this->
ctrl->getHTML($this->lm_pres, [
"cmd" =>
"layout"], [
"illmpresentationgui"]);
250 $content .= $this->uiRenderer->render($additional_content);
251 return $factory->
legacy()->content($content);
legacy()
description: purpose: > legacy components are used as provisional elements in the UI framework while...
ServerRequestInterface $httpRequest
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Base class to be implemented and put in class-directory of module with the name il$MODULEKioskModeVie...
toggleLearningProgress(string $command)
hasPermissionToAccessKioskMode()
withValueFor(string $key, string $value)
Set a value for a key of the state.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getValueFor(string $key)
Get the value for the given key.
ilGlobalTemplateInterface $mainTemplate
updateGet(State $state, string $command, ?int $parameter=null)
Update the state based on the provided command.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
initLMService(?int $current_page)
buildInitialState(State $empty_state)
Build an initial state based on the Provided empty state.
next(string $command, ?int $parameter=null)
A next control allows the user to progress to the next item in the object.
generic(string $label, string $command, ?int $parameter=null)
A generic control needs to have a label that tells what it does.
genericWithSignal(string $label, UI\Component\Signal $signal)
A genericWithSignal will trigger the Signal rather than refreshing the View.
tableOfContent(string $label, string $command, ?int $parameter=null, $state=null)
A table of content allows the user to get an overview over the generally available content in the obj...
static _hasCompleted(int $a_usr_id, int $a_obj_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Class ilLMPresentationGUI GUI class for learning module presentation.
render(State $state, Factory $factory, URLBuilder $url_builder, ?array $post=null)
setObject(ilObject $object)
Set the object for this view.
This is how the factory for UI elements looks.
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
ilPageObject $contentPageObject
maybeBuildLearningProgressToggleControl(ControlBuilder $builder)
previous(string $command, ?int $parameter=null)
A previous control allows the user to go back to the previous item in the object. ...
const CMD_TOGGLE_LEARNING_PROGRESS
Class ilLearningModuleKioskModeView.
updatePost(State $state, string $command, array $post)
Update the state and the object based on the provided command and post-data.
ilLMPresentationService $lm_pres_service
The URLBuilder allows views to get links that are used somewhere inline in the content.
buildControls(State $state, ControlBuilder $builder)
Construct the controls for the view based on the current state.
ilLMPresentationGUI $lm_pres
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Build controls for the view.
array $additional_content
static getInstance(int $obj_id)
static _updateStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)
Main service init and factory.