12use Psr\Http\Message\ServerRequestInterface;
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);
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();
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"])) {
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"]);
304 $this->mainTemplate->addCss(
306 $this->contentPageObject->getStyleSheetId()
An exception for terminatinating execution or to throw for unit testing.
Keeps the state of a view in a simple stringly type key-value store.
withValueFor(string $key, string $value)
Set a value for a key of the state.
getValueFor(string $key)
Get the value for the given key.
Base class to be implemented and put in class-directory of module with the name il$MODULEKioskModeVie...
Class ilLMPresentationGUI.
static _hasCompleted($a_usr_id, $a_obj_id)
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
Class ilLearningModuleKioskModeView.
renderContentStyle()
Renders the content style of a ContentPage object into main template.
initLMService($current_page)
Init learning module presentation service.
getObjectClass()
@inheritDoc
const CMD_TOGGLE_LEARNING_PROGRESS
maybeBuildLearningProgressToggleControl(ControlBuilder $builder)
toggleLearningProgress(string $command)
updatePost(State $state, string $command, array $post)
@inheritDoc
hasPermissionToAccessKioskMode()
@inheritDoc
buildInitialState(State $state)
@inheritDoc
buildControls(State $state, ControlBuilder $builder)
@inheritDoc
render(State $state, Factory $factory, URLBuilder $url_builder, array $post=null)
@inheritDoc
setObject(\ilObject $object)
@inheritDoc
updateGet(State $state, string $command, int $param=null)
@inheritDoc
static getSyntaxStylePath()
get syntax style path
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
static getInstance($a_obj_id)
Class ilObject Basic functions for all objects.
Build controls for the view.
The URLBuilder allows views to get links that are used somewhere inline in the content.
A component is the most general form of an entity in the UI.
This is how the factory for UI elements looks.
An entity that renders components to a string output.