73 return \ilObjLearningModule::class;
84 $this->ctrl = $DIC->ctrl();
85 $this->mainTemplate = $DIC->ui()->mainTemplate();
86 $this->uiFactory = $DIC->ui()->factory();
87 $this->uiRenderer = $DIC->ui()->renderer();
88 $this->httpRequest = $DIC->http()->request();
89 $this->tabs = $DIC->tabs();
90 $this->
user = $DIC->user();
101 $this->current_page_id =
$param;
102 $state = $state->
withValueFor(
"current_page", (
string) $this->current_page_id);
105 case self::CMD_TOGGLE_LEARNING_PROGRESS:
120 if (is_object($this->lm_pres)) {
128 [
"ref_id" => $this->lm->getRefId(),
129 "obj_id" => (int) $current_page],
133 $this->lm_pres_service = $this->lm_pres->getService();
141 return $this->access->checkAccess(
'read',
'', $this->lm->getRefId());
159 $main_tpl = $DIC->ui()->mainTemplate();
165 $nav_stat = $this->lm_pres_service->getNavigationStatus();
168 $succ_id = $nav_stat->getSuccessorPageId();
170 $builder->
next(
"layout", $succ_id);
174 $prev_id = $nav_stat->getPredecessorPageId();
176 $builder->
previous(
"layout", $prev_id);
179 $toc = $builder->
tableOfContent($this->lm->getTitle(),
'layout', 0);
181 $lm_toc_renderer->renderLSToc($toc, $lm_toc_renderer, 0);
189 if (is_object($entry[
"signal"])) {
195 if ($entry[
"on_load"] !=
"") {
196 $main_tpl->addOnLoadCode($entry[
"on_load"]);
213 if (is_null($this->menu_entries)) {
214 $menu = new \ILIAS\LearningModule\Menu\ilLMMenuGUI($this->lm_pres_service);
215 $this->menu_entries = $menu->getEntries();
229 $this->lng->loadLanguageModule(
'lm');
230 $learningProgressToggleCtrlLabel = $this->lng->txt(
'lm_btn_lp_toggle_state_completed');
232 $learningProgressToggleCtrlLabel = $this->lng->txt(
'lm_btn_lp_toggle_state_not_completed');
235 $learningProgressToggleCtrlLabel,
236 self::CMD_TOGGLE_LEARNING_PROGRESS,
248 if (self::CMD_TOGGLE_LEARNING_PROGRESS === $command) {
251 $marks = new \ilLPMarks($this->lm->getId(), $this->
user->getId());
252 $marks->setCompleted(!$marks->getCompleted());
257 $this->lng->loadLanguageModule(
'trac');
258 $this->messages[] = $this->uiFactory->messageBox()->success(
259 $this->lng->txt(
'trac_updated_status')
286 if (is_object($entry[
"modal"])) {
287 $additional_content[] = $entry[
"modal"];
291 $this->ctrl->setParameterByClass(
"illmpresentationgui",
'ref_id', $this->lm->getRefId());
292 $content = $this->uiRenderer->render($this->messages);
293 $content .= $this->ctrl->getHTML($this->lm_pres, [
"cmd" =>
"layout"], [
"illmpresentationgui"]);
294 $content .= $this->uiRenderer->render($additional_content);
295 return $factory->
legacy($content);
304 $this->mainTemplate->addCss(
306 $this->contentPageObject->getStyleSheetId()
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
static _hasCompleted($a_usr_id, $a_obj_id)
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.
next(string $command, int $parameter=null)
A next control allows the user to progress to the next item in the object.
getValueFor(string $key)
Get the value for the given key.
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
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...
buildInitialState(State $state)
Keeps the state of a view in a simple stringly type key-value store.
genericWithSignal(string $label, UI\Component\Signal $signal)
A genericWithSignal will trigger the Signal rather than refreshing the View.
Class ilLMPresentationGUI.
updateGet(State $state, string $command, int $param=null)
This is how the factory for UI elements looks.
renderContentStyle()
Renders the content style of a ContentPage object into main template.
render(State $state, Factory $factory, URLBuilder $url_builder, array $post=null)
maybeBuildLearningProgressToggleControl(ControlBuilder $builder)
legacy($content)
description: purpose: > This component is used to wrap an existing ILIAS UI element into a UI compon...
const CMD_TOGGLE_LEARNING_PROGRESS
Class ilLearningModuleKioskModeView.
updatePost(State $state, string $command, array $post)
static getSyntaxStylePath()
get syntax style path
initLMService($current_page)
Init learning module presentation service.
The URLBuilder allows views to get links that are used somewhere inline in the content.
buildControls(State $state, ControlBuilder $builder)
previous(string $command, int $parameter=null)
A previous control allows the user to go back to the previous item in the object. ...
Build controls for the view.
static getInstance($a_obj_id)
generic(string $label, string $command, int $parameter=null)
A generic control needs to have a label that tells what it does.
setObject(\ilObject $object)