ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilObjPollGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22use ILIAS\UI\Factory as UIFactory;
23use ILIAS\UI\Renderer as UIRenderer;
24use ILIAS\Poll\Image\I\FactoryInterface as PollImageFactoryInterface;
25use ILIAS\Poll\Image\Factory as PollImageFactory;
26use ILIAS\Data\Factory as DataFactory;
27
37{
38 protected ilHelpGUI $help;
39 protected ilTabsGUI $tabs;
41 protected UIFactory $ui_factory;
42 protected UIRenderer $ui_renderer;
43 protected DataFactory $data_factory;
44 protected PollImageFactoryInterface $poll_image_factory;
45
46 public function __construct(int $a_id = 0, int $a_id_type = self::REPOSITORY_NODE_ID, int $a_parent_node_id = 0)
47 {
48 global $DIC;
49
50 $this->lng = $DIC->language();
51 $this->ctrl = $DIC->ctrl();
52 $this->help = $DIC["ilHelp"];
53 $this->tpl = $DIC["tpl"];
54 $this->tabs = $DIC->tabs();
55 $this->nav_history = $DIC["ilNavigationHistory"];
56 $this->toolbar = $DIC->toolbar();
57 $this->user = $DIC->user();
58 $this->tree = $DIC->repositoryTree();
59 $this->locator = $DIC["ilLocator"];
60 $this->ui_factory = $DIC->ui()->factory();
61 $this->ui_renderer = $DIC->ui()->renderer();
62 $this->poll_image_factory = new PollImageFactory();
63 $this->data_factory = new DataFactory();
64
65 parent::__construct($a_id, $a_id_type, $a_parent_node_id);
66
67 $this->lng->loadLanguageModule("poll");
68 }
69
70 public function getType(): string
71 {
72 return "poll";
73 }
74
75 protected function afterSave(ilObject $new_object): void
76 {
77 $this->tpl->setOnScreenMessage('success', $this->lng->txt("object_added"), true);
78 $this->ctrl->redirect($this, "render");
79 }
80
81 protected function initEditCustomForm(ilPropertyFormGUI $a_form): void
82 {
83 // activation
84 $this->lng->loadLanguageModule('rep');
85
86 $section = new ilFormSectionHeaderGUI();
87 $section->setTitle($this->lng->txt('rep_activation_availability'));
88 $a_form->addItem($section);
89
90 // additional info only with multiple references
91 $act_obj_info = $act_ref_info = "";
92 if (count(ilObject::_getAllReferences($this->object->getId())) > 1) {
93 $act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info');
94 $act_ref_info = $this->lng->txt('rep_activation_access_ref_info');
95 }
96
97 $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online');
98 $online->setInfo($this->lng->txt('poll_activation_online_info') . $act_obj_info);
99 $a_form->addItem($online);
100
101 $dur = new ilDateDurationInputGUI($this->lng->txt('rep_time_based_availability'), "access_period");
102 $dur->setShowTime(true);
103 $a_form->addItem($dur);
104
105
106 // period/results
107
108 $section = new ilFormSectionHeaderGUI();
109 $section->setTitle($this->lng->txt('poll_voting_period_and_results'));
110 $a_form->addItem($section);
111
112 $vdur = new ilDateDurationInputGUI($this->lng->txt('poll_voting_period_limited'), "voting_period");
113 $vdur->setShowTime(true);
114 $a_form->addItem($vdur);
115
116 $results = new ilRadioGroupInputGUI($this->lng->txt("poll_view_results"), "results");
117 $results->addOption(new ilRadioOption(
118 $this->lng->txt("poll_view_results_always"),
120 ));
121 $results->addOption(new ilRadioOption(
122 $this->lng->txt("poll_view_results_never"),
124 ));
125 $results->addOption(new ilRadioOption(
126 $this->lng->txt("poll_view_results_after_vote"),
128 ));
129 $results->addOption(new ilRadioOption(
130 $this->lng->txt("poll_view_results_after_period"),
132 ));
133 $a_form->addItem($results);
134
135 $show_result_as = new ilRadioGroupInputGUI($this->lng->txt("poll_show_results_as"), "show_results_as");
136 $result_bar = new ilRadioOption(
137 $this->lng->txt("poll_barchart"),
139 );
140 $show_result_as->addOption($result_bar);
141 $show_result_as->addOption(new ilRadioOption(
142 $this->lng->txt("poll_stacked_chart"),
144 ));
145 $a_form->addItem($show_result_as);
146
147 $sort = new ilRadioGroupInputGUI($this->lng->txt("poll_result_sorting"), "sort");
148 $sort->addOption(new ilRadioOption($this->lng->txt("poll_result_sorting_answers"), "0"));
149 $sort->addOption(new ilRadioOption($this->lng->txt("poll_result_sorting_votes"), "1"));
150 $a_form->addItem($sort);
151
152 $section = new ilFormSectionHeaderGUI();
153 $section->setTitle($this->lng->txt('poll_comments'));
154 $a_form->addItem($section);
155
156 $comment = new ilCheckboxInputGUI($this->lng->txt('poll_comments'), 'comment');
157 //$comment->setInfo($this->lng->txt('poll_comments_info'));
158 $a_form->addItem($comment);
159 }
160
161 protected function getEditFormCustomValues(array &$a_values): void
162 {
163 $a_values["online"] = !$this->object->getOfflineStatus();
164 $a_values["results"] = $this->object->getViewResults();
165 $a_values["access_period"]["start"] = $this->object->getAccessBegin()
166 ? new ilDateTime($this->object->getAccessBegin(), IL_CAL_UNIX)
167 : null;
168 $a_values["access_period"]["end"] = $this->object->getAccessEnd()
169 ? new ilDateTime($this->object->getAccessEnd(), IL_CAL_UNIX)
170 : null;
171 $a_values["voting_period"]["start"] = $this->object->getVotingPeriodBegin()
172 ? new ilDateTime($this->object->getVotingPeriodBegin(), IL_CAL_UNIX)
173 : null;
174 $a_values["voting_period"]["end"] = $this->object->getVotingPeriodEnd()
175 ? new ilDateTime($this->object->getVotingPeriodEnd(), IL_CAL_UNIX)
176 : null;
177 $a_values["sort"] = (string) (int) $this->object->getSortResultByVotes();
178 $a_values["comment"] = $this->object->getShowComments();
179 $a_values["show_results_as"] = $this->object->getShowResultsAs();
180 }
181
182 protected function validateCustom(ilPropertyFormGUI $form): bool
183 {
184 $valid = true;
185 if ($form->getInput("online") && !$this->object->getAnswers()) {
186 $form->getItemByPostVar("online")->setAlert($this->lng->txt("poll_cannot_set_online_no_answers"));
187 $valid = false;
188 }
189 #20594
190 if (!array_filter($form->getInput("voting_period")) &&
191 (int) $form->getInput("results") === ilObjPoll::VIEW_RESULTS_AFTER_PERIOD) {
192 $form->getItemByPostVar("results")->setAlert($this->lng->txt("poll_view_results_after_period_impossible"));
193 $valid = false;
194 }
195 if (!$valid) {
196 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("form_input_not_valid"));
197 return false;
198 }
199 return parent::validateCustom($form);
200 }
201
202 protected function updateCustom(ilPropertyFormGUI $form): void
203 {
204 $this->object->setViewResults((int) $form->getInput("results"));
205 $this->object->setOfflineStatus(!((string) $form->getInput("online") === "1"));
206 $this->object->setSortResultByVotes((bool) $form->getInput("sort"));
207 $this->object->setShowComments((bool) $form->getInput("comment"));
208 $this->object->setShowResultsAs((int) $form->getInput("show_results_as"));
209
210 $period = $form->getItemByPostVar("access_period");
211 if ($period->getStart() && $period->getEnd()) {
212 $this->object->setAccessType(ilObjectActivation::TIMINGS_ACTIVATION);
213 $this->object->setAccessBegin($period->getStart()->get(IL_CAL_UNIX));
214 $this->object->setAccessEnd($period->getEnd()->get(IL_CAL_UNIX));
215 } else {
216 $this->object->setAccessType(ilObjectActivation::TIMINGS_DEACTIVATED);
217 }
218
219 $period = $form->getItemByPostVar("voting_period");
220 if ($period->getStart() && $period->getEnd()) {
221 $this->object->setVotingPeriod(true);
222 $this->object->setVotingPeriodBegin($period->getStart()->get(IL_CAL_UNIX));
223 $this->object->setVotingPeriodEnd($period->getEnd()->get(IL_CAL_UNIX));
224 } else {
225 $this->object->setVotingPeriodBegin(0);
226 $this->object->setVotingPeriodEnd(0);
227 $this->object->setVotingPeriod(false);
228 }
229 }
230
231 protected function setTabs(): void
232 {
233 $this->help->setScreenIdComponent("poll");
234
235 if ($this->checkPermissionBool("write")) {
236 $this->tabs_gui->addTab(
237 "question",
238 $this->lng->txt("question"),
239 $this->ctrl->getLinkTarget($this, "")
240 );
241 }
242
243 if ($this->checkPermissionBool("write")) {
244 $this->tabs_gui->addTab(
245 "settings",
246 $this->lng->txt("settings"),
247 $this->ctrl->getLinkTarget($this, "edit")
248 );
249
250 $this->tabs_gui->addTab(
251 "participants",
252 $this->lng->txt("poll_result"),
253 $this->ctrl->getLinkTarget($this, "showParticipants")
254 );
255
256 $this->tabs_gui->addTab(
257 "export",
258 $this->lng->txt("export"),
259 $this->ctrl->getLinkTargetByClass("ilexportgui", "")
260 );
261 }
262
263 // will add permissions if needed
264 parent::setTabs();
265 }
266
267 public function executeCommand(): void
268 {
269 $next_class = $this->ctrl->getNextClass($this);
270 $cmd = $this->ctrl->getCmd();
271
272 $this->tpl->loadStandardTemplate();
273
274 // add entry to navigation history
275 if (!$this->getCreationMode() &&
276 $this->getAccessHandler()->checkAccess("read", "", $this->node_id)) {
277 $link = $this->ctrl->getLinkTargetByClass("ilrepositorygui", "frameset");
278 $this->nav_history->addItem($this->node_id, $link, "poll");
279 }
280
281 switch ($next_class) {
282 case "ilcommonactiondispatchergui":
284 $this->ctrl->forwardCommand($gui);
285 break;
286
287 case "ilpermissiongui":
288 $this->prepareOutput();
289 $this->tabs->activateTab("id_permissions");
290 $perm_gui = new ilPermissionGUI($this);
291 $this->ctrl->forwardCommand($perm_gui);
292 break;
293
294 case "ilobjectcopygui":
295 $cp = new ilObjectCopyGUI($this);
296 $cp->setType("poll");
297 $this->ctrl->forwardCommand($cp);
298 break;
299
300 case 'ilexportgui':
301 $this->prepareOutput();
302 $this->tabs->activateTab("export");
303 $exp_gui = new ilExportGUI($this);
304 $this->ctrl->forwardCommand($exp_gui);
305 break;
306
307 default:
308 parent::executeCommand();
309 }
310 }
311
312 public function render(?ilPropertyFormGUI $a_form = null): void
313 {
314 if (!$this->checkPermissionBool("write")) {
315 $this->tpl->setOnScreenMessage('info', $this->lng->txt("no_permission"));
316 return;
317 }
318
319 $this->tabs->activateTab("question");
320
321 $message = "";
322 if (!$a_form) {
323 if ($this->object->countVotes()) {
324 $url = $this->ctrl->getLinkTarget($this, "showParticipants");
325
326 $mbox = $this->ui_factory->messageBox()->info($this->lng->txt("poll_votes_no_edit"))
327 ->withLinks([$this->ui_factory->link()->standard(
328 $this->lng->txt("poll_result"),
329 $url
330 )]);
331
332 $message = $this->ui_renderer->render($mbox);
333 }
334
335 $a_form = $this->initQuestionForm((bool) $this->object->countVotes());
336 }
337
338 $this->tpl->setPermanentLink('poll', $this->node_id);
339
340 $this->tpl->setContent($message . $a_form->getHTML());
341 }
342
343 protected function initQuestionForm(bool $a_read_only = false): ilPropertyFormGUI
344 {
345 $form = new ilPropertyFormGUI();
346 $form->setFormAction($this->ctrl->getFormAction($this, "saveQuestion"));
347 $form->setTitle($this->lng->txt("obj_poll"));
348
349 $question = new ilTextAreaInputGUI($this->lng->txt("poll_question"), "question");
350 $question->setRequired(true);
351 $question->setCols(40);
352 $question->setRows(2);
353 $question->setValue($this->object->getQuestion());
354 $question->setDisabled($a_read_only);
355 $form->addItem($question);
356
357 $dimensions = " (" . ilObjPoll::getImageSize() . "px)";
358 $img = new ilImageFileInputGUI($this->lng->txt("poll_image") . $dimensions, "image");
359 $img->setDisabled($a_read_only);
360 $form->addItem($img);
361
362 // show existing file
363 $url = $this->poll_image_factory->handler()->getThumbnailImageURL($this->data_factory->objId($this->object_id));
364 if (!is_null($url)) {
365 $img->setImage($url);
366 }
367
368 $anonymous = new ilRadioGroupInputGUI($this->lng->txt("poll_mode"), "mode");
369 $option = new ilRadioOption($this->lng->txt("poll_mode_anonymous"), "0");
370 $option->setInfo($this->lng->txt("poll_mode_anonymous_info"));
371 $anonymous->addOption($option);
372 $option = new ilRadioOption($this->lng->txt("poll_mode_personal"), "1");
373 $option->setInfo($this->lng->txt("poll_mode_personal_info"));
374 $anonymous->addOption($option);
375 $anonymous->setValue($this->object->getNonAnonymous() ? "1" : "0");
376 $anonymous->setDisabled($a_read_only);
377 $form->addItem($anonymous);
378
379 $answers = new ilTextInputGUI($this->lng->txt("poll_answers"), "answers");
380 $answers->setRequired(true);
381 $answers->setMulti(true, true);
382 $answers->setDisabled($a_read_only);
383 $form->addItem($answers);
384
385 $multi_answers = array();
386 foreach ($this->object->getAnswers() as $idx => $item) {
387 $answer = (string) ($item['answer'] ?? '');
388 if (!$idx) {
389 $answers->setValue($answer);
390 }
391 $multi_answers[] = $answer;
392 }
393 $answers->setMultiValues($multi_answers);
394
395 $answer_count = count($this->object->getAnswers());
396 $limit = new ilCheckboxInputGUI($this->lng->txt("poll_limit_number_of_answers"), 'limit');
397 $limit->setChecked($this->object->getMaxNumberOfAnswers() !== $answer_count);
398 $limit->setDisabled($a_read_only);
399 $nanswers = new ilNumberInputGUI($this->lng->txt("poll_max_number_of_answers"), "nanswers");
400 $nanswers->setRequired(true);
401 $nanswers->setMinValue(1);
402 $nanswers->setSize(3);
403 $max_answers = 1;
404 if ($this->object->getMaxNumberOfAnswers() < $answer_count) {
405 $max_answers = $this->object->getMaxNumberOfAnswers();
406 }
407 $nanswers->setValue((string) $max_answers);
408 $nanswers->setDisabled($a_read_only);
409 $limit->addSubItem($nanswers);
410 $form->addItem($limit);
411
412 if (!$a_read_only) {
413 $form->addCommandButton("saveQuestion", $this->lng->txt("save"));
414 }
415
416 return $form;
417 }
418
419 // TODO have the form return an error if limit is above no. of answers
420 public function saveQuestion(): void
421 {
422 $form = $this->initQuestionForm();
423 if ($form->checkInput()) {
424 $prelim_nr_of_answers = count((array) $form->getInput("answers"));
425
426 if (
427 $form->getInput("limit") &&
428 (int) $form->getInput("nanswers") >= $prelim_nr_of_answers
429 ) {
430 $form->getItemByPostVar('nanswers')->setAlert(
431 $this->lng->txt('poll_limit_not_below_answer_count')
432 );
433 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('form_input_not_valid'));
434 $form->setValuesByPost();
435 $this->render($form);
436 return;
437 }
438
439 $nr_of_anwers = $this->object->saveAnswers((array) $form->getInput("answers"));
440
441 if ($form->getInput("limit")) {
442 // #15073
443 $this->object->setMaxNumberOfAnswers(min((int) $form->getInput("nanswers"), $nr_of_anwers));
444 } else {
445 $this->object->setMaxNumberOfAnswers($nr_of_anwers);
446 }
447
448 $this->object->setQuestion((string) $form->getInput("question"));
449 $this->object->setNonAnonymous((bool) $form->getInput("mode"));
450
451 $image = $form->getItemByPostVar("image");
452 $res = $form->getFileUpload("image");
453 if (!empty($res)) {
454 $this->object->uploadImage(
455 (string) ($res['tmp_name'] ?? ""),
456 (string) ($res['name'] ?? "")
457 );
458 } elseif ($image->getDeletionFlag()) {
459 $this->poll_image_factory->handler()->deleteImage(
460 $this->data_factory->objId($this->object->getId()),
461 $this->user->getId()
462 );
463 }
464
465 if ($this->object->update()) {
466 $this->tpl->setOnScreenMessage('success', $this->lng->txt("settings_saved"), true);
467 $this->ctrl->redirect($this, "render");
468 }
469 }
470
471 $form->setValuesByPost();
472 $this->render($form);
473 }
474
475 protected function setParticipantsSubTabs(string $a_active): void
476 {
477 if (!$this->object->getNonAnonymous()) {
478 return;
479 }
480
481 $this->tabs->addSubTab(
482 "result_answers",
483 $this->lng->txt("poll_result_answers"),
484 $this->ctrl->getLinkTarget($this, "showParticipants")
485 );
486 $this->tabs->addSubTab(
487 "result_users",
488 $this->lng->txt("poll_result_users"),
489 $this->ctrl->getLinkTarget($this, "showParticipantVotes")
490 );
491
492 $this->tabs->activateSubTab($a_active);
493 }
494
495 public function showParticipants(): void
496 {
497 if (!$this->checkPermissionBool("write")) {
498 $this->tpl->setOnScreenMessage('info', $this->lng->txt("no_permission"));
499 return;
500 }
501
502 $this->tabs->activateTab("participants");
503 $this->setParticipantsSubTabs("result_answers");
504
505 $tbl = new ilPollAnswerTableGUI($this, "showParticipants");
506
507 if ($tbl->getItems()) {
508 $this->toolbar->addComponent(
509 $this->ui_factory->button()->standard(
510 $this->lng->txt("poll_delete_votes"),
511 $this->ctrl->getLinkTarget($this, 'confirmDeleteAllVotes')
512 )
513 );
514 }
515
516 $this->tpl->setContent($tbl->getHTML());
517 }
518
519 public function showParticipantVotes(): void
520 {
521 if (!$this->checkPermissionBool("write") ||
522 !$this->object->getNonAnonymous()) {
523 $this->tpl->setOnScreenMessage('info', $this->lng->txt("no_permission"));
524 return;
525 }
526
527 $this->tabs->activateTab("participants");
528 $this->setParticipantsSubTabs("result_users");
529
530 $tbl = new ilPollUserTableGUI($this, "showParticipantVotes");
531 $this->tpl->setContent($tbl->getHTML());
532 }
533
534 public function confirmDeleteAllVotes(): void
535 {
536 if (!$this->checkPermissionBool("write")) {
537 $this->tpl->setOnScreenMessage('info', $this->lng->txt("no_permission"));
538 return;
539 }
540
541 $this->tabs->activateTab("participants");
542
543 $cgui = new ilConfirmationGUI();
544 $cgui->setHeaderText($this->lng->txt("poll_delete_votes_sure"));
545
546 $cgui->setFormAction($this->ctrl->getFormAction($this));
547 $cgui->setCancel($this->lng->txt("cancel"), "showParticipants");
548 $cgui->setConfirm($this->lng->txt("confirm"), "deleteAllVotes");
549
550 $this->tpl->setContent($cgui->getHTML());
551 }
552
553 public function deleteAllVotes(): void
554 {
555 if (!$this->checkPermissionBool("write")) {
556 $this->tpl->setOnScreenMessage('info', $this->lng->txt("no_permission"));
557 return;
558 }
559
560 $this->object->deleteAllVotes();
561
562 $this->ctrl->redirect($this, "showParticipants");
563 }
564
565 public function vote(): void
566 {
567 global $DIC;
568 $aw = (array) ($DIC->http()->request()->getParsedBody()['aw'] ?? array());
569
570 $valid = true;
571 if ($this->object->getMaxNumberOfAnswers() > 1) {
572 if (count($aw) > $this->object->getMaxNumberOfAnswers()) {
573 $valid = false;
574 }
575 if (!count($aw)) {
576 $valid = false;
577 }
578 } elseif ((int) !$aw) {
579 $valid = false;
580 }
581
582 $session_last_poll_vote = ilSession::get('last_poll_vote');
583 if ($valid && $this->user->getId() != ANONYMOUS_USER_ID) {
584 unset($session_last_poll_vote[$this->object->getId()]);
585 ilSession::set('last_poll_vote', $session_last_poll_vote);
586 $this->object->saveVote($this->user->getId(), $aw);
587
588 $this->sendNotifications();
589 } else {
590 $session_last_poll_vote[$this->object->getId()] = $aw;
591 ilSession::set('last_poll_vote', $session_last_poll_vote);
592 }
593
594 ilUtil::redirect(ilLink::_getLink($this->tree->getParentId($this->ref_id)));
595 }
596
597 public function subscribe(): void
598 {
599 ilNotification::setNotification(ilNotification::TYPE_POLL, $this->user->getId(), $this->object->getId(), true);
600
601 $this->tpl->setOnScreenMessage('success', $this->lng->txt("poll_notification_activated"), true);
602 ilUtil::redirect(ilLink::_getLink($this->tree->getParentId($this->ref_id)));
603 }
604
605 public function unsubscribe(): void
606 {
607 ilNotification::setNotification(ilNotification::TYPE_POLL, $this->user->getId(), $this->object->getId(), false);
608
609 $this->tpl->setOnScreenMessage('success', $this->lng->txt("poll_notification_deactivated"), true);
610 ilUtil::redirect(ilLink::_getLink($this->tree->getParentId($this->ref_id)));
611 }
612
613 protected function sendNotifications(): void
614 {
615 // recipients
618 $this->object->getId(),
619 null,
620 true
621 );
622 if (!count($users)) {
623 return;
624 }
625
626 $ntf = new ilSystemNotification();
627 $ntf->setLangModules(array("poll"));
628 $ntf->setRefId($this->ref_id);
629
630 $ntf->setSubjectLangId('poll_vote_notification_subject');
631 $ntf->setIntroductionLangId('poll_vote_notification_body');
632 $ntf->setGotoLangId('poll_vote_notification_link');
633 $ntf->setReasonLangId('poll_vote_notification_reason');
634
635 $notified = $ntf->sendMailAndReturnRecipients($users, null, "read");
636
638 }
639
640 protected function addLocatorItems(): void
641 {
642 if (is_object($this->object)) {
643 $this->locator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $this->node_id);
644 }
645 }
646
647 public static function _goto(string $a_target): void
648 {
649 global $DIC;
650
651 $tree = $DIC->repositoryTree();
652 $ilAccess = $DIC->access();
653 $ilCtrl = $DIC->ctrl();
654
655 $id = explode("_", $a_target);
656 $ref_id = (int) ($id[0] ?? 0);
657
658 // #13728 - used in notification mostly
659 if ($ilAccess->checkAccess("write", "", $ref_id)) {
660 $ilCtrl->setParameterByClass(self::class, "ref_id", $ref_id);
661 $ilCtrl->redirectByClass([ilRepositoryGUI::class, self::class,], "showParticipants");
662 } else {
663 // is sideblock: so show parent instead
664 $container_id = $tree->getParentId($ref_id);
665
666 // #11810
667 ilUtil::redirect(ilLink::_getLink($container_id) .
669 }
670 }
671}
$comment
Definition: buildRTE.php:72
Builds a Color from either hex- or rgb values.
Definition: Factory.php:31
Builds data types.
Definition: Factory.php:36
const IL_CAL_UNIX
This class represents a checkbox property in a property form.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
input GUI for a time span (start and end date)
@classDescription Date and time handling
Export User Interface Class.
This class represents a section header in a property form.
Help GUI class.
This class represents an image file property in a property form.
Last visited history for repository items.
static updateNotificationTime(int $type, int $id, array $user_ids, ?int $page_id=null, bool $activate_new_entries=true)
Update the last mail timestamp for given object and users.
static getNotificationsForObject(int $type, int $id, ?int $page_id=null, bool $ignore_threshold=false)
Get all users/recipients for given object.
static setNotification(int $type, int $user_id, int $id, bool $status=true)
Set notification status for object and user.
This class represents a number property in a property form.
Class ilObjPollGUI.
UIRenderer $ui_renderer
render(?ilPropertyFormGUI $a_form=null)
afterSave(ilObject $new_object)
Post (successful) object creation hook.
validateCustom(ilPropertyFormGUI $form)
Validate custom values (if not possible with checkInput())
setParticipantsSubTabs(string $a_active)
initEditCustomForm(ilPropertyFormGUI $a_form)
Add custom fields to update form.
executeCommand()
execute command
setTabs()
create tabs (repository/workspace switch)
getType()
Functions that must be overwritten.
initQuestionForm(bool $a_read_only=false)
updateCustom(ilPropertyFormGUI $form)
Insert custom update form values into object.
PollImageFactoryInterface $poll_image_factory
UIFactory $ui_factory
addLocatorItems()
Functions to be overwritten.
static _goto(string $a_target)
getEditFormCustomValues(array &$a_values)
Add values to custom edit fields.
__construct(int $a_id=0, int $a_id_type=self::REPOSITORY_NODE_ID, int $a_parent_node_id=0)
ilNavigationHistory $nav_history
DataFactory $data_factory
const int VIEW_RESULTS_AFTER_VOTE
const int VIEW_RESULTS_ALWAYS
const int SHOW_RESULTS_AS_STACKED_CHART
static getImageSize()
const int VIEW_RESULTS_NEVER
const int VIEW_RESULTS_AFTER_PERIOD
const int SHOW_RESULTS_AS_BARCHART
New implementation of ilObjectGUI.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
prepareOutput(bool $show_sub_objects=true)
GUI class for the workflow of copying objects.
Class ilObject Basic functions for all objects.
static _getAllReferences(int $id)
get all reference ids for object ID
static _lookupObjId(int $ref_id)
TableGUI class for poll answers.
TableGUI class for poll users.
This class represents a property form user interface.
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-...
getItemByPostVar(string $a_post_var)
This class represents a property in a property form.
This class represents an option in a radio group.
static get(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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a text area property in a property form.
This class represents a text property in a property form.
getParentId(int $a_node_id)
get parent id of given node
static redirect(string $a_script)
const ANONYMOUS_USER_ID
Definition: constants.php:27
$valid
An entity that renders components to a string output.
Definition: Renderer.php:31
$res
Definition: ltiservices.php:69
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$results
global $DIC
Definition: shib_login.php:26
$url
Definition: shib_logout.php:68
$message
Definition: xapiexit.php:31