ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilCalendarCategoryGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21use ILIAS\HTTP\Services as HttpServices;
22use ILIAS\Refinery\Factory as RefineryFactory;
23
31{
32 protected const SEARCH_USER = 1;
33 protected const SEARCH_ROLE = 2;
34
35 private int $user_id = 0;
36 private int $ref_id = 0;
37 private int $obj_id = 0;
38 private bool $editable = false;
39 private bool $visible = false;
40 private bool $importable = false;
41 private int $category_id = 0;
42
43 protected ?ilPropertyFormGUI $form = null;
44
45 protected ilDate $seed;
47
49 protected ilLanguage $lng;
50 protected ilTabsGUI $tabs;
52 protected ilObjUser $user;
54 protected ilHelpGUI $help;
57 protected ilTree $tree;
58 protected HttpServices $http;
59 protected RefineryFactory $refinery;
60
61
65 public function __construct(int $a_user_id, ilDate $seed, int $a_ref_id = 0)
66 {
67 global $DIC;
68
69 $this->lng = $DIC->language();
70 $this->lng->loadLanguageModule('dateplaner');
71 $this->lng->loadLanguageModule('dash');
72 $this->ctrl = $DIC->ctrl();
73 $this->tpl = $DIC->ui()->mainTemplate();
74 $this->user = $DIC->user();
75 $this->toolbar = $DIC->toolbar();
76 $this->help = $DIC->help();
77 $this->access = $DIC->access();
78 $this->rbacsystem = $DIC->rbac()->system();
79 $this->tree = $DIC->repositoryTree();
80 $this->tabs = $DIC->tabs();
81 $this->user_id = $a_user_id;
82 $this->seed = $seed;
83 $this->ref_id = $a_ref_id;
84 $this->obj_id = ilObject::_lookupObjId($a_ref_id);
85 $this->http = $DIC->http();
86 $this->refinery = $DIC->refinery();
87
88 if (
89 in_array($this->ctrl->getNextClass(), array("", "ilcalendarcategorygui")) &&
90 $this->ctrl->getCmd() == "manage") {
91 if ($a_ref_id > 0) { // no manage screen in repository
92 $this->ctrl->returnToParent($this);
93 }
94 if ($this->initCategoryIdFromQuery() > 0) {
95 // reset category id on manage screen (redirect needed to initialize categories correctly)
96 $this->ctrl->setParameter($this, "category_id", "");
97 $this->ctrl->setParameterByClass("ilcalendarpresentationgui", "category_id", "");
98 $this->ctrl->redirect($this, "manage");
99 }
100 }
101 $this->category_id = $this->initCategoryIdFromQuery();
102 $this->actions = ilCalendarActions::getInstance();
103 }
104
105 protected function initCategoryIdFromQuery(): int
106 {
107 if ($this->http->wrapper()->query()->has('category_id')) {
108 return $this->http->wrapper()->query()->retrieve(
109 'category_id',
110 $this->refinery->kindlyTo()->int()
111 );
112 }
113 return 0;
114 }
115
119 protected function initSelectedCategoryIdsFromPost(): array
120 {
121 if ($this->http->wrapper()->post()->has('selected_cat_ids')) {
122 return $this->http->wrapper()->post()->retrieve(
123 'selected_cat_ids',
124 $this->refinery->kindlyTo()->dictOf(
125 $this->refinery->kindlyTo()->int()
126 )
127 );
128 }
129 return [];
130 }
131
132 public function executeCommand(): void
133 {
134 $next_class = $this->ctrl->getNextClass($this);
135 $this->ctrl->saveParameter($this, 'category_id');
136 $this->ctrl->setParameter($this, 'seed', $this->seed->get(IL_CAL_DATE));
137
138 if ($this->http->wrapper()->query()->has('backvm')) {
139 $this->ctrl->setParameter($this, 'backvm', 1);
140 }
141 switch ($next_class) {
142 case 'ilcalendarappointmentgui':
143 $this->ctrl->setReturn($this, 'details');
144
145 $app_id = 0;
146 if ($this->http->wrapper()->query()->has('app_id')) {
147 $app_id = $this->http->wrapper()->query()->retrieve(
148 'app_id',
149 $this->refinery->kindlyTo()->int()
150 );
151 }
152 $app = new ilCalendarAppointmentGUI($this->seed, $this->seed, $app_id);
153 $this->ctrl->forwardCommand($app);
154 break;
155
156 default:
157 $cmd = $this->ctrl->getCmd("show");
158 $this->$cmd();
159 if (!in_array($cmd, array("details", "askDeleteAppointments", "deleteAppointments"))) {
160 return;
161 }
162 }
163 }
164
165 protected function cancel(): void
166 {
167 if ($this->http->wrapper()->query()->has('backvm')) {
168 $this->ctrl->redirect($this, 'manage');
169 }
170 $this->ctrl->returnToParent($this);
171 }
172
173 protected function add(?ilPropertyFormGUI $form = null): void
174 {
175 $this->tabs->clearTargets();
176 $this->tabs->setBackTarget($this->lng->txt("cal_back_to_list"), $this->ctrl->getLinkTarget($this, 'cancel'));
177
178 $ed_tpl = new ilTemplate('tpl.edit_category.html', true, true, 'components/ILIAS/Calendar');
179
180 if (!$form instanceof ilPropertyFormGUI) {
181 $form = $this->initFormCategory('create');
182 }
183 $ed_tpl->setVariable('EDIT_CAT', $form->getHTML());
184 $this->tpl->setContent($ed_tpl->get());
185 }
186
187 protected function save(): void
188 {
189 $form = $this->initFormCategory('create');
190 if ($form->checkInput()) {
191 $category = new ilCalendarCategory(0);
192 $category->setTitle($form->getInput('title'));
193 $category->setColor('#' . $form->getInput('color'));
194 $category->setLocationType((int) $form->getInput('type_rl'));
195 $category->setRemoteUrl(trim($form->getInput('remote_url')));
196 $category->setRemoteUser($form->getInput('remote_user'));
197 $category->setRemotePass($form->getInput('remote_pass'));
199 $category->setType((int) $form->getInput('type'));
200 $category->setObjId(0);
201 } else {
202 $category->setType(ilCalendarCategory::TYPE_USR);
203 $category->setObjId($GLOBALS['DIC']->user()->getId());
204 }
205 $category->add();
206 } else {
207 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('err_check_input'));
208 $form->setValuesByPost();
209 $this->add($form);
210 return;
211 }
212
213 // try sync
214 try {
215 if ($category->getLocationType() == ilCalendarCategory::LTYPE_REMOTE) {
216 $this->doSynchronisation($category);
217 }
218 } catch (Exception $e) {
219 // Delete calendar if creation failed
220 $category->delete();
221 $this->tpl->setOnScreenMessage('failure', $e->getMessage());
223 $this->add($form);
224 if (!$e instanceof ilCurlConnectionException) {
225 throw $e;
226 }
227 return;
228 }
229
230 $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
231 $this->ctrl->redirect($this, 'manage');
232 }
233
234 protected function edit(?ilPropertyFormGUI $form = null): void
235 {
236 $this->tabs->activateTab("edit");
237 $this->readPermissions();
238
239 if (!$this->category_id) {
240 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
241 $this->ctrl->returnToParent($this);
242 }
243
244 if (!$this->actions->checkSettingsCal($this->category_id)) {
245 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('permission_denied'), true);
246 $this->ctrl->returnToParent($this);
247 }
248
249 if (!$form instanceof ilPropertyFormGUI) {
250 $form = $this->initFormCategory('edit');
251 }
252 $this->tpl->setContent($form->getHTML());
253 }
254
255 protected function details(): void
256 {
257 if (!$this->category_id) {
258 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
259 $this->ctrl->returnToParent($this);
260 }
261
262 $this->readPermissions();
263 $this->checkVisible();
264
265 // Non editable category
266 $info = new ilInfoScreenGUI($this);
267 $info->setFormAction($this->ctrl->getFormAction($this));
268
269 $info->addSection($this->lng->txt('cal_cal_details'));
270
271 $this->tpl->setContent($info->getHTML() . $this->showAssignedAppointments());
272 }
273
274 protected function synchroniseCalendar(): void
275 {
276 if (!$this->category_id) {
277 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
278 $this->ctrl->returnToParent($this);
279 }
280 $category = new ilCalendarCategory($this->category_id);
281 try {
282 $this->doSynchronisation($category);
283 } catch (Exception $e) {
284 $this->tpl->setOnScreenMessage('failure', $e->getMessage(), true);
285 $this->ctrl->redirect($this, 'manage');
286 }
287 $this->tpl->setOnScreenMessage('success', $this->lng->txt('cal_cal_sync_success'), true);
288 $this->ctrl->redirect($this, 'manage');
289 }
290
291 protected function doSynchronisation(ilCalendarCategory $category): void
292 {
293 $remote = new ilCalendarRemoteReader($category->getRemoteUrl());
294 $remote->setUser($category->getRemoteUser());
295 $remote->setPass($category->getRemotePass());
296 $remote->read();
297 $remote->import($category);
298 }
299
300 protected function update(): void
301 {
302 if (!$this->category_id) {
303 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
304 $this->ctrl->returnToParent($this);
305 }
306 $this->readPermissions();
307 if (!$this->isEditable()) {
308 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('permission_denied'));
309 $this->edit();
310 return;
311 }
312
313 $form = $this->initFormCategory('edit');
314 if ($form->checkInput()) {
315 $category = new ilCalendarCategory($this->category_id);
316 if ($category->getType() != ilCalendarCategory::TYPE_OBJ) {
317 $category->setTitle($form->getInput('title'));
318 }
319 $category->setColor('#' . $form->getInput('color'));
320 $category->update();
321 $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
322 if ($this->ref_id > 0) {
323 $this->ctrl->returnToParent($this);
324 } else {
325 $this->ctrl->redirect($this, "manage");
326 }
327 } else {
329 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('err_check_input'));
330 $this->edit($form);
331 }
332 }
333
334 protected function confirmDelete(): void
335 {
336 $cat_ids = $this->initSelectedCategoryIdsFromPost();
337 if (
338 !count($cat_ids) &&
339 $this->initCategoryIdFromQuery() > 0
340 ) {
341 $cat_ids = [$this->initCategoryIdFromQuery()];
342 }
343 if (!count($cat_ids)) {
344 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
345 $this->manage();
346 }
347 $confirmation_gui = new ilConfirmationGUI();
348 $confirmation_gui->setFormAction($this->ctrl->getFormAction($this));
349 $confirmation_gui->setHeaderText($this->lng->txt('cal_del_cal_sure'));
350 $confirmation_gui->setConfirm($this->lng->txt('delete'), 'delete');
351 $confirmation_gui->setCancel($this->lng->txt('cancel'), 'manage');
352
353 foreach ($cat_ids as $cat_id) {
354 $category = new ilCalendarCategory($cat_id);
355 $confirmation_gui->addItem('category_id[]', (string) $cat_id, $category->getTitle());
356 }
357 $this->tpl->setContent($confirmation_gui->getHTML());
358 }
359
360 protected function delete(): void
361 {
362 $category_ids = [];
363 if ($this->http->wrapper()->post()->has('category_id')) {
364 $category_ids = $this->http->wrapper()->post()->retrieve(
365 'category_id',
366 $this->refinery->kindlyTo()->dictOf(
367 $this->refinery->kindlyTo()->int()
368 )
369 );
370 }
371
372 if (!count($category_ids)) {
373 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
374 $this->ctrl->redirect($this, 'manage');
375 }
376
377 foreach ($category_ids as $cat_id) {
378 $category = new ilCalendarCategory((int) $cat_id);
379 $category->delete();
380 }
381
382 $this->tpl->setOnScreenMessage('success', $this->lng->txt('cal_cal_deleted'), true);
383 $this->ctrl->redirect($this, 'manage');
384 }
385
386 public function saveSelection(): void
387 {
388 $selected_cat_ids = $this->initSelectedCategoryIdsFromPost();
389 $shown_cat_ids = [];
390 if ($this->http->wrapper()->post()->has('shown_cat_ids')) {
391 $shown_cat_ids = $this->http->wrapper()->post()->retrieve(
392 'shown_cat_ids',
393 $this->refinery->kindlyTo()->dictOf(
394 $this->refinery->kindlyTo()->int()
395 )
396 );
397 }
398 $cats = ilCalendarCategories::_getInstance($this->user->getId());
399 $cat_ids = $cats->getCategories();
400
401 $cat_visibility = ilCalendarVisibility::_getInstanceByUserId($this->user->getId(), $this->ref_id);
402 if ($this->obj_id > 0) {
403 $old_selection = $cat_visibility->getVisible();
404 } else {
405 $old_selection = $cat_visibility->getHidden();
406 }
407
408 $new_selection = [];
409 // put all entries from the old selection into the new one
410 // that are not presented on the screen
411 foreach ($old_selection as $cat_id) {
412 if (!in_array($cat_id, $shown_cat_ids)) {
413 $new_selection[] = $cat_id;
414 }
415 }
416 foreach ($shown_cat_ids as $shown_cat_id) {
417 $shown_cat_id = (int) $shown_cat_id;
418 if ($this->obj_id > 0) {
419 if (in_array($shown_cat_id, $selected_cat_ids)) {
420 $new_selection[] = $shown_cat_id;
421 }
422 } else {
423 if (!in_array($shown_cat_id, $selected_cat_ids)) {
424 $new_selection[] = $shown_cat_id;
425 }
426 }
427 }
428
429 if ($this->obj_id > 0) {
430 $cat_visibility->showSelected($new_selection);
431 } else {
432 $cat_visibility->hideSelected($new_selection);
433 }
434 $cat_visibility->save();
435
436 $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
437 $this->ctrl->returnToParent($this);
438 }
439
440 public function shareSearch(): void
441 {
442 $this->tabs->activateTab("share");
443
444 if (!$this->category_id) {
445 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
446 $this->ctrl->returnToParent($this);
447 }
448
449 $this->readPermissions();
450 if (!$this->isEditable()) {
451 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('permission_denied'));
452 $this->manage();
453 return;
454 }
455
456 ilSession::clear('cal_query');
457 $this->ctrl->saveParameter($this, 'category_id');
458 $table = new ilCalendarSharedListTableGUI($this, 'shareSearch');
459 $table->setTitle($this->lng->txt('cal_cal_shared_with'));
460 $table->setCalendarId($this->category_id);
461 $table->parse();
462
463 $this->getSearchToolbar();
464 $this->tpl->setContent($table->getHTML());
465 }
466
467 public function sharePerformSearch(): void
468 {
469 $this->tabs->activateTab("share");
470 $this->lng->loadLanguageModule('search');
471
472 if (!$this->category_id) {
473 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
474 $this->ctrl->returnToParent($this);
475 }
476 $this->ctrl->saveParameter($this, 'category_id');
477
478 $query = '';
479 $type = '';
480 if ($this->http->wrapper()->post()->has('query')) {
481 $query = $this->http->wrapper()->post()->retrieve(
482 'query',
483 $this->refinery->kindlyTo()->string()
484 );
485 $type = $this->http->wrapper()->post()->retrieve(
486 'query_type',
487 $this->refinery->kindlyTo()->int()
488 );
489 ilSession::set('cal_query', $query);
490 ilSession::set('cal_type', $type);
491 } else {
492 $query = (string) ilSession::get('cal_query');
493 $type = (int) ilSession::get('cal_type');
494 }
495 if ($query === '') {
496 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('msg_no_search_string'));
497 $this->shareSearch();
498 return;
499 }
500
501 $res_sum = new ilSearchResult();
502
503 $query_parser = new ilQueryParser(ilUtil::stripSlashes($query));
504 $query_parser->setCombination(ilQueryParser::QP_COMBINATION_OR);
505 $query_parser->setMinWordLength(3);
506 $query_parser->parse();
507
508 switch ($type) {
510 $search = ilObjectSearchFactory::_getUserSearchInstance($query_parser);
511 $search->enableActiveCheck(true);
512
513 $search->setFields(array('login'));
514 $res = $search->performSearch();
515 $res_sum->mergeEntries($res);
516
517 $search->setFields(array('firstname'));
518 $res = $search->performSearch();
519 $res_sum->mergeEntries($res);
520
521 $search->setFields(array('lastname'));
522 $res = $search->performSearch();
523 $res_sum->mergeEntries($res);
524
525 $res_sum->filter(ROOT_FOLDER_ID, false);
526 break;
527
529
530 $search = new ilLikeObjectSearch($query_parser);
531 $search->setFilter(array('role'));
532
533 $res = $search->performSearch();
534 $res_sum->mergeEntries($res);
535
536 $res_sum->filter(ROOT_FOLDER_ID, false);
537 break;
538 }
539
540 if (!count($res_sum->getResults())) {
541 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('search_no_match'));
542 $this->shareSearch();
543 return;
544 }
545
546 switch ($type) {
548 $this->showUserList($res_sum->getResultIds());
549 break;
550
552 $this->showRoleList($res_sum->getResultIds());
553 break;
554 }
555
556 $this->getSearchToolbar();
557 }
558
562 public function shareAssignEditable(): void
563 {
564 $this->shareAssign(true);
565 }
566
567 public function shareAssign($a_editable = false): void
568 {
569 if (!$this->category_id) {
570 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
571 $this->ctrl->returnToParent($this);
572 }
573 $user_ids = [];
574 if ($this->http->wrapper()->post()->has('user_ids')) {
575 $user_ids = $this->http->wrapper()->post()->retrieve(
576 'user_ids',
577 $this->refinery->kindlyTo()->dictOf(
578 $this->refinery->kindlyTo()->int()
579 )
580 );
581 }
582 if (!count($user_ids)) {
583 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'));
584 $this->sharePerformSearch();
585 return;
586 }
587
588 $this->readPermissions();
589 if (!$this->isEditable()) {
590 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('permission_denied'));
591 $this->shareSearch();
592 return;
593 }
594
595 $shared = new ilCalendarShared($this->category_id);
596
597 foreach ($user_ids as $user_id) {
598 if ($this->user->getId() != $user_id) {
599 $shared->share($user_id, ilCalendarShared::TYPE_USR, $a_editable);
600 }
601 }
602 $this->tpl->setOnScreenMessage('success', $this->lng->txt('cal_shared_selected_usr'));
603 $this->shareSearch();
604 }
605
606 protected function shareAssignRolesEditable(): void
607 {
608 $this->shareAssignRoles(true);
609 }
610
611 public function shareAssignRoles(bool $a_editable = false): void
612 {
613 if (!$this->category_id) {
614 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
615 $this->ctrl->returnToParent($this);
616 }
617
618 $role_ids = [];
619 if ($this->http->wrapper()->post()->has('role_ids')) {
620 $role_ids = $this->http->wrapper()->post()->retrieve(
621 'role_ids',
622 $this->refinery->kindlyTo()->dictOf(
623 $this->refinery->kindlyTo()->int()
624 )
625 );
626 }
627
628 if (!count($role_ids)) {
629 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'));
630 $this->sharePerformSearch();
631 return;
632 }
633
634 $this->readPermissions();
635 if (!$this->isEditable()) {
636 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('permission_denied'));
637 $this->shareSearch();
638 return;
639 }
640
641 $shared = new ilCalendarShared($this->category_id);
642
643 foreach ($role_ids as $role_id) {
644 $shared->share($role_id, ilCalendarShared::TYPE_ROLE, $a_editable);
645 }
646 $this->tpl->setOnScreenMessage('success', $this->lng->txt('cal_shared_selected_usr'));
647 $this->shareSearch();
648 }
649
650 public function shareDeassign(): void
651 {
652 if (!$this->category_id) {
653 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
654 $this->ctrl->returnToParent($this);
655 }
656 $obj_ids = [];
657 if ($this->http->wrapper()->post()->has('obj_ids')) {
658 $obj_ids = $this->http->wrapper()->post()->retrieve(
659 'obj_ids',
660 $this->refinery->kindlyTo()->dictOf(
661 $this->refinery->kindlyTo()->int()
662 )
663 );
664 }
665
666 if (!count($obj_ids)) {
667 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'));
668 $this->shareSearch();
669 return;
670 }
671
672 $this->readPermissions();
673 if (!$this->isEditable()) {
674 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('permission_denied'));
675 $this->shareSearch();
676 return;
677 }
678
679 $shared = new ilCalendarShared($this->category_id);
680
681 foreach ($obj_ids as $obj_id) {
682 $shared->stopSharing($obj_id);
683 }
684 $this->tpl->setOnScreenMessage('success', $this->lng->txt('cal_unshared_selected_usr'));
685 $this->shareSearch();
686 }
687
688 protected function showUserList(array $a_ids = array()): void
689 {
690 $table = new ilCalendarSharedUserListTableGUI($this, 'sharePerformSearch');
691 $table->setTitle($this->lng->txt('cal_share_search_usr_header'));
692 $table->setFormAction($this->ctrl->getFormAction($this));
693 $table->setUsers($a_ids);
694 $table->parse();
695 $this->tpl->setContent($table->getHTML());
696 }
697
698 protected function showRoleList(array $a_ids = array()): void
699 {
700 $table = new ilCalendarSharedRoleListTableGUI($this, 'sharePerformSearch');
701 $table->setTitle($this->lng->txt('cal_share_search_role_header'));
702 $table->setFormAction($this->ctrl->getFormAction($this));
703 $table->setRoles($a_ids);
704 $table->parse();
705
706 $this->tpl->setContent($table->getHTML());
707 }
708
709 public function getSearchToolbar(): void
710 {
711 $this->lng->loadLanguageModule('search');
712 $this->toolbar->setFormAction($this->ctrl->getFormAction($this));
713
714 $query = '';
715 if ($this->http->wrapper()->post()->has('query')) {
716 $query = $this->http->wrapper()->post()->retrieve(
717 'query',
718 $this->refinery->kindlyTo()->string()
719 );
720 }
721 $query_type = '';
722 if ($this->http->wrapper()->post()->has('query_type')) {
723 $query_type = $this->http->wrapper()->post()->retrieve(
724 'query_type',
725 $this->refinery->kindlyTo()->string()
726 );
727 }
728 // search term
729 $search = new ilTextInputGUI($this->lng->txt('cal_search'), 'query');
730 $search->setValue($query);
731 $search->setSize(16);
732 $search->setMaxLength(128);
733
734 $this->toolbar->addInputItem($search, true);
735
736 // search type
737 $options = array(
738 self::SEARCH_USER => $this->lng->txt('obj_user'),
739 self::SEARCH_ROLE => $this->lng->txt('obj_role'),
740 );
741 $si = new ilSelectInputGUI($this->lng->txt('search_type'), "query_type");
742 $si->setValue($query_type);
743 $si->setOptions($options);
744 $si->setInfo($this->lng->txt(""));
745 $this->toolbar->addInputItem($si);
746 $this->toolbar->addFormButton($this->lng->txt('search'), "sharePerformSearch");
747 }
748
749 protected function initFormCategory(string $a_mode): ilPropertyFormGUI
750 {
751 $this->help->setScreenIdComponent("cal");
752 $this->help->setScreenId("cal");
753 if ($a_mode == "edit") {
754 $this->help->setSubScreenId("edit");
755 } else {
756 $this->help->setSubScreenId("create");
757 }
758
759 $cat_info = ilCalendarCategories::_getInstance()->getCategoryInfo($this->category_id);
760
761 $this->form = new ilPropertyFormGUI();
762 $category = new ilCalendarCategory();
763 switch ($a_mode) {
764 case 'edit':
765 $category = new ilCalendarCategory($this->category_id);
766 $this->form->setTitle($this->lng->txt('cal_edit_category'));
767 $this->ctrl->saveParameter($this, array('seed', 'category_id'));
768 $this->form->setFormAction($this->ctrl->getFormAction($this));
769 if ($this->isEditable()) {
770 $this->form->addCommandButton('update', $this->lng->txt('save'));
771
772 /*
773 if($cat_info['type'] == ilCalendarCategory::TYPE_USR)
774 {
775 $this->form->addCommandButton('shareSearch',$this->lng->txt('cal_share'));
776 }
777 $this->form->addCommandButton('confirmDelete',$this->lng->txt('delete'));
778 */
779 }
780 break;
781 case 'create':
782 $this->editable = true;
783 $category = new ilCalendarCategory(0);
784 $this->ctrl->saveParameter($this, array('category_id'));
785 $this->form->setFormAction($this->ctrl->getFormAction($this));
786 $this->form->setTitle($this->lng->txt('cal_add_category'));
787 $this->form->addCommandButton('save', $this->lng->txt('save'));
788 break;
789 }
790
791 $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
792
793 // Calendar name
794 $title = new ilTextInputGUI($this->lng->txt('cal_calendar_name'), 'title');
795 if ($a_mode == 'edit') {
796 if (!$this->isEditable() || $category->getType() == ilCalendarCategory::TYPE_OBJ) {
797 $title->setDisabled(true);
798 }
799 }
800 $title->setRequired(true);
801 $title->setMaxLength(64);
802 $title->setSize(32);
803 $title->setValue($category->getTitle());
804 $this->form->addItem($title);
805
806 if ($a_mode == 'create' and $this->rbacsystem->checkAccess(
807 'edit_event',
808 ilCalendarSettings::_getInstance()->getCalendarSettingsId()
809 )) {
810 $type = new ilRadioGroupInputGUI($this->lng->txt('cal_cal_type'), 'type');
811 $type->setValue((string) $category->getType());
812 $type->setRequired(true);
813
814 $opt = new ilRadioOption($this->lng->txt('cal_type_personal'), (string) ilCalendarCategory::TYPE_USR);
815 $type->addOption($opt);
816
817 $opt = new ilRadioOption($this->lng->txt('cal_type_system'), (string) ilCalendarCategory::TYPE_GLOBAL);
818 $type->addOption($opt);
819 $type->setInfo($this->lng->txt('cal_type_info'));
820 $this->form->addItem($type);
821 }
822
823 // color
824 $color = new ilColorPickerInputGUI($this->lng->txt('cal_calendar_color'), 'color');
825 $color->setValue($category->getColor());
826 if (!$this->isEditable()) {
827 $color->setDisabled(true);
828 }
829 $color->setRequired(true);
830 $this->form->addItem($color);
831
832 $location = new ilRadioGroupInputGUI($this->lng->txt('cal_type_rl'), 'type_rl');
833 $location->setDisabled($a_mode == 'edit');
834 $location_local = new ilRadioOption(
835 $this->lng->txt('cal_type_local'),
837 );
838 $location->addOption($location_local);
839 $location_remote = new ilRadioOption(
840 $this->lng->txt('cal_type_remote'),
842 );
843 $location->addOption($location_remote);
844 $location->setValue((string) $category->getLocationType());
845
846 $url = new ilTextInputGUI($this->lng->txt('cal_remote_url'), 'remote_url');
847 $url->setDisabled($a_mode == 'edit');
848 $url->setValue($category->getRemoteUrl());
849 $url->setMaxLength(500);
850 $url->setSize(60);
851 $url->setRequired(true);
852 $location_remote->addSubItem($url);
853
854 $user = new ilTextInputGUI($this->lng->txt('username'), 'remote_user');
855 $user->setDisabled($a_mode == 'edit');
856 $user->setValue($category->getRemoteUser());
857 $user->setMaxLength(50);
858 $user->setSize(20);
859 $user->setRequired(false);
860 $location_remote->addSubItem($user);
861
862 $pass = new ilPasswordInputGUI($this->lng->txt('password'), 'remote_pass');
863 $pass->setDisabled($a_mode == 'edit');
864 $pass->setValue($category->getRemotePass());
865 $pass->setMaxLength(50);
866 $pass->setSize(20);
867 $pass->setRetype(false);
868 $pass->setInfo($this->lng->txt('remote_pass_info'));
869 $location_remote->addSubItem($pass);
870
871 // permalink
872 if ($a_mode == "edit" && $category->getType() == ilCalendarCategory::TYPE_OBJ) {
873 $ne = new ilNonEditableValueGUI($this->lng->txt("perma_link"), "", true);
874 $ne->setValue($this->addReferenceLinks($category->getObjId()));
875 $this->form->addItem($ne);
876 }
877
878 // owner
879 if ($a_mode == "edit" && $category->getType() == ilCalendarCategory::TYPE_USR) {
880 $ne = new ilNonEditableValueGUI($this->lng->txt("cal_owner"), "", true);
881 $ne->setValue(ilUserUtil::getNamePresentation($category->getObjId()));
882 $this->form->addItem($ne);
883 }
884
885 $this->form->addItem($location);
886 return $this->form;
887 }
888
889 protected function unshare(): void
890 {
891 if (!$this->category_id) {
892 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
893 $this->ctrl->returnToParent($this);
894 }
895
896 $this->readPermissions();
897 $this->checkVisible();
898
899 $status = new ilCalendarSharedStatus($this->user->getId());
900
901 if (!ilCalendarShared::isSharedWithUser($this->user->getId(), $this->category_id)) {
902 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('permission_denied'), true);
903 $this->ctrl->returnToParent($this);
904 return;
905 }
906 $status->decline($this->category_id);
907
908 $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
909 $this->ctrl->redirect($this, 'manage');
910 }
911
912 protected function showAssignedAppointments(): string
913 {
914 $table_gui = new ilCalendarAppointmentsTableGUI($this, 'details', $this->category_id);
915 $table_gui->setTitle($this->lng->txt('cal_assigned_appointments'));
916 $table_gui->setAppointments(
918 ilCalendarCategories::_getInstance()->getSubitemCategories($this->category_id)
919 )
920 );
921 return $table_gui->getHTML();
922 }
923
924 protected function askDeleteAppointments(): void
925 {
926 $appointments = [];
927 if ($this->http->wrapper()->post()->has('appointments')) {
928 $appointments = $this->http->wrapper()->post()->retrieve(
929 'appointments',
930 $this->refinery->kindlyTo()->dictOf(
931 $this->refinery->kindlyTo()->int()
932 )
933 );
934 }
935 if (!count($appointments)) {
936 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'));
937 $this->details();
938 return;
939 }
940
941 $confirmation_gui = new ilConfirmationGUI();
942 $this->ctrl->setParameter($this, 'category_id', $this->category_id);
943 $confirmation_gui->setFormAction($this->ctrl->getFormAction($this));
944 $confirmation_gui->setHeaderText($this->lng->txt('cal_del_app_sure'));
945 $confirmation_gui->setConfirm($this->lng->txt('delete'), 'deleteAppointments');
946 $confirmation_gui->setCancel($this->lng->txt('cancel'), 'details');
947
948 foreach ($appointments as $app_id) {
949 $app = new ilCalendarEntry($app_id);
950 $confirmation_gui->addItem('appointments[]', (string) $app_id, $app->getTitle());
951 }
952 $this->tpl->setContent($confirmation_gui->getHTML());
953 }
954
955 protected function deleteAppointments(): void
956 {
957 $appointments = [];
958 if ($this->http->wrapper()->post()->has('appointments')) {
959 $appointments = $this->http->wrapper()->post()->retrieve(
960 'appointments',
961 $this->refinery->kindlyTo()->dictOf(
962 $this->refinery->kindlyTo()->int()
963 )
964 );
965 }
966 if (!count($appointments)) {
967 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'));
968 $this->details();
969 return;
970 }
971 foreach ($appointments as $app_id) {
972 $app = new ilCalendarEntry($app_id);
973 $app->delete();
975 }
976 $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'));
977 $this->details();
978 }
979
980 public function getHTML(): string
981 {
982 $block_gui = new ilCalendarSelectionBlockGUI($this->seed, $this->ref_id);
983 return $this->ctrl->getHTML($block_gui);
984 }
985
986 protected function appendCalendarSelection(): string
987 {
988 $this->lng->loadLanguageModule('pd');
989
990 $tpl = new ilTemplate('tpl.calendar_selection.html', true, true, 'components/ILIAS/Calendar');
991 switch (ilCalendarUserSettings::_getInstance()->getCalendarSelectionType()) {
993 $tpl->setVariable('HTEXT', $this->lng->txt('dash_memberships'));
994 $tpl->touchBlock('head_item');
995 $tpl->touchBlock('head_delim');
996 $tpl->touchBlock('head_item');
997
998 $this->ctrl->setParameter($this, 'calendar_mode', ilCalendarUserSettings::CAL_SELECTION_ITEMS);
999 $this->ctrl->setParameter($this, 'seed', $this->seed->get(IL_CAL_DATE));
1000 $tpl->setVariable('HHREF', $this->ctrl->getLinkTarget($this, 'switchCalendarMode'));
1001 $tpl->setVariable('HLINK', $this->lng->txt('dash_favourites'));
1002 $tpl->touchBlock('head_item');
1003 break;
1004
1006 $this->ctrl->setParameter($this, 'calendar_mode', ilCalendarUserSettings::CAL_SELECTION_MEMBERSHIP);
1007 $this->ctrl->setParameter($this, 'seed', $this->seed->get(IL_CAL_DATE));
1008 $tpl->setVariable('HHREF', $this->ctrl->getLinkTarget($this, 'switchCalendarMode'));
1009 $tpl->setVariable('HLINK', $this->lng->txt('dash_memberships'));
1010 $tpl->touchBlock('head_item');
1011 $tpl->touchBlock('head_delim');
1012 $tpl->touchBlock('head_item');
1013
1014 $tpl->setVariable('HTEXT', $this->lng->txt('dash_favourites'));
1015 $tpl->touchBlock('head_item');
1016 break;
1017 }
1018 return $tpl->get();
1019 }
1020
1021 protected function switchCalendarMode(): void
1022 {
1023 $mode = 0;
1024 if ($this->http->wrapper()->query()->has('calendar_mode')) {
1025 $mode = $this->http->wrapper()->query()->retrieve(
1026 'calendar_mode',
1027 $this->refinery->kindlyTo()->int()
1028 );
1029 }
1030 ilCalendarUserSettings::_getInstance()->setCalendarSelectionType($mode);
1032
1033 $this->ctrl->returnToParent($this);
1034 }
1035
1036 private function readPermissions(): void
1037 {
1038 $this->editable = false;
1039 $this->visible = false;
1040 $this->importable = false;
1041
1042 $shared = ilCalendarShared::getSharedCalendarsForUser($this->user->getId());
1043 $cat = new ilCalendarCategory($this->category_id);
1044
1045 switch ($cat->getType()) {
1047
1048 if ($cat->getObjId() == $this->user->getId()) {
1049 $this->visible = true;
1050 $this->editable = true;
1051 $this->importable = true;
1052 } elseif (isset($shared[$cat->getCategoryID()])) {
1053 $this->visible = true;
1054 $shared_cal = new ilCalendarShared($cat->getCategoryID());
1055 $this->editable = $shared_cal->isEditableForUser($this->user->getId());
1056 $this->importable = $shared_cal->isEditableForUser($this->user->getId());
1057 }
1058 break;
1059
1061 $this->importable = $this->editable = $this->rbacsystem->checkAccess(
1062 'edit_event',
1063 ilCalendarSettings::_getInstance()->getCalendarSettingsId()
1064 );
1065 $this->visible = true;
1066 break;
1067
1069 $this->editable = false;
1070
1071 $refs = ilObject::_getAllReferences($cat->getObjId());
1072 foreach ($refs as $ref) {
1073 if ($this->access->checkAccess('read', '', $ref)) {
1074 $this->visible = true;
1075 }
1076 if ($this->access->checkAccess('edit_event', '', $ref)) {
1077 $this->importable = true;
1078 }
1079 if ($this->access->checkAccess('write', '', $ref)) {
1080 $this->editable = true;
1081 }
1082 }
1083 break;
1084
1087 $this->editable = $this->user->getId() == $cat->getCategoryID();
1088 $this->visible = true;
1089 $this->importable = false;
1090 break;
1091 }
1092 }
1093
1094 protected function checkVisible(): void
1095 {
1096 global $DIC;
1097
1098 $ilErr = $DIC['ilErr'];
1099 if (!$this->visible) {
1100 $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->FATAL);
1101 }
1102 }
1103
1104 private function isEditable(): bool
1105 {
1106 return $this->editable;
1107 }
1108
1109 protected function isImportable(): bool
1110 {
1111 return $this->importable;
1112 }
1113
1114 protected function addReferenceLinks($a_obj_id): string
1115 {
1116 $tpl = new ilTemplate('tpl.cal_reference_links.html', true, true, 'components/ILIAS/Calendar');
1117
1118 foreach (ilObject::_getAllReferences($a_obj_id) as $ref_id => $ref_id) {
1119 $parent_ref_id = $this->tree->getParentId($ref_id);
1120 $parent_obj_id = ilObject::_lookupObjId($parent_ref_id);
1121 $parent_type = ilObject::_lookupType($parent_obj_id);
1122 $parent_title = ilObject::_lookupTitle($parent_obj_id);
1123
1124 $type = ilObject::_lookupType($a_obj_id);
1125 $title = ilObject::_lookupTitle($a_obj_id);
1126
1127 $tpl->setCurrentBlock('reference');
1128 $tpl->setVariable('PARENT_TITLE', $parent_title);
1129 $tpl->setVariable('PARENT_HREF', ilLink::_getLink($parent_ref_id));
1130 $tpl->setVariable('TITLE', $title);
1131 $tpl->setVariable('HREF', ilLink::_getLink($ref_id));
1133 }
1134 return $tpl->get();
1135 }
1136
1137 protected function manage($a_reset_offsets = false): void
1138 {
1139 $this->addSubTabs("manage");
1140
1141 $table_gui = new ilCalendarManageTableGUI($this);
1142
1143 if ($a_reset_offsets) {
1144 $table_gui->resetToDefaults();
1145 }
1146
1147 $table_gui->parse();
1148
1149 $toolbar = new ilToolbarGui();
1150 $this->ctrl->setParameter($this, 'backvm', 1);
1151 $toolbar->addButton($this->lng->txt("cal_add_calendar"), $this->ctrl->getLinkTarget($this, "add"));
1152
1153 $this->tpl->setContent($toolbar->getHTML() . $table_gui->getHTML());
1154 }
1155
1156 protected function importAppointments(?ilPropertyFormGUI $form = null): void
1157 {
1158 if (!$this->category_id) {
1159 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
1160 $this->ctrl->returnToParent($this);
1161 }
1162 $this->ctrl->setParameter($this, 'category_id', $this->category_id);
1163
1164 // Check permissions
1165 $this->readPermissions();
1166 $this->checkVisible();
1167
1168 if (!$this->isImportable()) {
1169 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('permission_denied'), true);
1170 $this->ctrl->returnToParent($this);
1171 }
1172
1173 $this->tabs->clearTargets();
1174 $this->tabs->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTarget($this, "cancel"));
1175
1176 if (!$form instanceof ilPropertyFormGUI) {
1177 $form = $this->initImportForm();
1178 }
1179 $this->tpl->setContent($form->getHTML());
1180 }
1181
1182 protected function initImportForm(): ilPropertyFormGUI
1183 {
1184 $form = new ilPropertyFormGUI();
1185 $form->setTitle($this->lng->txt('cal_import_tbl'));
1186 $form->setFormAction($this->ctrl->getFormAction($this));
1187 $form->addCommandButton('uploadAppointments', $this->lng->txt('import'));
1188
1189 $ics = new ilFileInputGUI($this->lng->txt('cal_import_file'), 'file');
1190 $ics->setAllowDeletion(false);
1191 $ics->setSuffixes(array('ics'));
1192 $ics->setInfo($this->lng->txt('cal_import_file_info'));
1193 $form->addItem($ics);
1194 return $form;
1195 }
1196
1197 protected function uploadAppointments(): void
1198 {
1199 $form = $this->initImportForm();
1200 if ($form->checkInput()) {
1201 $file = $form->getInput('file');
1202 $tmp = ilFileUtils::ilTempnam();
1203 ilFileUtils::moveUploadedFile($file['tmp_name'], $file['name'], $tmp);
1204 $num = $this->doImportFile($tmp, $this->initCategoryIdFromQuery());
1205 $this->tpl->setOnScreenMessage('success', sprintf($this->lng->txt('cal_imported_success'), $num), true);
1206 $this->ctrl->redirect($this, 'cancel');
1207 }
1208
1209 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('cal_err_file_upload'), true);
1210 $this->ctrl->returnToParent($this);
1211 }
1212
1213 protected function doImportFile($file, $category_id): int
1214 {
1216 $parser = new ilICalParser($file, ilICalParser::INPUT_FILE);
1217 $parser->setCategoryId($category_id);
1218 $parser->parse();
1220 return $assigned_after - $assigned_before;
1221 }
1222
1223 public function addSubTabs(string $a_active): void
1224 {
1225 $this->tabs->addSubTab(
1226 "manage",
1227 $this->lng->txt("calendar"),
1228 $this->ctrl->getLinkTarget($this, "manage")
1229 );
1230
1231 $status = new ilCalendarSharedStatus($this->user_id);
1232 $calendars = $status->getOpenInvitations();
1233
1234 $this->tabs->addSubTab(
1235 "invitations",
1236 $this->lng->txt("cal_shared_calendars"),
1237 $this->ctrl->getLinkTarget($this, "invitations")
1238 );
1239
1240 $this->tabs->activateSubTab($a_active);
1241 }
1242
1243 public function invitations(): void
1244 {
1245 $this->addSubTabs("invitations");
1246 $table = new ilCalendarInboxSharedTableGUI($this, 'inbox');
1247 $table->setCalendars(ilCalendarShared::getSharedCalendarsForUser());
1248 $this->tpl->setContent($table->getHTML());
1249 }
1250
1251 protected function acceptShared(): void
1252 {
1253 $cal_ids = [];
1254 if ($this->http->wrapper()->post()->has('cal_ids')) {
1255 $cal_ids = $this->http->wrapper()->post()->retrieve(
1256 'cal_ids',
1257 $this->refinery->kindlyTo()->dictOf(
1258 $this->refinery->kindlyTo()->int()
1259 )
1260 );
1261 }
1262 if (!count($cal_ids)) {
1263 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'));
1264 $this->ctrl->returnToParent($this);
1265 return;
1266 }
1267 $status = new ilCalendarSharedStatus($this->user->getId());
1268
1269 foreach ($cal_ids as $calendar_id) {
1270 if (!ilCalendarShared::isSharedWithUser($this->user->getId(), $calendar_id)) {
1271 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('permission_denied'));
1272 $this->ctrl->returnToParent($this);
1273 return;
1274 }
1275 $status->accept($calendar_id);
1276 }
1277 $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
1278 $this->ctrl->redirect($this, 'invitations');
1279 }
1280
1286 protected function declineShared(): void
1287 {
1288 $cal_ids = [];
1289 if ($this->http->wrapper()->post()->has('cal_ids')) {
1290 $cal_ids = $this->http->wrapper()->post()->retrieve(
1291 'cal_ids',
1292 $this->refinery->kindlyTo()->dictOf(
1293 $this->refinery->kindlyTo()->int()
1294 )
1295 );
1296 }
1297 if (!count($cal_ids)) {
1298 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
1299 $this->ctrl->returnToParent($this);
1300 return;
1301 }
1302 $status = new ilCalendarSharedStatus($this->user->getId());
1303 foreach ($cal_ids as $calendar_id) {
1304 if (!ilCalendarShared::isSharedWithUser($this->user->getId(), $calendar_id)) {
1305 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('permission_denied'), true);
1306 $this->ctrl->returnToParent($this);
1307 return;
1308 }
1309 $status->decline($calendar_id);
1310 }
1311 $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
1312 $this->ctrl->redirect($this, 'invitations');
1313 }
1314}
$location
Definition: buildRTE.php:22
Builds data types.
Definition: Factory.php:36
Class Services.
Definition: Services.php:38
const IL_CAL_DATE
Checks if certain actions can be performed.
static getInstance()
Get instance.
Administrate calendar appointments.
static _getInstance($a_usr_id=0)
get singleton instance
static _getAssignedAppointments(array $a_cat_id)
Get assigned apointments.
static _deleteByAppointmentId(int $a_app_id)
Delete appointment assignment.
Administration, Side-Block presentation of calendar categories.
showRoleList(array $a_ids=array())
ilGlobalTemplateInterface $tpl
add(?ilPropertyFormGUI $form=null)
__construct(int $a_user_id, ilDate $seed, int $a_ref_id=0)
Constructor.
declineShared()
accept shared calendar @access protected
importAppointments(?ilPropertyFormGUI $form=null)
shareAssignRoles(bool $a_editable=false)
shareAssignEditable()
Share with write access.
showUserList(array $a_ids=array())
doSynchronisation(ilCalendarCategory $category)
edit(?ilPropertyFormGUI $form=null)
Stores calendar categories.
Model for a calendar entry.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
show list of alle calendars to manage
Reader for remote ical calendars.
BlockGUI class calendar selection.
Stores status (accepted/declined) of shared calendars.
Handles shared calendars.
static getSharedCalendarsForUser(int $a_usr_id=0)
static isSharedWithUser(int $a_usr_id, int $a_calendar_id)
is shared with user
static _getInstanceByUserId(int $a_user_id, int $a_ref_id=0)
Color picker form for selecting color hexcodes using yui library.
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...
Class for single dates.
This class represents a file property in a property form.
static ilTempnam(?string $a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory.
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
setFormAction(string $a_formaction)
Help GUI class.
Class ilInfoScreenGUI.
language handling
This class represents a non editable value in a property form.
User class.
static _getUserSearchInstance(ilQueryParser $query_parser)
static _lookupType(int $id, bool $reference=false)
static _getAllReferences(int $id)
get all reference ids for object ID
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
This class represents a password property in a property form.
This class represents a property form user interface.
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
This class represents a property in a property form.
This class represents an option in a radio group.
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a selection list property in a property form.
static get(string $a_var)
static clear(string $a_var)
static set(string $a_var, $a_val)
Set a value.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
special template class to simplify handling of ITX/PEAR
This class represents a text property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addButton(string $a_txt, string $a_cmd, string $a_target="", ?int $a_acc_key=null, string $a_additional_attrs='', string $a_id="", string $a_class='submit')
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path=null)
Default behaviour is:
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
const ROOT_FOLDER_ID
Definition: constants.php:32
$info
Definition: entry_point.php:21
setVariable(string $variable, $value='')
Sets the given variable to the given value.
touchBlock(string $block)
overwrites ITX::touchBlock.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
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...
$res
Definition: ltiservices.php:69
static http()
Fetches the global http state from ILIAS.
form( $class_path, string $cmd, string $submit_caption="")
$ilErr
Definition: raiseError.php:33
global $DIC
Definition: shib_login.php:26
$url
Definition: shib_logout.php:68
$GLOBALS["DIC"]
Definition: wac.php:54