ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
class.ilGlossaryEditorGUI.php
Go to the documentation of this file.
1 <?php
2 
25 {
26  protected int $requested_ref_id;
27  protected \ILIAS\Glossary\Editing\EditingGUIRequest $request;
28  protected ilCtrl $ctrl;
29  protected ilLanguage $lng;
32 
33  public function __construct()
34  {
35  global $DIC;
36 
37  $this->lng = $DIC->language();
38  $this->access = $DIC->access();
39  $this->nav_history = $DIC["ilNavigationHistory"];
40  $ilCtrl = $DIC->ctrl();
41  $lng = $DIC->language();
42  $ilAccess = $DIC->access();
43  $ilNavigationHistory = $DIC["ilNavigationHistory"];
44 
45  $this->request = $DIC->glossary()
46  ->internal()
47  ->gui()
48  ->editing()
49  ->request();
50 
51  $this->requested_ref_id = $this->request->getRefId();
52 
53  // initialisation stuff
54  $this->ctrl = $ilCtrl;
55  $lng->loadLanguageModule("content");
56 
57  $DIC->globalScreen()->tool()->context()->claim()->repository();
58 
59  // check write permission
60  if (!$ilAccess->checkAccess("write", "", $this->requested_ref_id) &&
61  !$ilAccess->checkAccess("edit_content", "", $this->requested_ref_id) &&
62  !$ilAccess->checkAccess("edit_permission", "", $this->requested_ref_id)) {
63  throw new ilPermissionException($lng->txt("permission_denied"));
64  }
65 
66  $ilNavigationHistory->addItem(
67  $this->requested_ref_id,
68  "ilias.php?baseClass=ilGlossaryEditorGUI&ref_id=" . $this->requested_ref_id,
69  "glo"
70  );
71  }
72 
73  public function executeCommand(): void
74  {
75  $next_class = $this->ctrl->getNextClass($this);
76  if ($next_class == "") {
77  $this->ctrl->saveParameterByClass(ilObjGlossaryGUI::class, "ref_id");
78  $this->ctrl->redirectByClass(ilObjGlossaryGUI::class);
79  }
80 
81  switch ($next_class) {
82  case 'ilobjglossarygui':
83  default:
84  $glossary_gui = new ilObjGlossaryGUI(
85  "",
86  $this->requested_ref_id,
87  true,
88  false
89  );
90  $this->ctrl->forwardCommand($glossary_gui);
91  break;
92  }
93  }
94 }
GUI class for ilGlossary.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
loadLanguageModule(string $a_module)
Load language module.
ILIAS Glossary Editing EditingGUIRequest $request
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilNavigationHistory $nav_history
global $DIC
Definition: shib_login.php:26
Last visited history for repository items.