ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilHTLMEditorGUI.php
Go to the documentation of this file.
1<?php
2
20
27{
29 protected ilCtrl $ctrl;
36 public int $ref_id;
37
38 public function __construct()
39 {
40 global $DIC;
41
42 $this->rbacsystem = $DIC->rbac()->system();
43 $this->access = $DIC->access();
44 $this->nav_history = $DIC["ilNavigationHistory"];
45 $tpl = $DIC["tpl"];
46 $lng = $DIC->language();
47 $objDefinition = $DIC["objDefinition"];
48 $ilCtrl = $DIC->ctrl();
49 $rbacsystem = $DIC->rbac()->system();
50 $this->request = $DIC->htmlLearningModule()
51 ->internal()
52 ->gui()
53 ->standardRequest();
54
55 $lng->loadLanguageModule("content");
56
57 // check write permission
58 if (!$rbacsystem->checkAccess("write", $this->request->getRefId())) {
59 throw new ilPermissionException($lng->txt("permission_denied"));
60 }
61
62 $this->ctrl = $ilCtrl;
63
64 //$this->ctrl->saveParameter($this, array("ref_id", "obj_id"));
65 $this->ctrl->saveParameter($this, array("ref_id"));
66
67 // initiate variables
68 $this->tpl = $tpl;
69 $this->lng = $lng;
70 $this->objDefinition = $objDefinition;
71 $this->ref_id = $this->request->getRefId();
72 }
73
74 public function executeCommand(): void
75 {
77 $ilCtrl = $this->ctrl;
78 $ilAccess = $this->access;
79 $ilNavigationHistory = $this->nav_history;
80
81 $next_class = $this->ctrl->getNextClass($this);
82 $cmd = $this->ctrl->getCmd("");
83
84 // add entry to navigation history
85 if ($ilAccess->checkAccess("read", "", $this->ref_id)) {
86 $ilCtrl->setParameterByClass("ilobjfilebasedlmgui", "ref_id", $this->ref_id);
87 $ilNavigationHistory->addItem(
88 $this->ref_id,
89 $ilCtrl->getLinkTargetByClass(array("ilrepositorygui", "ilobjfilebasedlmgui"), "infoScreen"),
90 "htlm"
91 );
92 }
93
94 switch ($next_class) {
95 case "ilobjfilebasedlmgui":
96 $fblm_gui = new ilObjFileBasedLMGUI("", $this->ref_id, true, false);
97 $ilCtrl->forwardCommand($fblm_gui);
99 break;
100
101 default:
102 $this->ctrl->saveParameterByClass(ilObjFileBasedLMGUI::class, "ref_id");
103 $this->ctrl->redirectByClass(ilObjFileBasedLMGUI::class, "");
104 break;
105 }
106 }
107}
Class ilCtrl provides processing control methods.
GUI class for learning module editor.
ilAccessHandler $access
ilNavigationHistory $nav_history
StandardGUIRequest $request
ilGlobalTemplateInterface $tpl
ilObjectDefinition $objDefinition
language handling
loadLanguageModule(string $a_module)
Load language module.
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...
Last visited history for repository items.
User Interface class for file based learning modules (HTML)
parses the objects.xml it handles the xml-description of all ilias objects
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
checkAccess(string $a_operations, int $a_ref_id, string $a_type="")
checkAccess represents the main method of the RBAC-system in ILIAS3 developers want to use With this ...
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...
global $DIC
Definition: shib_login.php:26