1 <?php declare(strict_types=1);
25 public function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
30 $this->lng = $DIC[
'lng'];
31 $this->rbacsystem = $DIC[
'rbacsystem'];
32 $this->error = $DIC[
'ilErr'];
36 $this->lng->loadLanguageModule(
'tos');
37 $this->lng->loadLanguageModule(
'meta');
56 $nextClass = $this->ctrl->getNextClass($this);
57 $cmd = $this->ctrl->getCmd();
60 $tableDataProviderFactory->setDatabaseAdapter($this->dic->database());
62 switch (strtolower($nextClass)) {
63 case 'iltermsofservicedocumentgui':
66 $this->dic[
'tos.criteria.type.factory'],
67 $this->dic->ui()->mainTemplate(),
70 $this->dic->language(),
71 $this->dic->rbac()->system(),
73 $this->dic->logger()->tos(),
74 $this->dic->toolbar(),
76 $this->dic->ui()->factory(),
77 $this->dic->ui()->renderer(),
78 $this->dic->filesystem(),
80 $tableDataProviderFactory,
83 $this->ctrl->forwardCommand($documentGui);
86 case 'iltermsofserviceacceptancehistorygui':
89 $this->dic[
'tos.criteria.type.factory'],
90 $this->dic->ui()->mainTemplate(),
92 $this->dic->language(),
93 $this->dic->rbac()->system(),
95 $this->dic->http()->request(),
96 $this->dic->ui()->factory(),
97 $this->dic->ui()->renderer(),
98 $tableDataProviderFactory
100 $this->ctrl->forwardCommand($documentGui);
103 case 'ilpermissiongui':
105 $this->ctrl->forwardCommand($perm_gui);
109 if ($cmd ==
'' || $cmd ==
'view' || !method_exists($this, $cmd)) {
122 if ($this->rbacsystem->checkAccess(
'read', $this->object->getRefId())) {
123 $this->tabs_gui->addTarget(
125 $this->ctrl->getLinkTarget($this,
'settings'),
127 [strtolower(get_class($this))]
131 if ($this->rbacsystem->checkAccess(
'read', $this->object->getRefId())) {
132 $this->tabs_gui->addTarget(
133 'tos_agreement_documents_tab_label',
134 $this->ctrl->getLinkTargetByClass(
'ilTermsOfServiceDocumentGUI'),
136 [
'iltermsofservicedocumentgui']
140 if ($this->rbacsystem->checkAccess(
'read', $this->object->getRefId()) &&
143 $this->tabs_gui->addTarget(
144 'tos_acceptance_history',
145 $this->ctrl->getLinkTargetByClass(
'ilTermsOfServiceAcceptanceHistoryGUI'),
147 [
'iltermsofserviceacceptancehistorygui']
151 if ($this->rbacsystem->checkAccess(
'edit_permission', $this->object->getRefId())) {
152 $this->tabs_gui->addTarget(
154 $this->ctrl->getLinkTargetByClass([get_class($this),
'ilpermissiongui'],
'perm'),
156 [
'ilpermissiongui',
'ilobjectpermissionstatusgui']
168 $this->ctrl->getFormAction($this,
'saveSettings'),
170 $this->rbacsystem->checkAccess(
'write', $this->object->getRefId())
181 if (!$this->rbacsystem->checkAccess(
'write', $this->object->getRefId())) {
182 $this->error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
186 if ($form->saveObject()) {
187 ilUtil::sendSuccess($this->lng->txt(
'saved_successfully'),
true);
188 $this->ctrl->redirect($this,
'settings');
190 if ($form->hasTranslatedError()) {
195 $this->tpl->setContent($form->getHTML());
203 if ($this->object->getStatus()) {
217 if (!$this->rbacsystem->checkAccess(
'read', $this->object->getRefId())) {
218 $this->error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
224 $this->tpl->setContent($form->getHTML());
New implementation of ilObjectGUI.
__construct($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
static where($where, $operator=null)
Class ilTermsOfServiceDocumentHtmlPurifier.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Class ilTermsOfServiceTableDataProviderFactory.
Class ilTermsOfServiceTrimmedDocumentPurifier.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Class ilTermsOfServiceAcceptanceHistoryGUI.
Class ilTermsOfServiceDocumentGUI.
__construct(Container $dic, ilPlugin $plugin)
prepareOutput($a_show_subobjects=true)
const USER_FOLDER_ID
Class ilObjUserFolder.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.