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