ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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;
55  $tpl = $this->tpl;
56  $ilNavigationHistory = $this->nav_history;
57 
58  $next_class = $this->ctrl->getNextClass($this);
59  if ($next_class == "") {
60  $this->ctrl->setCmdClass("ilobjexercisegui");
61  $next_class = $this->ctrl->getNextClass($this);
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 
80  $tpl->printToStdout();
81  }
82 }
printToStdout(string $part=self::DEFAULT_BLOCK, bool $has_tabs=true, bool $skip_main_menu=false)
Interface ilCtrlBaseClassInterface describes ilCtrl base classes.
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Navigation History of Repository Items.
ilGlobalTemplateInterface $tpl
__construct(Container $dic, ilPlugin $plugin)
ilNavigationHistory $nav_history