ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilExerciseHandlerGUI.php
Go to the documentation of this file.
1<?php
2
25{
26 protected ilCtrl $ctrl;
27 protected ilLanguage $lng;
31 protected int $requested_ref_id;
32
33 public function __construct()
34 {
36 global $DIC;
37
38 $request = $DIC->exercise()->internal()->gui()->request();
39 $this->requested_ref_id = $request->getRefId();
40
41 $this->lng = $DIC->language();
42 $this->access = $DIC->access();
43 $this->tpl = $DIC["tpl"];
44 $this->nav_history = $DIC["ilNavigationHistory"];
45 $this->ctrl = $DIC->ctrl();
46 }
47
52 public function executeCommand(): void
53 {
54 $ilAccess = $this->access;
56 $ilNavigationHistory = $this->nav_history;
57
58 $next_class = $this->ctrl->getNextClass($this);
59 if ($next_class == "") {
60 $this->ctrl->saveParameterByClass(ilObjExerciseGUI::class, "ref_id");
61 $this->ctrl->redirectByClass(ilObjExerciseGUI::class, $this->ctrl->getCmd());
62 }
63
64 // add entry to navigation history
65 if ($ilAccess->checkAccess("read", "", $this->requested_ref_id)) {
66 $ilNavigationHistory->addItem(
67 $this->requested_ref_id,
68 "ilias.php?baseClass=ilExerciseHandlerGUI&cmd=showOverview&ref_id=" . $this->requested_ref_id,
69 "exc"
70 );
71 }
72
73 switch ($next_class) {
74 case 'ilobjexercisegui':
75 $ex_gui = new ilObjExerciseGUI("", $this->requested_ref_id, true);
76 $this->ctrl->forwardCommand($ex_gui);
77 break;
78 }
79
81 }
82}
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
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