ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
class.ilObjDataCollectionGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
23
39{
40 public const GET_REF_ID = 'ref_id';
41 public const GET_TABLE_ID = 'table_id';
42 public const GET_VIEW_ID = 'tableview_id';
43 public const GET_RECORD_ID = 'record_id';
44
45 public const TAB_EDIT_DCL = 'settings';
46 public const TAB_LIST_TABLES = 'dcl_tables';
47 public const TAB_META_DATA = 'meta_data';
48 public const TAB_EXPORT = 'export';
49 public const TAB_LIST_PERMISSIONS = 'perm_settings';
50 public const TAB_INFO = 'info_short';
51 public const TAB_CONTENT = 'content';
53 public ?ilObject $object = null;
54 protected ilCtrl $ctrl;
55 protected ilLanguage $lng;
56 protected ilTabsGUI $tabs;
57 protected int $table_id;
58 protected int $tableview_id;
60
61 public function __construct(int $a_id = 0, int $a_id_type = self::REPOSITORY_NODE_ID, int $a_parent_node_id = 0)
62 {
63 global $DIC;
64
65 parent::__construct($a_id, $a_id_type, $a_parent_node_id);
66
67 $this->tabs = $DIC->tabs();
68 $this->notification_settings = new ilDclNotification($DIC->database());
69
70 $this->lng->loadLanguageModule('dcl');
71 $this->lng->loadLanguageModule('content');
72 $this->lng->loadLanguageModule('obj');
73 $this->lng->loadLanguageModule('cntr');
74
75 $this->setTableData();
76
77 if (!$this->ctrl->isAsynch()) {
78 $this->addJavaScript();
79 }
80
81 $this->ctrl->saveParameter($this, 'table_id');
82 }
83
84 private function setTableData(): void
85 {
86 if ($this->ref_id > 0) {
87 if ($this->http->wrapper()->post()->has('table_id')) {
88 $this->table_id = $this->http->wrapper()->post()->retrieve(
89 'table_id',
90 $this->refinery->kindlyTo()->int()
91 );
92 } elseif ($this->http->wrapper()->query()->has('table_id')) {
93 $this->table_id = $this->http->wrapper()->query()->retrieve(
94 'table_id',
95 $this->refinery->kindlyTo()->int()
96 );
97 }
98
99 if (!isset($this->table_id) || !in_array($this->table_id, array_keys($this->object->getTables()))) {
100 if (isset($this->table_id)) {
101 $this->tpl->setOnScreenMessage($this->tpl::MESSAGE_TYPE_FAILURE, $this->lng->txt('table_not_found'), true);
102 unset($this->table_id);
103 }
104 $tables = ilObjDataCollectionAccess::hasWriteAccess($this->ref_id) ? $this->object->getTables() : $this->object->getVisibleTables();
105 if ($tables !== []) {
106 $this->table_id = array_shift($tables)->getId();
107 $tableview = (ilDclCache::getTableCache($this->table_id))->getFirstTableViewId();
108 if ($tableview !== null) {
109 $this->tableview_id = $tableview;
110 }
111 }
112 } else {
113 if ($this->http->wrapper()->post()->has('tableview_id')) {
114 $this->tableview_id = $this->http->wrapper()->post()->retrieve(
115 'tableview_id',
116 $this->refinery->kindlyTo()->int()
117 );
118 } elseif ($this->http->wrapper()->query()->has('tableview_id')) {
119 $this->tableview_id = $this->http->wrapper()->query()->retrieve(
120 'tableview_id',
121 $this->refinery->kindlyTo()->int()
122 );
123 }
124
125 if (!isset($this->tableview_id) || !in_array($this->tableview_id, array_keys($this->object->getTableById($this->table_id)->getTableViews()))) {
126 if (isset($this->tableview_id)) {
127 $this->tpl->setOnScreenMessage($this->tpl::MESSAGE_TYPE_FAILURE, $this->lng->txt('tableview_not_found'), true);
128 }
129 $tableview = (ilDclCache::getTableCache($this->table_id))->getFirstTableViewId();
130 if ($tableview !== null) {
131 $this->tableview_id = $tableview;
132 }
133 }
134 }
135 }
136 }
137
138 public function getObjectId(): int
139 {
140 return $this->obj_id;
141 }
142
143 private function addJavaScript(): void
144 {
145 $this->tpl->addJavaScript('assets/js/datacollection.js');
146 }
147
148 public function getStandardCmd(): string
149 {
150 return 'render';
151 }
152
153 public function getType(): string
154 {
156 }
157
158 public function executeCommand(): void
159 {
160 global $DIC;
161
162 $ilNavigationHistory = $DIC['ilNavigationHistory'];
163 $DIC->help()->setScreenIdComponent('dcl');
164 $link = $this->ctrl->getLinkTarget($this, 'render');
165
166 if ($this->getObject() !== null) {
167 $ilNavigationHistory->addItem($this->object->getRefId(), $link, 'dcl');
168 }
169
170 $next_class = $this->ctrl->getNextClass($this);
171 $cmd = $this->ctrl->getCmd();
172
173 if (!$this->getCreationMode() && $next_class != 'ilinfoscreengui' && $cmd !== 'infoScreen' && !$this->checkPermissionBool('read')) {
174 $DIC->ui()->mainTemplate()->loadStandardTemplate();
175 $DIC->ui()->mainTemplate()->setContent('Permission Denied.');
176 return;
177 }
178
179 switch ($next_class) {
180 case strtolower(ilInfoScreenGUI::class):
181 $this->prepareOutput();
182 $this->tabs->activateTab(self::TAB_INFO);
183 $this->infoScreenForward();
184 break;
185 case strtolower(ilCommonActionDispatcherGUI::class):
186 $this->prepareOutput();
188 $gui->enableCommentsSettings(false);
189 $this->ctrl->forwardCommand($gui);
190 break;
191 case strtolower(ilPermissionGUI::class):
192 $this->prepareOutput();
193 $this->tabs->activateTab(self::TAB_LIST_PERMISSIONS);
194 $perm_gui = new ilPermissionGUI($this);
195 $this->ctrl->forwardCommand($perm_gui);
196 break;
197 case strtolower(ilObjectCopyGUI::class):
198 $cp = new ilObjectCopyGUI($this);
199 $cp->setType('dcl');
200 $DIC->ui()->mainTemplate()->loadStandardTemplate();
201 $this->ctrl->forwardCommand($cp);
202 break;
203 case strtolower(ilDclTableListGUI::class):
204 $this->prepareOutput();
205 $this->tabs->activateTab(self::TAB_LIST_TABLES);
206 $tablelist_gui = new ilDclTableListGUI($this);
207 $this->ctrl->forwardCommand($tablelist_gui);
208 break;
209 case strtolower(ilDclRecordListGUI::class):
210 $this->addHeaderAction();
211 $this->prepareOutput();
212 $this->tabs->activateTab(self::TAB_CONTENT);
213 if (!isset($this->table_id)) {
214 $this->tpl->setOnScreenMessage($this->tpl::MESSAGE_TYPE_INFO, $this->lng->txt('dcl_no_table_found'));
215 } elseif (!isset($this->tableview_id)) {
216 $this->tpl->setOnScreenMessage($this->tpl::MESSAGE_TYPE_INFO, $this->lng->txt('dcl_no_tableview_found'));
217 } else {
218 $recordlist_gui = new ilDclRecordListGUI($this, $this->table_id, $this->tableview_id);
219 $this->ctrl->forwardCommand($recordlist_gui);
220 }
221 break;
222 case strtolower(ilDclRecordEditGUI::class):
223 $this->prepareOutput();
224 $this->tabs->activateTab(self::TAB_CONTENT);
225 if (!isset($this->table_id)) {
226 $this->tpl->setOnScreenMessage($this->tpl::MESSAGE_TYPE_INFO, $this->lng->txt('dcl_no_table_found'));
227 } elseif (!isset($this->tableview_id)) {
228 $this->tpl->setOnScreenMessage($this->tpl::MESSAGE_TYPE_INFO, $this->lng->txt('dcl_no_tableview_found'));
229 } else {
230 $recordedit_gui = new ilDclRecordEditGUI($this, $this->table_id, $this->tableview_id);
231 $this->ctrl->forwardCommand($recordedit_gui);
232 }
233 break;
234 case strtolower(ilObjFileGUI::class):
235 $this->prepareOutput();
236 $this->tabs->activateTab(self::TAB_CONTENT);
237 $file_gui = new ilObjFile($this->getRefId());
238 $this->ctrl->forwardCommand($file_gui);
239 break;
240 case strtolower(ilRatingGUI::class):
241 $rgui = new ilRatingGUI();
242
243 $record_id = $this->http->wrapper()->query()->retrieve('record_id', $this->refinery->kindlyTo()->int());
244 $field_id = $this->http->wrapper()->query()->retrieve('field_id', $this->refinery->kindlyTo()->int());
245
246 $rgui->setObject($record_id, 'dcl_record', $field_id, 'dcl_field');
247 $rgui->executeCommand();
248
249 $detail = $this->http->wrapper()->query()->retrieve('detail_view', $this->refinery->kindlyTo()->bool());
250 $this->ctrl->setParameterByClass(
251 $detail ? ilDclDetailedViewGUI::class : ilDclRecordListGUI::class,
252 'tableview_id',
253 $this->http->wrapper()->query()->retrieve('tableview_id', $this->refinery->kindlyTo()->int())
254 );
255 if ($detail) {
256 $this->ctrl->setParameterByClass(
257 ilDclDetailedViewGUI::class,
258 'record_id',
259 $this->http->wrapper()->query()->retrieve('record_id', $this->refinery->kindlyTo()->int())
260 );
261 $this->ctrl->redirectByClass([ilRepositoryGUI::class, self::class, ilDclDetailedViewGUI::class], 'renderRecord');
262 } else {
263 $this->listRecords();
264 }
265 break;
266 case strtolower(ilDclDetailedViewGUI::class):
267 $this->prepareOutput();
268 if (!isset($this->tableview_id)) {
269 $this->tpl->setOnScreenMessage($this->tpl::MESSAGE_TYPE_INFO, $this->lng->txt('dcl_no_tableview_found'));
270 } else {
271 $recordview_gui = new ilDclDetailedViewGUI($this, $this->tableview_id);
272 $this->ctrl->forwardCommand($recordview_gui);
273 $this->tabs->setBackTarget(
274 $this->lng->txt('back'),
275 $this->ctrl->getLinkTargetByClass(
276 ilDclRecordListGUI::class,
278 )
279 );
280 }
281 break;
282 case strtolower(ilNoteGUI::class):
283 $this->prepareOutput();
284 if (!isset($this->tableview_id)) {
285 $this->tpl->setOnScreenMessage($this->tpl::MESSAGE_TYPE_INFO, $this->lng->txt('dcl_no_tableview_found'));
286 } else {
287 $recordviewGui = new ilDclDetailedViewGUI($this, $this->tableview_id);
288 $this->ctrl->forwardCommand($recordviewGui);
289 $this->tabs->clearTargets();
290 $this->tabs->setBackTarget($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, ''));
291 }
292 break;
293 case strtolower(ilExportGUI::class):
294 $this->prepareOutput();
295 $this->handleExport();
296 break;
297 case strtolower(ilDclPropertyFormGUI::class):
298 if (!isset($this->table_id)) {
299 $this->tpl->setOnScreenMessage($this->tpl::MESSAGE_TYPE_INFO, $this->lng->txt('dcl_no_table_found'));
300 } elseif (!isset($this->tableview_id)) {
301 $this->tpl->setOnScreenMessage($this->tpl::MESSAGE_TYPE_INFO, $this->lng->txt('dcl_no_tableview_found'));
302 } else {
303 $recordedit_gui = new ilDclRecordEditGUI($this, $this->table_id, $this->tableview_id);
304 $recordedit_gui->getRecord();
305 $recordedit_gui->initForm();
306 $form = $recordedit_gui->getForm();
307 $this->ctrl->forwardCommand($form);
308 }
309 break;
310 case strtolower(ilObjectMetaDataGUI::class):
311 $this->checkPermission('write');
312 $this->prepareOutput();
313 $this->tabs->activateTab(self::TAB_META_DATA);
314 $gui = new ilObjectMetaDataGUI($this->object);
315 $this->ctrl->forwardCommand($gui);
316 break;
317 case strtolower(ilObjectContentStyleSettingsGUI::class):
318 $this->prepareOutput();
319 $this->setEditTabs();
320 $this->tabs->activateTab('settings');
321 $this->tabs->activateSubTab('cont_style');
322 global $DIC;
323 $settings_gui = $DIC->contentStyle()->gui()->objectSettingsGUIForRefId(null, $this->ref_id);
324 $this->ctrl->forwardCommand($settings_gui);
325 break;
326 default:
327 parent::executeCommand();
328 }
329 }
330
331 protected function handleExport(bool $do_default = false): void
332 {
333 $this->tabs->setTabActive(self::TAB_EXPORT);
334 $exp_gui = new ilExportGUI($this);
335 if ($do_default) {
336 $exp_gui->listExportFiles();
337 } else {
338 $this->ctrl->forwardCommand($exp_gui);
339 }
340 }
341
342 protected function handleExportAsync(): void
343 {
344 $this->tabs->setTabActive(self::TAB_EXPORT);
345 $exp_gui = new ilExportGUI($this);
346 $exporter = new ilDclContentExporter($this->object->getRefId(), null);
347 $exporter->exportAsync();
348 $this->ctrl->redirect($exp_gui);
349 }
350
351 public function infoScreen(): void
352 {
353 $this->ctrl->redirectByClass(ilInfoScreenGUI::class, 'showSummary');
354 }
355
356 public function render(): void
357 {
358 $this->listRecords();
359 }
360
361 public function infoScreenForward(): void
362 {
363 $this->tabs->activateTab(self::TAB_INFO);
364
365 if (!$this->checkPermissionBool('visible')) {
366 $this->checkPermission('read');
367 }
368
369 $info = new ilInfoScreenGUI($this);
370 $info->enablePrivateNotes();
371 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
372
373 $this->ctrl->forwardCommand($info);
374 }
375
376 protected function addLocatorItems(): void
377 {
378 if (is_object($this->object) === true) {
379 $this->locator->addItem(
380 $this->object->getTitle(),
381 $this->ctrl->getLinkTarget($this, ''),
382 (string) $this->object->getRefId()
383 );
384 }
385 }
386
387 public static function _goto(string $a_target): void
388 {
389 global $DIC;
390
392 $values = array_combine($values, array_pad(explode('_', $a_target), count($values), 0));
393
394 $ref_id = (int) $values[self::GET_REF_ID];
395 if ($ref_id !== 0) {
396 $DIC->ctrl()->setParameterByClass(ilRepositoryGUI::class, self::GET_REF_ID, $ref_id);
397 $table_id = (int) $values[self::GET_TABLE_ID];
398 if ($table_id !== 0) {
399 $DIC->ctrl()->setParameterByClass(ilObjDataCollectionGUI::class, self::GET_TABLE_ID, $table_id);
400 $view_id = (int) $values[self::GET_VIEW_ID];
401 if ($view_id !== 0) {
402 $DIC->ctrl()->setParameterByClass(ilObjDataCollectionGUI::class, self::GET_VIEW_ID, $view_id);
403 }
404 $record_id = (int) $values[self::GET_RECORD_ID];
405 if ($record_id !== 0) {
406 $DIC->ctrl()->setParameterByClass(ilDclDetailedViewGUI::class, self::GET_RECORD_ID, $record_id);
407 $DIC->ctrl()->redirectByClass([ilRepositoryGUI::class, self::class, ilDclDetailedViewGUI::class], 'renderRecord');
408 }
409 }
410 }
411 $DIC->ctrl()->redirectByClass([ilRepositoryGUI::class, self::class, ilDclRecordListGUI::class], 'listRecords');
412 }
413
414 protected function afterSave(ilObject $new_object): void
415 {
416 $this->tpl->setOnScreenMessage('success', $this->lng->txt('object_added'), true);
417 $this->ctrl->redirectByClass(ilDclTableListGUI::class, 'listTables');
418 }
419
420 protected function setTabs(): void
421 {
422 $ref_id = $this->object->getRefId();
423
424 if ($this->access->checkAccess('read', '', $ref_id) === true) {
425 $this->addTab(self::TAB_CONTENT, $this->ctrl->getLinkTargetByClass(ilDclRecordListGUI::class, 'show'));
426 }
427
428 if ($this->access->checkAccess('visible', '', $ref_id) === true || $this->access->checkAccess('read', '', $ref_id) === true) {
429 $this->addTab(self::TAB_INFO, $this->ctrl->getLinkTargetByClass(ilInfoScreenGUI::class, 'showSummary'));
430 }
431
432 if ($this->access->checkAccess('write', '', $ref_id) === true) {
433 $this->addTab(self::TAB_EDIT_DCL, $this->ctrl->getLinkTarget($this, 'edit'));
434 $this->addTab(self::TAB_LIST_TABLES, $this->ctrl->getLinkTargetByClass(ilDclTableListGUI::class, 'listTables'));
435 $mdgui = new ilObjectMetaDataGUI($this->object);
436 if ($mdtab = $mdgui->getTab()) {
437 $this->tabs_gui->addTab(self::TAB_META_DATA, $this->lng->txt('meta_data'), $mdtab);
438 }
439 $this->addTab(self::TAB_EXPORT, $this->ctrl->getLinkTargetByClass(ilExportGUI::class, ''));
440 }
441
442 if ($this->access->checkAccess('edit_permission', '', $ref_id) === true) {
443 $this->addTab(self::TAB_LIST_PERMISSIONS, $this->ctrl->getLinkTargetByClass(ilPermissionGUI::class, 'perm'));
444 }
445 }
446
447 private function addTab(string $langKey, string $link): void
448 {
449 $this->tabs->addTab($langKey, $this->lng->txt($langKey), $link);
450 }
451
452 protected function initForm(): Form
453 {
454 $inputs = [];
455
456 $edit = [];
457 $edit['title'] = $this->ui_factory->input()->field()->text($this->lng->txt('title'))->withRequired(true);
458 $edit['description'] = $this->ui_factory->input()->field()->textarea($this->lng->txt('description'));
459 $edit['notification'] = $this->ui_factory->input()->field()->checkbox(
460 $this->lng->txt('dcl_activate_notification'),
461 $this->lng->txt('dcl_notification_info')
462 );
463 $inputs['edit'] = $this->ui_factory->input()->field()->section($edit, $this->lng->txt($this->type . '_edit'))
464 ->withValue([
465 'title' => $this->object->getTitle(),
466 'description' => $this->object->getLongDescription(),
467 'notification' => $this->object->getNotification(),
468 ]);
469
470 $availability = [];
471 $availability['online'] = $this->ui_factory->input()->field()->checkbox(
472 $this->lng->txt('online'),
473 $this->lng->txt('dcl_online_info')
474 );
475 $inputs['availability'] = $this->ui_factory->input()->field()->section($availability, $this->lng->txt('obj_activation_list_gui'))
476 ->withValue(['online' => $this->object->getOnline(),]);
477
478 $presentation = [];
479 $presentation['tile_image'] = $this->object->getObjectProperties()->getPropertyTileImage()->toForm(
480 $this->lng,
481 $this->ui_factory->input()->field(),
482 $this->refinery
483 );
484 $inputs['presentation'] = $this->ui_factory->input()->field()->section($presentation, $this->lng->txt('cont_presentation'));
485
486 return $this->ui_factory->input()->container()->form()->standard($this->ctrl->getFormAction($this, 'update'), $inputs);
487 }
488
489 public function edit(): void
490 {
491 if (!$this->checkPermissionBool('write')) {
492 $this->tpl->setOnScreenMessage($this->tpl::MESSAGE_TYPE_FAILURE, $this->lng->txt('permission_denied'));
493 }
494
495 $this->setEditTabs();
496 $this->tabs->activateTab(self::TAB_EDIT_DCL);
497
498 $this->tpl->setContent($this->ui_renderer->render($this->initForm()));
499 }
500
501 public function update(): void
502 {
503 if (!$this->checkPermissionBool('write')) {
504 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
505 }
506
507 $this->setEditTabs();
508 $this->tabs->activateTab(self::TAB_EDIT_DCL);
509
510 $form = $this->initForm()->withRequest($this->http->request());
511 $data = $form->getData();
512
513 if ($data !== null) {
514 $this->object->setTitle($data['edit']['title']);
515 $this->object->setDescription($data['edit']['description']);
516 $this->object->setNotification($data['edit']['notification']);
517 $this->object->setOnline($data['availability']['online']);
518 $this->object->getObjectProperties()->storePropertyTileImage($data['presentation']['tile_image']);
519 $this->object->update();
520 $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
521 }
522
523 $this->ctrl->redirect($this, 'edit');
524 }
525
526 protected function setEditTabs(): void
527 {
528 $this->tabs->addSubTab(
529 'general',
530 $this->lng->txt('general'),
531 $this->ctrl->getLinkTargetByClass(self::class, 'edit')
532 );
533 $this->tabs->addSubTab(
534 'cont_style',
535 $this->lng->txt('cont_style'),
536 $this->ctrl->getLinkTargetByClass(ilObjectContentStyleSettingsGUI::class)
537 );
538
539 $this->tabs->activateSubTab('general');
540 }
541
542 final public function listRecords(): void
543 {
544 $this->ctrl->redirectByClass(ilDclRecordListGUI::class, 'show');
545 }
546
548 {
549 return new ilObjDataCollection($this->ref_id, true);
550 }
551
552 final public function activateNotification(): void
553 {
555 foreach (ilDclNotificationType::cases() as $notification) {
556 $this->notification_settings->add($this->object, $this->user, $notification);
557 }
558 $this->ctrl->redirectByClass(ilDclRecordListGUI::class, 'show');
559 }
560
561 final public function deactivateNotification(): void
562 {
563 ilNotification::setNotification(ilNotification::TYPE_DATA_COLLECTION, $this->user->getId(), $this->obj_id, false);
564 $this->notification_settings->clear($this->object, $this->user);
565 $this->ctrl->redirectByClass(ilDclRecordListGUI::class, 'show');
566 }
567
568 final public function editNotification(): void
569 {
570 if ($data = $this->getNotificationModal()->withRequest($this->request)->getData()) {
571 $this->notification_settings->clear($this->object, $this->user);
572 foreach (ilDclNotificationType::cases() as $notification) {
573 if ($data[$notification->value]) {
574 $this->notification_settings->add($this->object, $this->user, $notification);
575 }
576 }
577 }
578 $this->ctrl->redirectByClass(ilDclRecordListGUI::class, 'show');
579 }
580
581 protected function addHeaderAction(): void
582 {
584 $this->ctrl->getLinkTarget($this, 'redrawHeaderAction', '', true),
585 '',
586 $this->ctrl->getLinkTargetByClass([ilCommonActionDispatcherGUI::class, ilTaggingGUI::class], '', '', true)
587 );
588
589 $dispatcher = new ilCommonActionDispatcherGUI(ilCommonActionDispatcherGUI::TYPE_REPOSITORY, $this->access, 'dcl', $this->ref_id, $this->obj_id);
590
591 $lg = $dispatcher->initHeaderAction();
592
593 if ($this->user->getId() != ANONYMOUS_USER_ID and $this->object->getNotification() == 1) {
595 $lg->addCustomCommandButton(
596 $this->ui_factory->button()->shy(
597 $this->lng->txt('dcl_notification_deactivate'),
598 $this->ctrl->getLinkTarget($this, 'deactivateNotification')
599 )
600 );
601 $modal = $this->getNotificationModal();
602 $lg->addCustomCommandButton(
603 $this->ui_factory->button()->shy(
604 $this->lng->txt('dcl_notification_settings'),
605 $modal->getShowSignal()
606 ),
607 $modal
608 );
609 $lg->addHeaderIcon('not_icon', ilUtil::getImagePath('object/notification_on.svg'), $this->lng->txt('dcl_notification_activated'));
610 } else {
611 $lg->addCustomCommandButton(
612 $this->ui_factory->button()->shy(
613 $this->lng->txt('dcl_notification_activate'),
614 $this->ctrl->getLinkTarget($this, 'activateNotification')
615 )
616 );
617 $lg->addHeaderIcon('not_icon', ilUtil::getImagePath('object/notification_off.svg'), $this->lng->txt('dcl_notification_deactivated'));
618 }
619 $this->ctrl->setParameter($this, 'ntf', '');
620 }
621
622 $this->tpl->setHeaderActionMenu($lg->getHeaderAction());
623 }
624
625 protected function getNotificationModal(): RoundTrip
626 {
627 return $this->ui_factory->modal()->roundtrip(
628 $this->lng->txt('dcl_notification_settings'),
629 null,
630 [
631 ilDclNotificationType::RECORD_CREATE->value => $this->ui_factory->input()->field()->checkbox($this->lng->txt('dcl_new_entries'))
632 ->withValue($this->notification_settings->has($this->object, $this->user->getId(), ilDclNotificationType::RECORD_CREATE)),
633 ilDclNotificationType::RECORD_UPDATE->value => $this->ui_factory->input()->field()->checkbox($this->lng->txt('dcl_updated_entries'))
634 ->withValue($this->notification_settings->has($this->object, $this->user->getId(), ilDclNotificationType::RECORD_UPDATE)),
635 ilDclNotificationType::RECORD_DELETE->value => $this->ui_factory->input()->field()->checkbox($this->lng->txt('dcl_deleted_entries'))
636 ->withValue($this->notification_settings->has($this->object, $this->user->getId(), ilDclNotificationType::RECORD_DELETE)),
637 ],
638 $this->ctrl->getLinkTarget($this, 'editNotification')
639 );
640 }
641}
error(string $a_errmsg)
Class ilCommonActionDispatcherGUI.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Class ilCtrl provides processing control methods.
static getTableCache(?int $table_id=null)
@ilCtrl_Calls ilDclDetailedViewGUI: ilDclDetailedViewDefinitionGUI, ilEditClipboardGUI,...
@ilCtrl_Calls ilDclTableListGUI: ilDclFieldListGUI, ilDclFieldEditGUI, ilDclTableViewGUI,...
Export User Interface Class.
Class ilInfoScreenGUI.
language handling
static setNotification(int $type, int $user_id, int $id, bool $status=true)
Set notification status for object and user.
static hasNotification(int $type, int $user_id, int $id)
Check notification status for object and user.
static hasWriteAccess(int $ref, ?int $user_id=0)
@ilCtrl_Calls ilObjDataCollectionGUI: ilInfoScreenGUI, ilNoteGUI, ilCommonActionDispatcherGUI @ilCtrl...
addLocatorItems()
Functions to be overwritten.
setTabs()
create tabs (repository/workspace switch)
addTab(string $langKey, string $link)
__construct(int $a_id=0, int $a_id_type=self::REPOSITORY_NODE_ID, int $a_parent_node_id=0)
addHeaderAction()
Add header action menu.
handleExport(bool $do_default=false)
getType()
Functions that must be overwritten.
afterSave(ilObject $new_object)
Post (successful) object creation hook.
Class ilObjFile.
New implementation of ilObjectGUI.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
prepareOutput(bool $show_sub_objects=true)
GUI class for the workflow of copying objects.
static prepareJsLinks(string $redraw_url, string $notes_url, string $tags_url, ?ilGlobalTemplateInterface $tpl=null)
Insert js/ajax links into template.
Class ilObjectMetaDataGUI.
Class ilObject Basic functions for all objects.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
const ANONYMOUS_USER_ID
Definition: constants.php:27
$info
Definition: entry_point.php:21
This describes commonalities between all forms.
Definition: Form.php:34
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26