ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
class.ilExerciseHandlerGUI.php
Go to the documentation of this file.
1<?php
2
25{
26 protected \ILIAS\GlobalScreen\Services $gs;
27 protected ilCtrl $ctrl;
28 protected ilLanguage $lng;
32 protected int $requested_ref_id;
33
34 public function __construct()
35 {
37 global $DIC;
38
39 $request = $DIC->exercise()->internal()->gui()->request();
40 $this->requested_ref_id = $request->getRefId();
41 $this->gs = $DIC->globalScreen();
42
43 $this->lng = $DIC->language();
44 $this->access = $DIC->access();
45 $this->tpl = $DIC["tpl"];
46 $this->nav_history = $DIC["ilNavigationHistory"];
47 $this->ctrl = $DIC->ctrl();
48 }
49
54 public function executeCommand(): void
55 {
56 $ilAccess = $this->access;
58 $ilNavigationHistory = $this->nav_history;
59
60 $next_class = $this->ctrl->getNextClass($this);
61 if ($next_class == "") {
62 $this->ctrl->saveParameterByClass(ilObjExerciseGUI::class, "ref_id");
63 $this->ctrl->redirectByClass(ilObjExerciseGUI::class, $this->ctrl->getCmd());
64 }
65
66 // add entry to navigation history
67 if ($ilAccess->checkAccess("read", "", $this->requested_ref_id)) {
68 $ilNavigationHistory->addItem(
69 $this->requested_ref_id,
70 "ilias.php?baseClass=ilExerciseHandlerGUI&cmd=showOverview&ref_id=" . $this->requested_ref_id,
71 "exc"
72 );
73 }
74
75 switch ($next_class) {
76 case 'ilobjexercisegui':
77 $this->gs->tool()->context()->claim()->repository();
78 $ex_gui = new ilObjExerciseGUI("", $this->requested_ref_id, true);
79 $this->ctrl->forwardCommand($ex_gui);
80 break;
81 }
82
84 }
85}
Class ilCtrl provides processing control methods.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilGlobalTemplateInterface $tpl
ilNavigationHistory $nav_history
ILIAS GlobalScreen Services $gs
language handling
Last visited history for repository items.
printToStdout(string $part=self::DEFAULT_BLOCK, bool $has_tabs=true, bool $skip_main_menu=false)
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26