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'];
34 parent::__construct($a_id, $a_id_type, $a_parent_node_id);
36 $this->lng->loadLanguageModule(
'tos');
37 $this->lng->loadLanguageModule(
'meta');
55 $nextClass = $this->ctrl->getNextClass($this);
56 $cmd = $this->ctrl->getCmd();
58 $tableDataProviderFactory = new \ilTermsOfServiceTableDataProviderFactory();
59 $tableDataProviderFactory->setDatabaseAdapter($this->dic->database());
61 switch (strtolower($nextClass)) {
62 case 'iltermsofservicedocumentgui':
63 $documentGui = new \ilTermsOfServiceDocumentGUI(
65 $this->dic[
'tos.criteria.type.factory'],
66 $this->dic->ui()->mainTemplate(),
69 $this->dic->language(),
70 $this->dic->rbac()->system(),
72 $this->dic->logger()->tos(),
73 $this->dic->toolbar(),
75 $this->dic->ui()->factory(),
76 $this->dic->ui()->renderer(),
77 $this->dic->filesystem(),
79 $tableDataProviderFactory,
82 $this->ctrl->forwardCommand($documentGui);
85 case 'iltermsofserviceacceptancehistorygui':
86 $documentGui = new \ilTermsOfServiceAcceptanceHistoryGUI(
88 $this->dic[
'tos.criteria.type.factory'],
89 $this->dic->ui()->mainTemplate(),
91 $this->dic->language(),
92 $this->dic->rbac()->system(),
94 $this->dic->http()->request(),
95 $this->dic->ui()->factory(),
96 $this->dic->ui()->renderer(),
97 $tableDataProviderFactory
99 $this->ctrl->forwardCommand($documentGui);
102 case 'ilpermissiongui':
103 $perm_gui = new \ilPermissionGUI($this);
104 $this->ctrl->forwardCommand($perm_gui);
108 if ($cmd ==
'' || $cmd ==
'view' || !method_exists($this, $cmd)) {
121 if ($this->rbacsystem->checkAccess(
'read', $this->object->getRefId())) {
122 $this->tabs_gui->addTarget(
124 $this->ctrl->getLinkTarget($this,
'settings'),
126 [strtolower(get_class($this))]
130 if ($this->rbacsystem->checkAccess(
'read', $this->object->getRefId())) {
131 $this->tabs_gui->addTarget(
132 'tos_agreement_documents_tab_label',
133 $this->ctrl->getLinkTargetByClass(
'ilTermsOfServiceDocumentGUI'),
135 [
'iltermsofservicedocumentgui']
139 if ($this->rbacsystem->checkAccess(
'read', $this->object->getRefId()) &&
142 $this->tabs_gui->addTarget(
143 'tos_acceptance_history',
144 $this->ctrl->getLinkTargetByClass(
'ilTermsOfServiceAcceptanceHistoryGUI'),
146 [
'iltermsofserviceacceptancehistorygui']
150 if ($this->rbacsystem->checkAccess(
'edit_permission', $this->object->getRefId())) {
151 $this->tabs_gui->addTarget(
153 $this->ctrl->getLinkTargetByClass([get_class($this),
'ilpermissiongui'],
'perm'),
155 [
'ilpermissiongui',
'ilobjectpermissionstatusgui']
165 $form = new \ilTermsOfServiceSettingsFormGUI(
167 $this->ctrl->getFormAction($this,
'saveSettings'),
169 $this->rbacsystem->checkAccess(
'write', $this->object->getRefId())
180 if (!$this->rbacsystem->checkAccess(
'write', $this->object->getRefId())) {
181 $this->error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
185 if (
$form->saveObject()) {
186 \ilUtil::sendSuccess($this->lng->txt(
'saved_successfully'),
true);
187 $this->ctrl->redirect($this,
'settings');
189 if (
$form->hasTranslatedError()) {
194 $this->tpl->setContent(
$form->getHTML());
202 if (!$this->object->getStatus()) {
216 if (!$this->rbacsystem->checkAccess(
'read', $this->object->getRefId())) {
217 $this->error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
223 $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.
if(isset($_POST['submit'])) $form
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
prepareOutput($a_show_subobjects=true)
const USER_FOLDER_ID
Class ilObjUserFolder.